Skip to content

Instantly share code, notes, and snippets.

View minhajuddin's full-sized avatar
⌨️
Beep boop, beep boop

Khaja Minhajuddin minhajuddin

⌨️
Beep boop, beep boop
View GitHub Profile
@minhajuddin
minhajuddin / focus.start.bash
Created March 22, 2012 05:45
My xmonad config
#!/bin/bash
# load resources
xrdb -merge .Xresources
#xsetroot -solid '#222'&
# map caps lock as extra escape
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'&
# start clipboard manager
parcellite&
@minhajuddin
minhajuddin / sat.hs
Created February 12, 2012 17:08 — forked from gatlin/sat.hs
SAT Solver in Haskell
import Data.Maybe
import Control.Monad
type Literal = Integer
type Clause = [Literal]
type Formula = [Clause]
type Record = [Literal]
data SolverState = SolverState { formula :: Formula
, record :: Record
@minhajuddin
minhajuddin / gist:1523881
Created December 27, 2011 14:50 — forked from arnorhs/gist:1517095
gitopen - Open all files from a git diff or show command
#!/bin/bash
# This script will open all files from a git diff or a git show in vim.
# My bash skills are a bit primitive so this can probably be done more intelligently
# Usage:
# gitopen -- opens all added files that have changed since HEAD
# gitopen diff HEAD -- these are the default parameters
# gitopen diff master -- opens files that have changed from master
@minhajuddin
minhajuddin / rbenv-install-system-wide.sh
Created December 26, 2011 14:54
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@minhajuddin
minhajuddin / README.md
Created December 21, 2011 03:29
Script to retrieve content from google cache
@minhajuddin
minhajuddin / rt.rb
Created November 8, 2011 15:36
run tail on remote servers with ease
#!/usr/bin/env ruby
require 'rubygems'
require 'yaml'
require 'erb'
ConfigFilePath = File.expand_path("~/.remote-tail.yml")
SampleConfig=<<EOS
---
defaults: &defaults
HTTP/1.1 200 OK
Server: nginx/0.8.54
Content-Type: text/html
Status: 200 OK
X-Powered-By: cosmicpipes.com
Content-Length: 4259
Accept-Ranges: bytes
Date: Tue, 18 Oct 2011 15:10:11 GMT
X-Varnish: 825413136 825413126
Age: 70
@minhajuddin
minhajuddin / hash_extensions.rb
Created October 5, 2011 06:59
common ruby extensions
class Hash
#example:
# emp = {:name => "Khaja Minhajuddin", :dob => {:day => 26, :month => "January", :year => 1985}}
# puts emp.to_html_table
# => "<table><tr><td>name</td><td>Khaja Minhajuddin</td></tr><tr><td>dob</td><td><table><tr><td>day</td><td>26</td></tr><tr><td>month</td><td>January</td></tr><tr><td>year</td><td>1985</td></tr></table></td></tr></table>"
def to_html_table
output_html = "<table>"
self.each do |key, value|
value_html = value.is_a?(Hash) ? value.to_html_table : value
  1. have rails installed locally
  2. create a new rails app
  3. install git and run the following command from root dir git init && git add . && git commit -m 'init'
  4. signup for heroku with an email/pwd
  5. create an ssh key by running the command below: ssh-keygen
  6. run the command below from the root directory of the application heroku create -s cedar
  7. add a line gem 'pg' to your Gemfile
@minhajuddin
minhajuddin / s
Created September 19, 2011 12:07
mind-stack
#!/bin/bash
# ======================================================= #
# __ __ _ _ ____ _ _ #
# | \/ (_)_ __ __| | _ / ___|| |_ __ _ ___| | __ #
# | |\/| | | '_ \ / _` | (_) \___ \| __/ _` |/ __| |/ / #
# | | | | | | | | (_| | _ ___) | || (_| | (__| < #
# |_| |_|_|_| |_|\__,_| (_) |____/ \__\__,_|\___|_|\_\ #
# #
# ======================================================= #