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
#!/usr/bin/env python | |
def application(environ, start_response): | |
start_response("200 OK", [("Content-Type", "text/html; charset=utf-8")]) | |
return ["Hello, World!"] | |
if __name__ == "__main__": | |
from gevent.wsgi import WSGIServer | |
address = "localhost", 8080 |
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
<?php | |
declare(ticks = 1); | |
# Einhorn sends a "USR2" signal to our server process | |
# in case the server shuts down. | |
pcntl_signal(SIGUSR2, function() { | |
fwrite(STDERR, "Worker shutting down...\n"); | |
exit(0); | |
}); |
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
# -*- coding: utf-8 -*- | |
""" | |
pygments.formatters.htmlline | |
~~~~~~~~~~~~~~~~~~~~~~~~ | |
Formatter for HTML output which wraps each line in a span. | |
""" | |
__all__ = ['HtmlLineFormatter'] |
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
// level0 project main.go | |
package main | |
import ( | |
"bytes" | |
"io/ioutil" | |
"log" | |
"math" | |
"os" | |
"reflect" |
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
# Twilio HTTP HAProxy Configuration | |
# Version: 0.1 | |
global | |
daemon | |
log 127.0.0.1 local0 info | |
maxconn 60000 | |
spread-checks 3 | |
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
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
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
/* | |
--- | |
name: guilloche | |
script: guilloche.js | |
description: guilloche | |
provides: [Guilloche] | |
... | |
*/ |
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
# Script to be placed in elasticsearch/bin | |
# Launch it from elasticsearch dir | |
# bin/backup indexname | |
# We suppose that data are under elasticsearch/data | |
# It will create a backup file under elasticsearch/backup | |
if [ -z "$1" ]; then | |
INDEX_NAME="dummy" | |
else | |
INDEX_NAME=$1 |
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
#! /usr/bin/env python | |
from boto.ses.connection import SESConnection | |
import os | |
import sys | |
import subprocess | |
import socket | |
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp' | |
if __name__ == '__main__': |
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 wsgiref.simple_server import make_server, WSGIServer | |
from SocketServer import ThreadingMixIn | |
from time import sleep | |
def simple_app(env, start_response): | |
status = '200 OK' | |
headers = [('Content-type', 'text/plain')] | |
start_response(status, headers) |
OlderNewer