I found this berried online, and figured a gist would be a good place for it.
HowTo
here is a quick howto: I am assuming ~/py/lib as the directory in this example
cd ~/py/lib
git clone git://gist.github.com/1617045.git sidereal
var countries = [ | |
{ | |
"name": "Afghanistan", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"code": "AX" | |
}, | |
{ |
[ | |
{ | |
"name": "Afghanistan", | |
"code": "AF" | |
}, | |
{ | |
"name": "Åland Islands", | |
"code": "AX" | |
}, | |
{ |
#!/bin/bash | |
# Usage: earthporn [+format] [-time] [logfile] | |
# Dependencies: bash, wget, mktemp... and well, date and sleep | |
imgfile=~/.earthporn | |
# Help and version functions | |
help () { | |
echo "Randomly picks one of the amazing photos at http://imgur.com/r/earthporn" | |
echo "and sets it as the background image." |
#!/bin/bash | |
MAXSIZE=90000 | |
LOGDIR=/var/www/log/ | |
cd $LOGDIR | |
for FILENAME in *.log; do | |
SIZE=$(du -b $FILENAME | cut -f 1) |
<?php | |
/** | |
* | |
* @param string $dir | |
* @return array | |
*/ | |
function get_php_files_in_dir($dir) | |
{ | |
$bin = array (); |
<?php | |
# Adds your library to the beginning of the php include path | |
addInclude('~/code/libs', FALSE); | |
$loader = new SplClassLoader(); | |
# adds the php include path to the class | |
$loader->setIncludePathLookup(true); | |
$loader->add('Zend'); |
<?php | |
class Msg { | |
public static $msgss = array(); | |
/** | |
* Add a message to the message array (adds to the user's session) | |
* @param string $type You can have several types of messages, these are class names for Bootstrap's messaging classes, usually, info, error, success, warning | |
* @param string $message The message you want to add to the list |
I found this berried online, and figured a gist would be a good place for it.
HowTo
here is a quick howto: I am assuming ~/py/lib as the directory in this example
cd ~/py/lib
git clone git://gist.github.com/1617045.git sidereal
# | |
# dtuple.py: Database Tuple handling | |
# | |
# Written by Greg Stein. Public Domain. | |
# No Copyright, no Rights Reserved, and no Warranties. | |
# | |
# This module is maintained by Greg and is available at: | |
# http://www.lyra.org/greg/python/dtuple.py | |
# | |
# Some discussion/usage of this module can be found at: |
#! /bin/bash | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
. /lib/lsb/init-functions | |
export FILE=/etc/network/interfaces | |
case "$1" in | |
start) | |
SLEEPFOR=1200 |