I hereby claim:
- I am jfilipe on github.
- I am jfilipe (https://keybase.io/jfilipe) on keybase.
- I have a public key whose fingerprint is 851D DE4A B21B 56FD 62B0 DBFE C7A2 1F04 B319 5AA1
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script> | |
<script type="text/javascript" src="jquery.tipsy.js"></script> | |
<link href="tipsy.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<div id="chart"></div> |
# coding:utf-8 | |
# Copyright 2011 litl, LLC. All Rights Reserved. | |
import httplib | |
import re | |
import urllib | |
import urlparse | |
from flask import Blueprint, request, Response, url_for | |
from werkzeug.datastructures import Headers |
import bottle | |
from wsgiproxy.app import WSGIProxyApp | |
# Remove "hop-by-hop" headers (as defined by RFC2613, Section 13) | |
# since they are not allowed by the WSGI standard. | |
FILTER_HEADERS = [ | |
'Connection', | |
'Keep-Alive', | |
'Proxy-Authenticate', | |
'Proxy-Authorization', |
# %cpaste the following code in a shell_plus session | |
import logging | |
l = logging.getLogger('django.db.backends') | |
l.setLevel(logging.DEBUG) | |
l.addHandler(logging.StreamHandler()) |
import hmac | |
from hashlib import sha1 | |
from time import time | |
NIBBLER_CUSTOMER_ID = 'xxx' | |
PRIVATE_BUNCH_NAME = 'xxx' | |
FILENAME = 'xxx' | |
LINK_EXPIRE_SECONDS = 60 | |
NIBBLER_ACCESS_KEY = 'xxx' |
I hereby claim:
To claim this, I am signing this object:
# in a console session: | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
# This task should be run inside an environment that is already configured to connect to the redis | |
# instance that we're transfering AWAY FROM. | |
# | |
# The task should be handed the URL of the redis instance that we're MOVING TO. | |
# | |
# To run it and pass in the destination Redis you'd do something like this: | |
# rake sidekiq:transfer[redis://...] | |
# | |
# As jobs are added to the destination Redis, they're deleted from the source Redis. This | |
# allows the task to be restarted cleanly if it fails in the middle due to a network error |
Regular expression cheat sheet for Varnish | |
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
regular expressions, for a complete guide, see: "man 7 regex" | |
Basic matching: | |
req.url ~ "searchterm" | |
True if req.url contains "searchterm" anywhere. | |
req.url == "searchterm" |
CREATE EXTENSION btree_gist; | |
CREATE TABLE room_reservations ( | |
room_id integer, | |
reserved_at timestamptz, | |
reserved_until timestamptz, | |
canceled boolean DEFAULT false, | |
EXCLUDE USING gist ( | |
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH && | |
) WHERE (not canceled) |