What I do after I do a fresh install. Things are sorta grouped by type.
- Start downloading Xcode
- Disable auto-bright and turn brightness all the way up
- Turn up trackpad tracking
- Disable trackpad pinch open & close
| task :export do | |
| require 'sequel' | |
| require 'fastercsv' | |
| db = Sequel.connect(ENV['DATABASE_URL']) | |
| table_name = ENV['table'].to_sym | |
| table = db[table_name] | |
| fields = table.first.keys |
| module ActiveRecord | |
| module Searchable | |
| def self.included(base) | |
| base.extend(ClassMethods) | |
| end | |
| module ClassMethods | |
| def searchable_on(*args) | |
| args.flatten! | |
| @args = args.compact |
| { | |
| :a => 2, | |
| # NOTE for partials, you need to include the format | |
| # otherwise, it'll fail to find byows/_byow.erb even if byows/_byow.html.erb exists | |
| :b => render(:partial => 'example.html') | |
| }.to_json |
| #!/usr/bin/env ruby | |
| require 'yaml' | |
| if ARGV.size < 1 | |
| puts "Usage: github-test.rb my-project.gemspec" | |
| exit | |
| end | |
| require 'rubygems/specification' | |
| data = File.read(ARGV[0]) |
| user_controller.rb | |
| def show | |
| respond_to do |format| | |
| format.json { render :json => @user.to_json(:methods => [:avatar_url])} | |
| end | |
| end | |
| user.rb | |
| def avatar_url |
| POST /book/:id/notes | |
| note[content] | |
| selection[spine_item_play_order] | |
| selection[chunk_offset] | |
| selection[character_offset] | |
| selection[character_length] |
What I do after I do a fresh install. Things are sorta grouped by type.
| class Parent | |
| belongs_to :child, :autosave => true, :polymorphic => true | |
| end | |
| class SomethingController | |
| def create | |
| @parent = Parent.new(params[:parent]) | |
| @parent.child = child | |
| if @parent.save |
| #!/usr/bin/env ruby | |
| require "shellwords" | |
| def run_tags | |
| `ctags -R . 2>/dev/null` | |
| end | |
| def project_dir | |
| File.basename Dir.pwd |
The latest Xcode and Command Line Tools for Xcode changes the default compiler from gcc to the llvm compiler. Only ruby-1.9.3-p125+ is LLVM ready. So, you will have to install gcc-4.2 to compile older versions of Ruby. More detail here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers.
This worked for me. I hope it saves some people time:
brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/apple-gcc42.rb
CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7