Skip to content

Instantly share code, notes, and snippets.

View whistler's full-sized avatar

Ibrahim Muhammad whistler

View GitHub Profile
@whistler
whistler / star.css
Created February 13, 2012 18:56
CSS Stars
Taken from: http://www.joseairosa.com/2009/07/24/easy-css-star-rating-layout/
Images: http://www.joseairosa.com/wp-content/uploads/2009/07/stars.png
http://www.joseairosa.com/wp-content/uploads/2009/07/stars_full.png
.classification {
position: relative;
width: 91px;
height: 17px;
}
.classification .cover {
@whistler
whistler / file_read_line_by_line.rb
Created February 28, 2012 22:46
Read file line by line in ruby
IO.foreach("filename.ext") { |line| p line}
@whistler
whistler / scrollToDiv.js
Created April 12, 2012 17:56
Scroll div into view
document.getElementById('youridhere').scrollIntoView();
@whistler
whistler / rubyplusplus 12-17-2011
Created May 1, 2012 14:51
Set up Ubuntu for Rails and Github
############ For Vitual Machines #######
sudo locale-gen en_CA.UTF-8
sudo apt-get install ruby git build-essential
############ Run Updates ############
sudo apt-get update
sudo apt-get -y upgrade
############ Reboot ############
@whistler
whistler / run_tests.sh
Created June 6, 2012 13:47
Pull Rails application and test repeatedly
#!/bin/bash
while [ true ]; do
git pull origin master
bundle install
rake db:migrate
rake rake:test:prepare
rake spec
done
@whistler
whistler / no_timestamps_in_json.rb
Created June 11, 2012 15:10
Dont send timestamps of Rails records to browser
class ActiveRecord::Base
def as_json(options={})
super(:except => [:created_at, :updated_at])
end
end
@whistler
whistler / jenkins_rails_ubuntu.sh
Created July 26, 2012 02:33
Set up Jenkins and Rails on Ubuntu server
sudo aptitude install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev
sudo apt-get install libxslt-dev libxml2-dev
sudo apt-get install libmysqlclient-dev ruby-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libreadline-dev
### Install Java ###
sudo apt-get install openjdk-6-jre-headless
@whistler
whistler / no_overflow.css
Created August 17, 2012 20:09
Make sure child div stays inside parent div
.parent
{
position: relative;
}
@whistler
whistler / unicode.rb
Created September 17, 2012 01:22
Unicode is Ruby file
# encoding: UTF-8
# Add the about comment in the ruby file
@whistler
whistler / gist:4699578
Created February 2, 2013 22:39
Install Rails on Mac
# Pre-requisite: X-Code Command Line Tools: http://connect.apple.com
# install homebrew
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# git
brew install git
#rbenv