Skip to content

Instantly share code, notes, and snippets.

@ai
ai / requirements.md
Last active Sep 12, 2020
Website requirements
View requirements.md

Amplifr logo

Amplifr Landings Rules

Amplifr’s rules for landing pages created by outsource.

Requirements

View gist:8121038
[alias]
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
cheeaun / rdrc2013.md
Last active Dec 18, 2015
RedDotRubyConf 2013 links & resources
View rdrc2013.md
@DeLaGuardo
DeLaGuardo / retry_decorator.py
Created Feb 20, 2013
Decorator "retry" with backoff.
View retry_decorator.py
import time
from functools import wraps
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
def deco_retry(f):
@wraps(f)
def f_retry(*args, **kwargs):
mtries, mdelay = tries, delay
@rgreenjr
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
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
def self.bar
puts "Hello, world!"
end
end
module Monkey
def self.included(base)
base.extend(ClassMethods)
base.class_eval do
@Timrael
Timrael / gist:2947135
Created Jun 18, 2012
Monkey Patching
View gist:2947135
class Foo
def bar
puts "Hello, world!"
end
end
module Monkey
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
@burke
burke / 0-readme.md
Created Jan 27, 2012 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv
View 0-readme.md

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.

Requirements

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
end
def method_missing(name, *args, &block)
You can’t perform that action at this time.