Skip to content

Instantly share code, notes, and snippets.

@ericallam
ericallam / gist:3828454
Created October 3, 2012 17:26
AutomationExample Output
$ ./run_automation.sh
Make sure you are using Xcode 4.3.3
Build settings from command line:
CONFIGURATION_BUILD_DIR = /tmp/AutomationExample
SDKROOT = iphonesimulator6.0
=== BUILD NATIVE TARGET AutomationExample OF PROJECT AutomationExample WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
ProcessInfoPlistFile /tmp/AutomationExample/AutomationExample.app/Info.plist AutomationExample/AutomationExample-Info.plist
@ericallam
ericallam / slicehost.sh
Created June 22, 2012 20:47
Provisioning a slicehost for RoR
# Provisioning a slicehost for RoR
apt-get update
apt-get upgrade -y
# install dependencies
/usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion libcurl4-openssl-dev
# install rvm
sudo curl -L https://get.rvm.io | bash -s stable --ruby
@ericallam
ericallam / speaker.md
Created June 10, 2012 22:04 — forked from matiaskorhonen/speaker.md
Frozen Rails Talk Proposal Template (http://2012.frozenrails.eu/)
@ericallam
ericallam / gist:2855197
Created June 1, 2012 21:20
All ActiveSupport::Notifications that Rails instruments
receive.action_mailer
deliver.action_mailer
write_fragment.action_controller
read_fragment.action_controller
exist_fragment?.action_controller
expire_fragment.action_controller
write_page.action_controller
expire_page.action_controller
start_processing.action_controller
process_action.action_controller
@ericallam
ericallam / application.css
Created May 1, 2012 18:32
Rails generated manifest files
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
@ericallam
ericallam / commits.txt
Created April 2, 2012 21:34
A sample of commits from the lolcode.codeschool.com project
commit 79d8497573031a08cffa5bf7d844586aa86d9483
Author: Eric Allam
Date: Sat Mar 31 12:43:45 2012 -0400
FIXIN YR SPECS
commit 88e9343e1e06956473462a4a83fed7e8e3c845b4
Author: Nick Walsh
Date: Fri Mar 30 12:07:23 2012 -0400
@ericallam
ericallam / phantom-demo.coffee
Created March 8, 2012 19:47
phantomjs security exception when using evaluate without first using open
page = new WebPage()
page.viewportSize = { width: 800, height: 800 }
page.content = "<html><head><title></title></head><body><div></div></body></html>"
page.onConsoleMessage = (msg) ->
console.log msg
page.evaluate ->
console.log window.location.protocol # about:
@ericallam
ericallam / model_defaults.js
Created March 2, 2012 16:26
backbone model defaults with a function
var Appointment = Backbone.Model.extend({
defaults: function(){
date: new Date()
}
});
var app1 = new Appointment();
var app2 = new Appointment();
app1.get('date') !== app2.get('date')
@ericallam
ericallam / app.js
Created February 8, 2012 18:44
debouncing save
var TodoItem = Backbone.Model.extend({
initialize: function(){
this.save = _.debounce(this.save, 500);
},
toggleStatus: function(){
if(this.get('status') == 'incomplete'){
this.set({'status': 'complete'});
}else{
this.set({'status': 'incomplete'});
@ericallam
ericallam / todo.js
Created February 8, 2012 14:16
How do you handle a collection's remove event in a collection view?
var TodoItem = Backbone.Model.extend({});
var TodoView = Backbone.View.extend({
template: _.template('<h3><%= description %></h3>'),
initialize: function(){
this.model.bind('change', this.render, this);
this.model.on('destroy', this.remove, this);
},