Skip to content

Instantly share code, notes, and snippets.

Avatar
🍣

Akshay Gupta kitallis

🍣
View GitHub Profile
View thinkdspindex.md
View git-bisect.txt
$ 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:
@kitallis
kitallis / raskell.rb
Created Aug 16, 2012 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
View raskell.rb
$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 +@
@kitallis
kitallis / srshti_vim.md
Created Apr 11, 2012 — forked from jasim/srshti_vim.md
Shortcuts for VimGet
View srshti_vim.md

#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 / rspec-syntax-cheat-sheet.rb
Created Feb 10, 2012 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
View rspec-syntax-cheat-sheet.rb
# 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")
View char2telephonic.rb
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
View Japanese style
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
View 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.