Skip to content

Instantly share code, notes, and snippets.

View oafridi's full-sized avatar

Osman oafridi

  • San Francisco, California
View GitHub Profile
<!--Site Pixel HEAD Script For:golfchannel.com-->
<!--Krux Interchange - Krux Writes to Cookie UPDATED:2012-08-30 08:48:31-->
<script>
window.Krux || ((Krux = function () {
Krux.q.push(arguments);
}).q = []);
(function () {
function retrieve(n) {
var m, k = 'kx' + n;
if (window.localStorage) {
<%= debug(params) if Rails.env.development? %>
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
bundle update - update all gems
bundle update 'gemname' - update gem AND all dependencies
bundle update ––source gemname - update only gem
@oafridi
oafridi / multi_ssh
Created April 21, 2014 18:54
Multiple git ssh keys for two bitbucket accounts
workid and personalid:
1. Edit the ~/.ssh/config file
Add an alias for each identity combination for example:
Host workid
HostName bitbucket.org
IdentityFile ~/.ssh/workdid
Host personalid
HostName bitbucket.org
@oafridi
oafridi / database.yml
Last active August 29, 2015 14:00
example database.yml for postgres
development:
adapter: postgresql
encoding: unicode
host: localhost
database: proj_development
username: postgres
password:
test:
adapter: postgresql
@oafridi
oafridi / gist:4639e31775c599ed1978
Last active August 29, 2015 14:01
missing dependencies for gems in linux
# All installs
sudo apt-get install build-essential
sudo apt-get install libssl-dev
#therubyracer
gem uninstall libv8
$ gem install therubyracer
# nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
@oafridi
oafridi / ssh
Created July 1, 2014 16:52
SSH using a ruby script
#!/usr/bin/env ruby
require 'rubygems'
require 'net/ssh'
Net::SSH.start('host', 'user' ) do|ssh|
result = ssh.exec!('')
puts result
end
plugins=(bundler common-aliases git postgres rails vagrant zsh_reload)
export PATH=~/.rbenv/shims
export PATH='$HOME/.rbenv/bin:$PATH'
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home
# JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export JAVA_HOME
# export EDITOR='subl'
export PATH=/Users/oafridi/.cabal/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/local/sbin:$PATH
export PATH=$PATH:/Users/oafridi/dev/play-2.2.0
@oafridi
oafridi / gist:9f913078863ede13b34f
Last active August 29, 2015 14:07
Queue implementation in Ruby
class Queue
def initialize
@store = []
@max_size = 5
end
def enqueue(x)
raise "Stack is full!" if full?
@store.push x
end