Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
PASTEL='{
"Ansi 0 Color" = {
"Blue Component" = 0.3097887;
"Green Component" = 0.3097887;
"Red Component" = 0.3097887;
};
"Ansi 1 Color" = {
"Blue Component" = 0.3764706;
@rgould
rgould / about.md
Created August 9, 2011 20:56 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
rvm install 1.9.3-p125
rvm use 1.9.3-p125
rvm gemset create gaggleup
cd ~/gaggleup
gem install bundler
bundle config build.ruby-debug-base19 --with-ruby-include=$rvm_path/src/$(rvm tools strings)
bundle install
@rgould
rgould / gist:2030858
Created March 13, 2012 19:13
AWS's ElasticLoadBalancing tools filenames
rgould@reifnir ~/dev » ls ElasticLoadBalancing-1.0.15.1/bin
elb-apply-security-groups-to-lb
elb-associate-route53-hosted-zone
elb-attach-lb-to-subnets
elb-cmd
elb-configure-healthcheck
elb-create-app-cookie-stickiness-policy
elb-create-lb
elb-create-lb-cookie-stickiness-policy
elb-create-lb-listeners
@rgould
rgould / gist:2572982
Created May 2, 2012 01:48
Making Rails consantize "API" properly
ActiveSupport::Inflector.inflections do |inflect|
acronym 'API'
acronym 'APIs'
end
@rgould
rgould / gist:2580751
Created May 2, 2012 21:44
Refactor the UsersController

Standing at the edge of the Cliffs of Refactoring, he surveyed the landscape. He saw the English settlers overwhelming the French colonists in the Valley of Config; He saw the magnificent View Mountains, though some of the peaks looked almost identical; He saw the neat little town of Model, nestled by the river Rails, with smoke drifting out of the chimneys. From his vantage point, he could see deep in the Chasm of Controllers, where his eyes saw a figure emerging from a dark cave. It was the UsersController! Once a renowned and beautiful entity, it now resembles a shambling, mutating monster. It came writhing out of the cave, dragging by a leash the AccountsController, savagely beating it with a wielded club. He averted his gaze, sunk his head into his hands, and said "The horror, the horror."

var CAS = require('cas')
, express = require('express');
var cas = new CAS({
base_url: 'https://test.littlevikinggames.com',
service: 'http://test.littlevikinggames.com:4000'
});
@rgould
rgould / gist:2997230
Created June 26, 2012 17:25
Print out sql queries when they happen.
ANSI = {}
ANSI[:RESET] = "\e[0m"
ANSI[:BOLD] = "\e[1m"
ANSI[:UNDERLINE] = "\e[4m"
ANSI[:LGRAY] = "\e[0;37m"
ANSI[:GRAY] = "\e[1;30m"
ANSI[:RED] = "\e[31m"
ANSI[:GREEN] = "\e[32m"
ANSI[:YELLOW] = "\e[33m"
ANSI[:BLUE] = "\e[34m"
@rgould
rgould / gist:3006199
Created June 27, 2012 19:22
oh crap format
# @current_region
def show
if @current_brand == Brand.gaggleup
@deals = Deal.select('distinct deals.*').active.approved.in_region_incl_parents(@current_region).started.order("starts_at desc").limit(15)
@header_title = t('_gup', :default => 'GaggleUp')
@deals = @deals.delete_if do |deal|
true unless check_for_exclusive_deal_access(deal, current_user)
end
def welcome
@show_splash = false
if @current_user
redirect_to home_path(@current_brand)
else
@ct_deal = nil
@biz_deal = nil
@kidz_deal = nil
Deal.live_by_brand("gaggleup", @current_region).each do |chkdeal|
if check_for_exclusive_deal_access(chkdeal, @current_user)