This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mouse_draw = (e) -> | |
position = find_position(@) | |
e._x = e.clientX - position.x | |
e._y = e.clientY - position.y | |
$('#x').text(e._x) | |
$('#y').text(e._y) | |
if currentTool() == 'eraser' | |
$('#drawing').hide() | |
func = Narwhal.tools[currentTool()][e.type] | |
if func? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Asking for advice | |
Given I ask for advice | |
When people try to help | |
Then I rage about what they say | |
And I rage about everything else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! <SID>StripTrailingWhitespaces() | |
" Preparation: save last search, and cursor position. | |
let _s=@/ | |
let l = line(".") | |
let c = col(".") | |
" Do the business: | |
%s/\s\+$//e | |
" Clean up: restore previous search history, and cursor position | |
let @/=_s | |
call cursor(l, c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
# all your comment stuff can go here | |
%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = { 0 => "green", 1 => "yellow", 2 => "red" } | |
puts x[key[value]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:conditions => ['(`x`.y < ? | |
AND `x`.z > ?) | |
OR (`x`.a < ? | |
AND `x`.a > ?) | |
OR (`x`.b > ?)', | |
Date.today, Date.today, Date.today, Date.today, Date.today ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[~]$ sudo iptables -nvL | |
Chain INPUT (policy ACCEPT 125K packets, 118M bytes) | |
pkts bytes target prot opt in out source destination | |
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) | |
pkts bytes target prot opt in out source destination | |
Chain OUTPUT (policy ACCEPT 70113 packets, 10M bytes) | |
pkts bytes target prot opt in out source destination |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Integer | |
def place | |
case self % 10 | |
when 1 | |
"#{self}st" | |
when 2 | |
"#{self}nd" | |
when 3 | |
"#{self}rd" | |
when 4..9, 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Integer | |
def rank | |
case self % 10 | |
when 1 | |
"#{self}st" | |
when 2 | |
"#{self}nd" | |
when 3 | |
"#{self}rd" | |
when 4..9, 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project/ | |
spec/ | |
spec_helper.rb | |
first_spec.rb | |
first.rb |