Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
class Post | |
include Mongoid::Document | |
field :title, :type => String | |
has_many :comments do | |
def update(selector, value) | |
@target.each { |c| c.body = value if c.matches?(selector) } | |
end | |
end | |
end | |
# Rails developers have long had bad experiences with fixtures for | |
# several reasons, including misuse. | |
# | |
# Misuse of fixtures is characterized by having a huge number of them, | |
# requiring the developer to maintain a lot of data and creating dependencies | |
# between tests. In my experience working (and rescuing) many applications, 80% | |
# of fixtures are only used by 20% of tests. | |
# | |
# An example of such tests is one assuring that a given SQL query with | |
# GROUP BY and ORDER BY conditions returns the correct result set. As expected, |
// | |
// Backbone.Rails.js | |
// | |
// Makes Backbone.js play nicely with the default Rails setup, i.e., | |
// no need to set | |
// ActiveRecord::Base.include_root_in_json = false | |
// and build all of your models directly from `params` rather than | |
// `params[:model]`. | |
// | |
// Load this file after backbone.js and before your application JS. |
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences. | |
# Instructions: | |
# Go to TextMate > Preferences... | |
# Click Advanced | |
# Select Folder References | |
# Replace the following: | |
# File Pattern |
_.mixin({ | |
inGroupsOf: function(array, number, fillWith) { | |
fillWith = fillWith || null; | |
var index = -number, slices = []; | |
if (number < 1) return array; | |
while ((index += number) < array.length) { | |
var s = array.slice(index, index + number); | |
while(s.length < number) |
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
/** | |
* localStorage abstraction | |
* Get and Set JS Objects in localStorage | |
* | |
* This is meant for really simple localStorage needs, not to replace | |
* anything like Backbone.localStorage that's more robust. A good | |
* use-case is storing an array of IDs for models that are stored on | |
* the server. | |
* | |
* Usage: |
This font is manually patched with Fontforge. It includes the glyphs from DejaVu Sans Mono for Powerline.
I recommend DirectWrite-patched VIM builds. I'm using KaoriYa's build (http://www.kaoriya.net/software/vim/)
Add the following lines to your .vimrc/_vimrc: