Skip to content

Instantly share code, notes, and snippets.

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

@gmarik
gmarik / game_of_life.rb
Created May 14, 2011 21:31
coderetreat wpg
class Cell
end
class World
def initialize
@x = 50
@y = 50
end
" Modularized configuration for vim
" Randy Morris <[email protected]>
" Plugins
if v:version < 700
finish
endif
" {{{ Vundle setup
@gmarik
gmarik / output
Created June 8, 2011 05:05
results
whose-bug$ bundle exec ruby test.rb
{
}
@gmarik
gmarik / route length chart
Created August 10, 2011 21:24
rails routes length chart
$ rake routes|ruby -ne '$_ =~ /^\s+([a-z_]+)/; puts "%-2s %s" % [$1.to_s.size, $1.to_s.gsub(/./,"*")]'|grep -v '^0'|sort -unr
92 ********************************************************************************************
91 *******************************************************************************************
90 ******************************************************************************************
89 *****************************************************************************************
88 ****************************************************************************************
87 ***************************************************************************************
85 *************************************************************************************
82 **********************************************************************************
@gmarik
gmarik / test.vim
Created September 20, 2011 19:14
Unite fuzzy search
:Unite file
1) Expecting to fuzzy match config/database.yml (as Command-T does)
Sources: file
> dbyml
- [new file]dbyml
Sources: file
@gmarik
gmarik / README.md
Created October 21, 2011 21:44
phantomjs qunit.js example

About

minimal example of using [phantomjs] with [qunit]

$ phantomjs run-qunit.js file://`pwd`/test.html
'waitFor()' finished in 200ms.
Tests completed in 21 milliseconds.
5 tests of 5 passed, 0 failed.

Installation

@gmarik
gmarik / !README.md
Created November 21, 2011 15:36
Disable Gem deprecation spam

How to disable Gem deprecation warnings

Just copy content to corresponding files

#include and #extend have same effect on instances as inheritance

Let's say we have this

module A; end
module B; end
class C; end
class D < C; end

Then we modify instance