Skip to content

Instantly share code, notes, and snippets.

@daffydowden
daffydowden / rvm readline error
Created September 14, 2010 20:41
My frustration from trying to install ree, readline, rubycocoa and passenger pref pane
rvm package install readline
Fetching readline-5.2.tar.gz to /Users/Richard/.rvm/archives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1989k 100 1989k 0 0 218k 0 0:00:09 0:00:09 --:--:-- 288k
Extracting readline-5.2.tar.gz to /Users/Richard/.rvm/src
Configuring readline in /Users/Richard/.rvm/src/readline-5.2.
Compiling readline in /Users/Richard/.rvm/src/readline-5.2.
Installing readline to /Users/Richard/.rvm/usr
$ pwd
/Users/Richard/src/RubyCocoa-1.0.1/RubyCocoa-1.0.0
$ ruby install.rb config --build-universal=yes
install.rb: entering config phase...
create ext/rubycocoa/extconf.rb
create framework/GeneratedConfig.xcconfig
create framework/src/objc/Version.h
create tests/Makefile
---> framework
create /Users/Richard/src/RubyCocoa-1.0.1/RubyCocoa-1.0.0/framework/src/objc/osx_ruby.h ...
@daffydowden
daffydowden / Setup for new Mac
Created September 15, 2010 14:21
Installation for Ruby,RVM,REE,RubyCocoa,Passenger, MySql
Borrows heavily from: http://eddorre.com/posts/using-ruby-enterprise-edition-and-passenger-on-os-x-with-rvm
Install Xcode
Update Xcode if necessary
Install oh-my-zsh
https://github.com/robbyrussell/oh-my-zsh#readme
Install homebrew: http://mxcl.github.com/homebrew/
@daffydowden
daffydowden / JQuery - dynamic select for drop downs
Created September 30, 2010 09:10
selecting an option from a dropdown with jQuery
//on drop down selection, select the element in the hidden input
$('.qa-filter-select ul a').live('click', function(){
$('#category option[value=selected]').val('')
$('.qa-filter-select option').eq($(this).index('.qa-filter-select ul a')).val('selected','selected');
$('.qa-filter-select .selected').html($(this).html());
});
@daffydowden
daffydowden / Raid Panic
Created October 22, 2010 18:27
Now panic... and freak out!
Interval Since Last Panic Report: 106383 sec
Panics Since Last Report: 1
Fri Oct 22 19:23:38 2010
panic(cpu 0 caller 0x1338745): "AppleRAIDCard controller panic"@/SourceCache/AppleHWRaidDriver/AppleHWRaidDriver-118/Driver/Driver/AppleRAIDCard.cp:991
Backtrace (CPU 0), Frame : Return Address (4 potential args on stack)
0x871dbe68 : 0x21b455 (0x5cf328 0x871dbe9c 0x2238b1 0x0)
0x871dbeb8 : 0x1338745 (0x1342b04 0x22c 0x7648602c 0x0)
0x871dbf08 : 0x54884d (0xb4a4000 0xb434700 0x1 0x29d54e)
0x871dbf58 : 0x54787e (0xb434700 0xb4cbb9c 0xb3f6bc0 0xb3f6b98)
@daffydowden
daffydowden / Gemfile
Created August 15, 2011 19:10
Error I'm getting using spree with Rails 3.1
source 'http://rubygems.org'
# Bundle edge Rails instead:
gem 'rails', '3.1.0.rc5', :git => "git://github.com/rails/rails", :branch => "3-1-stable"
gem 'mysql2'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'devise'
gem 'spree'
@daffydowden
daffydowden / Closure
Created September 15, 2011 18:59
JS Masterclass - exercise 2
(function(scope){
// Code
var index;
function log(){
console.log(index);
}
function iterate(){
log();
➜ UCA git:(master) ✗ rake db:schema:load --trace
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Mysql2::Error: Table 'uca_development.contributortypes' doesn't exist: SHOW FIELDS FROM `contributortypes`
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `query'
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `block in execute'
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
@daffydowden
daffydowden / spree_setup.rb
Created November 16, 2011 20:33
Spree setup config. Place this within config/initializers
# Spree setup instructions
# Setup the default preferences
if Preference.table_exists?
# Site defaults
Spree::Config.set(:site_name => 'Classy Site Name')
Spree::Config.set(:default_seo_title => 'Marketing Stuff')
Spree::Config.set(:default_meta_description => 'Longer Marketing Stuff')
Spree::Config.set(:default_meta_keywords => 'Marketing, Stuff')
@daffydowden
daffydowden / .rvmrc
Created January 2, 2012 12:10
.rvmrc file creation
rvm use [version]@[directory] --create --rvmrc
# From: http://onelinetidbits.posterous.com/rvm-automagically-create-rvmrc