This file contains 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
def something? | |
true | |
end | |
def something_else? | |
false | |
end | |
x = 0 |
This file contains 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
a = 0101 = 5 | |
b = 0011 = 3 | |
a | b means: | |
0101 | |
| 0011 | |
====== |
This file contains 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
####### | |
# Bad # | |
####### | |
class Dog | |
end | |
class Cat | |
end |
This file contains 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 Parent | |
def dope_method(arg1 = nil, arg2 = nil) | |
puts "Called Parent#dope_method(#{arg1.inspect}, #{arg2.inspect})" | |
end | |
end | |
class Child < Parent | |
def dope_method(arg1, arg2) | |
puts "Called Child#dope_method(#{arg1.inspect}, #{arg2.inspect})" |
This file contains 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
// Random | |
var numberToAdd = Math.floor(Math.random() * 50); | |
var array = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]; | |
if (array.indexOf(numberToAdd) >= 0) { | |
console.log(numberToAdd + " is already in the array, ignoring..."); | |
} else { | |
console.log(numberToAdd + " isn't in the array, adding...") | |
array.push(numberToAdd); |
This file contains 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
nakajima = dat("nakajima") | |
jake_teams = dat("jakeboxer").teams | |
orgs = nakajima.organizations.where(:id => jake_teams.map(&:organization_id)) | |
teams = [] | |
orgs.each do |org| | |
teams += org.visible_teams_for(nakajima).where(:id => jake_teams.map(&:id)) | |
end |
This file contains 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
$ -> | |
sidebar = document.querySelector('.js-org-migration-settings-sidebar') | |
if sidebar? | |
sidebarRect = sidebar.getBoundingClientRect() | |
parentRect = sidebar.parentNode.getBoundingClientRect() | |
stickySidebarLeft = parentRect.width + parentRect.left - sidebarRect.width | |
stickySidebarTop = 16 | |
stickyThreshold = sidebarRect.top + window.pageYOffset - stickySidebarTop |
Here's what I do after I do a fresh install of Lion. Things are sorta grouped by type.
- Run Software Update
- Start downloading Xcode
- Disable auto-bright and turn brightness all the way up
- Enable mouse right click
This file contains 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
color vividchalk | |
" Ignore bad Rails stuff | |
set wildignore+=test/fixtures/**,vendor/gems/** | |
set wildignore+=enterprise,repositories | |
set wildignore+=public/images,public/javascripts/MathJax,tmp | |
" Show whitespace | |
set list listchars=trail:.,tab:>. |
OlderNewer