Skip to content

Instantly share code, notes, and snippets.

Avatar
🙈
Taking care of my kid

Matt Wright mattupstate

🙈
Taking care of my kid
View GitHub Profile
@lewisd32
lewisd32 / iptableflip.sh
Created Apr 15, 2015
Snippet of Unbounce script for restarting HAProxy with zero downtime
View iptableflip.sh
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
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
blue_prefix=855
green_prefix=866
@hbokh
hbokh / gist:33d9ff5d87e433410e77
Created May 6, 2014
Logstash, collectd and kibana for one host's system resources
View gist:33d9ff5d87e433410e77
{
"title": "System Resources",
"services": {
"query": {
"list": {
"0": {
"query": "collectd_type:\"load\"",
"alias": "Load",
"color": "#70DBED",
"id": 0,
View jsonalchemy.py
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
josegonzalez / access.lua
Created Dec 3, 2012
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
View access.lua
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
View halo_json_request.json
{
"_links": {
"self": { "href": "/foo" },
},
"_controls": {
"attack": {
"target": "/attacks",
"method": "POST",
"headers": {
"Content-Type": "application/json"
View translate.py
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)
View MaxRectsBinPack.as
/*
Implements different bin packer algorithms that use the MAXRECTS data structure.
See http://clb.demon.fi/projects/even-more-rectangle-bin-packing
Author: Jukka Jylänki
- Original
Author: Claus Wahlers
- Ported to ActionScript3
You can’t perform that action at this time.