Skip to content

Instantly share code, notes, and snippets.

ai /
Last active Sep 12, 2020
Website requirements

Amplifr logo

Amplifr Landings Rules

Amplifr’s rules for landing pages created by outsource.


View gist:8121038
lg = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
co = checkout
ci = commit
cheeaun /
Last active Dec 18, 2015
RedDotRubyConf 2013 links & resources
DeLaGuardo /
Created Feb 20, 2013
Decorator "retry" with backoff.
import time
from functools import wraps
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
def deco_retry(f):
def f_retry(*args, **kwargs):
mtries, mdelay = tries, delay
rgreenjr / postgres_queries_and_commands.sql
Last active Sep 28, 2020
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
francescoagati / main.rb
Created Aug 12, 2012
celluloid-io and faraday
View main.rb
require 'celluloid/io'
require 'faraday'
require 'benchmark'
class HttpClient
include Celluloid::IO
attr_accessor :conn
View gist:2947172
class Foo
puts "Hello, world!"
module Monkey
def self.included(base)
base.class_eval do
Timrael / gist:2947135
Created Jun 18, 2012
Monkey Patching
View gist:2947135
class Foo
def bar
puts "Hello, world!"
module Monkey
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
burke /
Created Jan 27, 2012 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.


You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

View cream_and_sugar.rb
require "money"
class Decorator < BasicObject
undef_method :==
def initialize(component)
@component = component
def method_missing(name, *args, &block)
You can’t perform that action at this time.