This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = Stormy | |
description = Deals with storms. | |
core = 7.x | |
package = ZZZZ Stormy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convert_list_to_object_keys( the_list ) { | |
return the_list.reduce( | |
function ( the_object, a_key ) { | |
the_object[a_key] = true; | |
return the_object; | |
}, | |
{} | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $0 is for inspected element in recent browsers' development tools | |
var myObj = Ext.getCmp($0.id); | |
// Capture | |
Ext.util.Observable.capture(myObj, function(evname) {console.log(evname, arguments);}) | |
// Release | |
Ext.util.Observable.releaseCapture(myObj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function expand_siblingless_child_nodes_listener( parent_node ) { | |
if ( parent_node.firstChild === parent_node.lastChild ) { | |
if ( parent_node.firstChild !== null ) { | |
parent_node.firstChild.expand(); | |
} | |
} | |
} | |
var the_store = Ext.create( | |
'Ext.data.TreeStore', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
export PYTHONPATH=${HOME}/lib/python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TIMEOUT=3600 | |
if [ $# -lt 1 ] ; then | |
cat >&2 <<EOF | |
Usage: $0 [SSH_OPTIONS] [user@]host | |
Background SSH connection, using -f and sleep $TIMEOUT | |
EOF | |
exit 1 | |
else | |
ssh -f "$@" sleep $TIMEOUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Log and run an external command | |
# Usage: Action [redirections] command arguments... | |
# Redirections: | |
# --stdin=file redirect input from file | |
# --stdout=file redirect output to file | |
# --stderr=file redirect error to file | |
function Action() { | |
if [[ $# -gt 0 ]] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Module-specific watchdog wrapper. | |
* | |
* Apply var_export to variables where key starts with '@@' or '%%'. | |
* (Keys in message should not have doubled sigils.) | |
*/ | |
function _mymodule_watchdog($message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) { | |
$vars = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Mimic perl's gmtime function. | |
* | |
* From ctime(3): | |
* The members of the tm structure are: | |
* tm_sec The number of seconds after the minute, normally in the | |
* range 0 to 59, but can be up to 60 to allow for leap seconds. | |
* tm_min The number of minutes after the hour, in the range 0 to 59. | |
* tm_hour The number of hours past midnight, in the range 0 to 23. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import permutations | |
WORD_FILE = '.../words' | |
words = set(x.strip() for x in open(WORD_FILE).readlines()) | |
LETTERS = 'abcdefg' | |
perms = set((''.join(x).split())[0] for x in permutations(LETTERS+' ')) |