This file contains 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 pika | |
from pika.adapters.twisted_connection import TwistedConnection | |
from pika.adapters.twisted_connection import TwistedProtocolConnection | |
from pika.connection import ConnectionParameters | |
from pika import BasicProperties | |
from twisted.internet.task import LoopingCall | |
from twisted.python import log | |
import logging | |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 hashlib import sha1 | |
import hmac | |
import base64 | |
import time | |
import random | |
import sys | |
import collections | |
import ConfigParser | |
import urllib | |
import random |
This file contains 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 Queue, memcache | |
from contextlib import contextmanager | |
from zope.interface import implements, Interface | |
from zope.component import getGlobalSiteManager | |
gsm = getGlobalSiteManager() | |
memcache.Client = type('Client', (object,), dict(memcache.Client.__dict__)) | |
# Client.__init__ references local, so need to replace that, too |
This file contains 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
{ | |
"layers": { | |
"0": { | |
"class": "ava", | |
"src": "results\/ava_Napa_County\/ava_Napa_County.shp" | |
}, | |
"1": { | |
"class": "parcels", | |
"src": "results\/PARCELS_PUBLIC\/PARCELS_PUBLIC.shp" | |
} |
This file contains 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 fabric | |
from fabric.api import * | |
from fabric.api import run, roles, execute | |
from fabric.operations import sudo | |
if env.ssh_config_path and os.path.isfile(os.path.expanduser(env.ssh_config_path)): | |
env.use_ssh_config = True |
This file contains 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 Track(src, spriteLength, audioLead) { | |
var track = this, | |
audio = document.createElement('audio'); | |
audio.src = src; | |
audio.autobuffer = true; | |
audio.load(); | |
audio.muted = true; // makes no difference on iOS :( | |
/* This is the magic. Since we can't preload, and loading requires a user's | |
input. So we bind a touch event to the body, and fingers crossed, the |
This file contains 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
{ | |
"builders":[{ | |
"type": "docker", | |
"image": "ubuntu:14.04", | |
"export_path": "image.tar" | |
}], | |
"provisioners":[ | |
{ | |
"type": "shell", | |
"inline": [ |
This file contains 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
2015/10/20 13:29:04 ui: [0;32m docker: x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/DES.o -o build/lib.linux-x86_64-2.7/Crypto/Cipher/_DES.so[0m | |
2015/10/20 13:29:04 ui: [0;32m docker: building 'Crypto.Cipher._DES3' extension[0m | |
2015/10/20 13:29:04 ui: [0;32m docker: x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/include/python2.7 -c src/DES3.c -o build/temp.linux-x86_64-2.7/src/DES3.o[0m | |
2015/10/20 13:29:04 ui: [0;32m docker: x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g |
This file contains 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
formatter = LogstashFormatterV1() | |
log_path = '/tmp/es-client-info.log' | |
logger = logging.getLogger('elasticsearch') | |
logger.propagate = False | |
logger.setLevel(logging.INFO) | |
consoleHandler = logging.StreamHandler() | |
consoleHandler.setFormatter(formatter) | |
fileHandler = logging.handlers.RotatingFileHandler(log_path, | |
maxBytes=0.5*10**9, | |
backupCount=3) |
OlderNewer