Skip to content

Instantly share code, notes, and snippets.

View miwillhite's full-sized avatar

Matthew Willhite miwillhite

View GitHub Profile
@miwillhite
miwillhite / gitlog
Created May 14, 2011 22:13
Git log
~/apps/portfolio[master]: git log
commit 4747ec0ceea13b1ce6a5030a3a2a9fd9580fd412
Author: Matt Willhite <matthew.willhite@gmail.com>
Date: Sat May 14 15:10:39 2011 -0700
Removed favicon
commit 97bff59db19b0c32c4690acced83be92659bb49b
Author: Matt Willhite <matthew.willhite@gmail.com>
@miwillhite
miwillhite / rails.sh
Created June 12, 2011 03:32
Rails command prompt cheat sheet
# A little about the syntax for common commands
#
# When you call something like `ruby`, `git` or `rvm` in the command line
# you are really just executed a small program (or command). The first thing
# you type is the name of the command, for example "git". Everything following
# that are arguments for the command, separated by a space.
#
# Each command takes arguments differently, so you have to view the documentation
# to figure it out. You can view documentation on the commands by typing `man [command-name]`
# That fires a program called "man" with an argument of the command you want to learn about
require File.join(File.dirname(__FILE__), 'config', 'environment.rb')
# disable :run
run Helios
# gem install crack
%w[crack open-uri].each{ |dep| require dep }; Crack::XML.parse(open("http://news.ycombinator.com/rss").read)['rss']['channel']['item'].each{ |i| puts("== #{ i['title'] } ==", "#{ i['link'] }\n\n") }
Rook.Models.Person = Backbone.Model.extend({
paramRoot: 'person'
});
Rook.Models.People = Backbone.Collection.extend({
model: Rook.Models.Person,
@miwillhite
miwillhite / gist:2307640
Created April 5, 2012 02:54
Mind yo commas!
// This snippet constructs an array of objects...via some server-side templating thing
// Now can you tell me what's wrong with this code?
//
// ...
//
<script language="javascript">
var nouns = [
@miwillhite
miwillhite / gist:2322312
Created April 6, 2012 19:34
Resizing elements with Google Closure
// Lessons in Google Closure's Resizing
//
// Resizing to 100% isn't fair
//
// Our example:
new goog.fx.dom.Resize(this.toolbar, ['100%', size.height], ...);
// Google Closure's function definition
goog.fx.Resize.prototype.updateStyle = function() {
if has("autocmd")
" Enable filetype detection
filetype plugin indent on
" Restore cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
endif
requirejs.config({
paths: {
'jquery' : 'http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min',
'underscore' : 'http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min'
},
shim: {
underscore: { exports: '_' }
}
});
@miwillhite
miwillhite / Gemfile.lock
Created November 19, 2012 23:30
Gemfile.lock
PATH
remote: .
specs:
simple-ruby (1.3.15)
activemodel
multi_json (~> 1.3.4)
typhoeus (= 0.3.3)
uuid
yajl-ruby