Skip to content

Instantly share code, notes, and snippets.

lewisd32 /
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
hbokh / gist:33d9ff5d87e433410e77
Created May 6, 2014 12:25
Logstash, collectd and kibana for one host's system resources
"title": "System Resources",
"services": {
"query": {
"list": {
"0": {
"query": "collectd_type:\"load\"",
"alias": "Load",
"color": "#70DBED",
"id": 0,
import sqlalchemy
from sqlalchemy import *
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String
def process_bind_param(self, value, dialect):
josegonzalez / access.lua
Created December 3, 2012 18:26
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
"_links": {
"self": { "href": "/foo" },
"_controls": {
"attack": {
"target": "/attacks",
"method": "POST",
"headers": {
"Content-Type": "application/json"
from babel import support
def man_gettext(string, domain, **variables):
translations = support.Translations.load(os.path.join(www.root_path, 'translations'))
return translations.dgettext(domain, string) % variables
def man_lazy_gettext(string, domain, **variables):
from speaklater import make_lazy_string
return make_lazy_string(man_gettext, string, domain, **variables)
Implements different bin packer algorithms that use the MAXRECTS data structure.
Author: Jukka Jylänki
- Original
Author: Claus Wahlers
- Ported to ActionScript3