Skip to content

Instantly share code, notes, and snippets.

View jakeboxer's full-sized avatar

Jake Card jakeboxer

View GitHub Profile
def something?
true
end
def something_else?
false
end
x = 0
a = 0101 = 5
b = 0011 = 3
a | b means:
0101
| 0011
======
#######
# Bad #
#######
class Dog
end
class Cat
end
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})"
// 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);
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
$ ->
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

New Machine

Here's what I do after I do a fresh install of Lion. Things are sorta grouped by type.

General Config

  1. Run Software Update
  2. Start downloading Xcode
  3. Disable auto-bright and turn brightness all the way up
  4. Enable mouse right click
@jakeboxer
jakeboxer / gist:1353121
Created November 9, 2011 21:31
My .vimrc.local for janus
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:>.