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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) | |
func main() { |
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
package main | |
import ( | |
"fmt" | |
"hash/adler32" | |
"hash/crc32" | |
"hash/fnv" | |
"github.com/spaolacci/murmur3" | |
) |
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
package main | |
import "fmt" | |
type RingBuffer struct { | |
size int | |
buffer []int | |
head int | |
tail int | |
} |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"strings" | |
"time" | |
) |
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
import numbers | |
def flatten(xs): | |
""" | |
# Flatten arbitrarily nested arrays of integers | |
# e.g. [[1, 2, [3]], 4] -> [1, 2, 3, 4] | |
""" | |
# if not list, return single item list but only if its a number | |
if not isinstance(xs, list): |
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 pprint import pprint | |
class Node(dict): | |
char = None | |
def __init__(self, char): | |
self.char = char | |
def __str__(self): |
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
import os | |
import sys | |
from hachoir_metadata import extractMetadata | |
from hachoir_parser import createParser | |
def getinfo(rootdir, extensions=(".avi", ".mp4", ".mkv")): | |
if not isinstance(rootdir, unicode): | |
rootdir = rootdir.decode(sys.getfilesystemencoding()) | |
for dirpath, dirs, files in os.walk(rootdir): |
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
... | |
var tplCache *template.Template | |
... | |
func init() { | |
CacheTemplates() | |
} |
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
package main | |
import ( | |
"errors" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"math" | |
"net/http" |
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
createdb template_postgis -E UTF-8 | |
createlang plpgsql template_postgis | |
psql -d template_postgis -f /usr/local/Cellar/postgis/2.0.3/share/postgis/postgis.sql | |
psql -d template_postgis -f /usr/local/Cellar/postgis/2.0.3/share/postgis/spatial_ref_sys.sql | |
psql -d postgres | |
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis'; | |
createdb -T template_postgis <db name> |
NewerOlder