Skip to content

Instantly share code, notes, and snippets.

View j1n6's full-sized avatar
🎯
Focusing

Jing Dong j1n6

🎯
Focusing
View GitHub Profile
/Library/Ruby/Gems/1.8/gems/rspec-1.1.9/lib/spec/runner/options.rb:229:in `files_to_load': File or directory not found: gems (RuntimeError)
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.9/lib/spec/runner/options.rb:221:in `each'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.9/lib/spec/runner/options.rb:221:in `files_to_load'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.9/lib/spec/runner/options.rb:98:in `run_examples'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.9/lib/spec.rb:21:in `run'
from /Library/Ruby/Gems/1.8/gems/rspec-1.1.9/lib/spec/runner.rb:191:in `register_at_exit_hook'
from /usr/bin/rake:19
config.gem 'rspec-rails', :lib => "spec/rails", :version => '1.1.11'
config.gem 'rspec', :lib => "spec", :version => '1.1.11
tell application "Things" to activate
tell application "Finder"
set visible of process "Things" to false
end tell
cd <project directory>
git remote add mergername <remote repository url>
git pull mergername <local branch name>
#!/bin/sh
#sudo gem install compass
# This will generate the following error:
# ERROR: While executing gem ... (Gem::RemoteSourceException)
# HTTP Response 302 fetching http://gems.rubyforge.org/yaml
sudo gem install rubygems-update --source http://production.s3.rubygems.org/
sudo gem update --system --source http://production.s3.rubygems.org/
# required libraries
sudo apt-get install g++ curl libssl-dev apache2-utils
# install git if needed
sudo apt-get install git-core
# checkout the latest node file
git clone http://github.com/ry/node.git
# configure the installation to ~/opt folder
@j1n6
j1n6 / gist:1105410
Created July 25, 2011 22:29
Export gcc
# Let the gem find the gcc complier
$ export CC=/usr/bin/gcc-4.2
# Run this command to install the gem mysql
$ env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config
# For Rails 3.0.x, we should use mysql2 version 0.2.x
# Run this command to install mysql2 with version 0.2.6
$ env ARCHFLAGS="-arch x86_64" gem install mysql2 --version=0.2.6 -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config
# Add the following line to your ~/.bash_profile
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
@j1n6
j1n6 / gist:1118784
Created August 1, 2011 19:06
Flag unsized images
img:not([width]):not([height]) {
border: 2px solid red !important;
}
@j1n6
j1n6 / gist:1124919
Created August 4, 2011 10:26
getClassByClass JavaScript
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {