Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
# encoding: UTF-8 | |
Capistrano::Configuration.instance(:must_exist).load do | |
namespace :rails do | |
desc "Open the rails console on one of the remote servers" | |
task :console, :roles => :app do | |
hostname = find_servers_for_task(current_task).first | |
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'" | |
end | |
end |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# Title: Fancyimage tag for Jekyll | |
# Authors: Devin Weaver (photos_tag.rb), Brian M. Clapper (img_popup.rb), Patrick Paul (this gist) | |
# Description: Takes full size image, automagically creates thumbnail at specified size, +fancybox | |
# | |
# Adapted from: | |
# http://tritarget.org/blog/2012/05/07/integrating-photos-into-octopress-using-fancybox-and-plugin/ | |
# (photos_tag.rb) https://gist.github.com/2631877 | |
# (img_popup.rb) https://github.com/bmc/octopress-plugins/ | |
# | |
# Syntax {% photo filename [tumbnail] [title] %} |
Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
import os | |
import numpy | |
from pandas import DataFrame | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.naive_bayes import MultinomialNB | |
from sklearn.pipeline import Pipeline | |
from sklearn.cross_validation import KFold | |
from sklearn.metrics import confusion_matrix, f1_score | |
NEWLINE = '\n' |
This is a small collection of scripts showing how to use require.js. It's only one of several ways of setting up a require.js project, but it's enough to get started.
At its core, require.js is about three things:
The following files show how these are achieved.
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
These notes come straight from Jennifer's presentation; slides at https://docs.google.com/file/d/0B2HGtAJEbG8PdzVPdHcwekI2V2M/edit