Skip to content

Instantly share code, notes, and snippets.

View balinterdi's full-sized avatar

Balint Erdi balinterdi

View GitHub Profile
@balinterdi
balinterdi / gist:1151623
Created August 17, 2011 14:29
.vimrc.local
let mapleader=","
"RVM
set statusline+=%{exists('g:loaded_rvm')?rvm#statusline():''}
set statusline+=%r "read only flag
set statusline+=%m "modified flag
set statusline+=%t "filename
set statusline+=%= "left/right separator
@balinterdi
balinterdi / quine.rb
Created August 18, 2011 21:29
A program that prints itself (AKA quine)
CODE = [112,117,116,115,32,34,67,79,68,69,32,61,32,35,123,67,79,68,69,46,105,110,115,112,101,99,27,99,116,125,34, 10,67,79,68,69,46,101,97,99,104,32,123,124,99,124,32,112,114,105,110,116,32,99,46,99,104,114,32,125,10]
puts "CODE = #{CODE.inspect}"
CODE.each { |c| print c.chr }
wrong = ->
countdown = 10
h = setInterval ->
countdown--
, 100
do (->) until countdown is 0
clearInterval h
console.log 'Surprise!'
right = ->
@balinterdi
balinterdi / countdown.coffee
Created October 18, 2011 23:02
Event loop (broken)
countdown = 10
h = setInterval ->
countdown--
, 100
do (->) until countdown is 0
clearInterval h
console.log 'Surprise!'
@balinterdi
balinterdi / countdown.coffee
Created October 18, 2011 23:03
Event loop
countdown = 10
h = setInterval ->
countdown--
if countdown is 0
console.log 'Surprise'
clearInterval h
, 100
# Rock, paper and scissors with Node
net = require 'net'
hands = ['rock', 'paper', 'scissors']
win_rules = [
['rock', 'scissors'], ['scissors', 'paper'], ['paper', 'rock']
]
human_wins = 0
module Enumerable
def find_value(&block)
found = nil
self.each do |e|
found = block.call(e)
return found if found
end
found
end
end
require 'forwardable'
class X
def foo
puts "foo!"
end
alias_method :bar, :foo
end
class Y < X
diff --git a/src/MacVim/mvim b/src/MacVim/mvim
index 653cf78..5e6b0d7 100755
--- a/src/MacVim/mvim
+++ b/src/MacVim/mvim
@@ -13,6 +13,11 @@
# or by un-commenting and editing the following line:
# VIM_APP_DIR=/Applications
+tabs=true
+if [ "$1" = "-f" ]; then
render partial: 'avatar', locals: { mood: 'depressed' } # works fine
render 'avatar', locals: { mood: 'depressed' } # undefined local variable or method 'mood' (in the partial)