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 / data.txt
Created June 18, 2013 09:31
Compute the total, percentage, and rank for the students in data.txt. The maximum total is 600. Create an output file using the input file below, the output file should have Total Marks, Percentage and Rank as additional columns.
Name, Hindi, Telugu, English, Maths, Science, Social
Willy Langosh I,83,51,32,85,98,67
Jovan Lebsack,39,45,90,98,86,83
Brian Ritchie Sr.,90,65,56,83,90,34
Alayna Wunsch,44,69,80,38,65,65
Kayli Harber,94,47,65,85,43,86
Yasmeen Welch,75,89,39,34,70,79
Mrs. Sophie Willms,56,96,45,63,63,36
Felipe Dickens,69,56,55,43,59,73
Ron Langosh,48,88,62,63,86,81
source "/usr/local/rvm/scripts/rvm"
RAILS_ENV=production
PATH=$PATH:/usr/local/rvm/bin # Add RVM to PATH for scripting
class PdfMerger
def merge(pdf_paths, destination)
first_pdf_path = pdf_paths.delete_at(0)
Prawn::Document.generate(destination, :template => first_pdf_path) do |pdf|
pdf_paths.each do |pdf_path|
pdf.go_to_page(pdf.page_count)
@minhajuddin
minhajuddin / make-vim.bash
Created February 5, 2013 08:43
Make vim and gvim on ubuntu
cd ~
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--enable-perlinterp \
--enable-gui=gnome2 --enable-cscope --prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim73
sudo make install
@minhajuddin
minhajuddin / mongoid.rb
Created December 5, 2012 19:34 — forked from durran/mongoid.rb
Custom database persistence.
module CustomDatabase
extend ActiveSupport::Concern
included do
store_in database: custom_database
end
module ClassMethods
def custom_database
@minhajuddin
minhajuddin / the-case-for-go.txt
Created November 10, 2012 18:09
The case for Go #golang
Go at Heroku
http://blog.golang.org/2011/04/go-at-heroku.html
Why you PHP guys should learn Golang
http://www.mikespook.com/2012/08/why-you-php-guys-should-learn-golang/
Go at CloudFlare
http://blog.cloudflare.com/go-at-cloudflare
Go at Moovweb
@minhajuddin
minhajuddin / gist:4012827
Created November 4, 2012 18:12 — forked from davatron5000/gist:2254924
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@minhajuddin
minhajuddin / Gemfile
Created September 13, 2012 21:10
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@minhajuddin
minhajuddin / deploy.rake
Created August 23, 2012 05:59 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
<a href='javascript:(%28function%28%29%7Bwindow.baseUrl%3D%27https%3A//www.readability.com%27%3Bwindow.readabilityToken%3D%27%27%3Bvar%20s%3Ddocument.createElement%28%27script%27%29%3Bs.setAttribute%28%27type%27%2C%27text/javascript%27%29%3Bs.setAttribute%28%27charset%27%2C%27UTF-8%27%29%3Bs.setAttribute%28%27src%27%2CbaseUrl%2B%27/bookmarklet/read.js%27%29%3Bdocument.documentElement.appendChild%28s%29%3B%7D%29%28%29)'>Read Now</a>