Skip to content

Instantly share code, notes, and snippets.

View kitallis's full-sized avatar
🍣

Akshay Gupta kitallis

🍣
View GitHub Profile
@kitallis
kitallis / README
Created February 16, 2011 10:14 — forked from vangberg/README
# Deploying a Sinatra app to Heroku
## Database
The location of the database Heroku provides can be found in the environment
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example
on how to use this.
## Server
Heroku is serving your apps with thin, with means you have all your thin goodness available,
such as EventMachine.
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
File.open("words.txt") { |f|
f.each { |word|
word = word.to_s.chomp.downcase
p word
word.each_char { |l| # extracting letters
puts "\t Current letter: #{l}"
num = case l
when 'a'..'c' then 2
when 'd'..'f' then 3
when 'g'..'i' then 4
@kitallis
kitallis / rspec-syntax-cheat-sheet.rb
Created February 10, 2012 09:50 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@kitallis
kitallis / srshti_vim.md
Created April 11, 2012 12:24 — forked from jasim/srshti_vim.md
Shortcuts for VimGet

#Basic Stuff#

##Movements##

  • Goto next word w
  • Goto previous word b
  • Select inner word viw
  • Select the inner block - vi{
  • Go to closing or opening tag - %
@kitallis
kitallis / raskell.rb
Created August 16, 2012 14:32 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
$ git bisect start
$ git checkout recent_known_buggy_commit
$ git bisect bad
$ git checkout old_known_good_commit
$ git bisect good
# run tests, check things, etc.
$ git bisect good/bad
Repeat last two steps until git finds the first bad commit. Then: