Skip to content

Instantly share code, notes, and snippets.

View j1n6's full-sized avatar
🎯
Focusing

Jing Dong j1n6

🎯
Focusing
View GitHub Profile
console.log("from gist");
@j1n6
j1n6 / gemrc
Created December 3, 2011 14:30
Not install rdoc by default for all gems
---
:sources:
- http://gems.rubyforge.org
- http://gems.github.com
gem: --no-ri --no-rdoc
@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++) {
@j1n6
j1n6 / gist:1118784
Created August 1, 2011 19:06
Flag unsized images
img:not([width]):not([height]) {
border: 2px solid red !important;
}
# Add the following line to your ~/.bash_profile
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
@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
# 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
#!/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/
cd <project directory>
git remote add mergername <remote repository url>
git pull mergername <local branch name>
tell application "Things" to activate
tell application "Finder"
set visible of process "Things" to false
end tell