Skip to content

Instantly share code, notes, and snippets.

View sent-hil's full-sized avatar

Senthil Arivudainambi sent-hil

View GitHub Profile
@sent-hil
sent-hil / gist:3423695
Created August 22, 2012 08:09
River (getriver.com): Gemfile and Bundler best practices.

This is my current Gemfile for River.

source 'http://rubygems.org'

gem 'god' # monitoring of Goliath & Sinatra apps

group :default do
  gem 'yajl-ruby', :require => 'yajl' # fast JSON dumping/parsing
end
@sent-hil
sent-hil / gist:3550075
Created August 31, 2012 08:03
Create Phonegap 2.0 app from commandline
# ios
cd /Users/sent-hil/Documents/play/phonegap/sdks/lib/ios
./bin/create ../../../ios com.{name} {name}
cd ../../../ios
# android (doesn't work, use http://docs.phonegap.com/en/2.0.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android instead)
cd /Users/sent-hil/Documents/play/phonegap/sdks/lib/android
./bin/create ../../../ios com.{name} {name}
@sent-hil
sent-hil / gist:3735640
Created September 17, 2012 05:00
Plan for HackerSchool Fall 2012
GOAL: Become a much, much better programmer:
Get better at Ruby and OOP in general,
Open black boxes and see what goes on underneath.
TIME: Oct 22 - Dec 20.
IDEAS (all open sourced):
* Learn how interpreters work.
Status: Finished Scheme interpreter in Ruby. Rewrite in Go?
@sent-hil
sent-hil / gist:3752697
Created September 19, 2012 22:16
Companies I want to work for:

WARNING: this is a draft and the list is by no means complete.

Methodology:

  1. Meaningful product:
  2. Do I use it?
  3. Does it solve a real and interesting problem?
  4. Is it important to the well being of others?
  5. Are they small?
  6. Tech stack - Preferably Rails + MongoDb with a hint of Javascript/Coffeescript. As long as it's not Java.
  7. Company culture
@sent-hil
sent-hil / gist:3775255
Created September 24, 2012 10:02
Pick me up
"If we did the things we are capable of doing, we would literally astound ourselves." Edison
"When the student is ready, the teacher appears." Buddhist proverb
"Too busy to care."
Berklee College of Music keynote by Sivers: https://sivers.org/berklee6
The Mystery Box by JJ Abrams: http://www.ted.com/talks/j_j_abrams_mystery_box.html
@sent-hil
sent-hil / gist:3821532
Created October 2, 2012 17:42
HS: +1 Node noodles
@sent-hil
sent-hil / gist:3828580
Created October 3, 2012 17:51
HS: +2 Node Spagetti

Setup cron on mac

$ crontab -e

stop vim from saving tmp files temporarily for crontab :set backupskip=/tmp/*,/private/tmp/*

0 22 * * * bash -c 'source /Users/sent-hil/.rvm/scripts/rvm && /usr/bin/env ruby /Users/sent-hil/Documents/play/single/twitter_status.rb'
@sent-hil
sent-hil / gist:3834447
Created October 4, 2012 15:34
HS: +3 Monad and Gonads

Monads

Monads are a way to chain functions together. Maybe monad (from Haskell) is used to chain functions together when the functions might fail. It assumes:

  1. If I have Nothing, stop computing.
  2. If I have Something, pass it to next function.
  3. That function may return Something or Nothing. Go back to Step 1.
x ||= y # x = y unless x
@sent-hil
sent-hil / gist:4034166
Created November 7, 2012 20:23
HS - Nov 7
--------------------------
Interfaces vs. Duck typing
Duck typing isn't really about checking whether the things you need are there and then using them.
Duck typing is about just using what you need.
Interfaces are named collections of method signatures.
https://gobyexample.com/interfaces
--------------------------
@sent-hil
sent-hil / gist:4142823
Created November 25, 2012 08:22
Ruby job questions
http://blog.firsthand.ca/2010/08/questions-asked-in-ruby-on-rails-job.html
Q. What is polymorphism?
* Allows values of different data types to be handled using an uniform interface.
* 3 types:
* Overloading: Methods of same name exists in different class.
Ex: + method operates differently for integers and floats.
* Parametric: Methods of same name, but accept diff. parameters.
* Inclusion: The ability to redefine methods in inherited classes.