Skip to content

Instantly share code, notes, and snippets.

View nathany's full-sized avatar
🙃

Nathan Youngman nathany

🙃
View GitHub Profile
@nathany
nathany / show SQL in irb console
Created March 11, 2010 17:31
Rails SQL logging from console
ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT)
@remy
remy / gist:330318
Created March 12, 2010 13:59
autofocus and placeholder support
/**
* Add this script to the end of your document that use <input autofocus type="text" />
* or <input type="text" placeholder="username" /> and it'll plug support for browser
* without these attributes
* Minified version at the bottom
*/
(function () {
function each(list, fn) {
var l = list.length;
require 'minitest/unit'
require 'minitest/spec'
require 'rubygems'
require 'ansi'
class MiniTest::Unit
include ANSI::Code
PADDING_SIZE = 4
@qrush
qrush / gist:532115
Created August 17, 2010 21:23
new resolver api
require 'open-uri'
require 'pp'
pp Marshal.load(open("http://localhost:3000/api/v1/dependencies?gems=rails,rack,clearance,fog,paperclip"))
# Allow RSpec assertions over the elements of a collection. For example:
#
# collection.should all_be > 0
#
# will specify that each element of the collection should be greater
# than zero. Each element of the collection that fails the test will
# be reported in the error message.
#
# Examples:
# [1,1,1].should all_be eq(1)
director routing_mesh round-robin {
{
.backend = {
.host = "...some ip...";
.port = "...some port...";
.first_byte_timeout = 90s;
.between_bytes_timeout = 90s;
}
# ...more backends...
}
@jeremi
jeremi / fabfile.py
Created November 4, 2010 21:00
A fabfile to manage git+appengine deployement
from __future__ import with_statement
import functools
import os
import sys
from fabric.api import *
from fabric.colors import green, red, green
import datetime
import re
@jesseproudman
jesseproudman / Auto Scale API Mashup.rb
Created March 16, 2011 18:51
Logic for simple Auto Scale setup
require 'rubygems'; require 'active_resource'; require 'new_relic_api'
servers = File.open("server_count.txt", "r").first.to_i
instances_per_server = 6
cpu_burn_for_system = 1000.0 * 0.20
NewRelicApi.api_key = "<Your API Key>"
account = NewRelicApi::Account.find(:first);
application = account.applications[3];
@Gregg
Gregg / gist:968534
Created May 12, 2011 13:54
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@mythz
mythz / cash-register-spec.coffee
Created May 21, 2011 02:20
Peepcode cash resgister example of using Jasmine with CoffeeScript
describe "Dish", ->
describe "constructor", ->
beforeEach ->
@dish = new Dish 'Sirloin Steak $18.99 mains'
it "extracts title", ->
(expect @dish.title).toEqual('Sirloin Steak')