Skip to content

Instantly share code, notes, and snippets.

View jakeboxer's full-sized avatar

Jake Card jakeboxer

View GitHub Profile

Jessica's magic card names

  • mean messenger
  • tyrannical overlord
  • rumbling rabbit
  • fireball (her first real one)
  • white priest
  • big spider (not real, but "giant spider"!)
  • swing sword
  • conjure tornado (no, but there is a card called "tornado")
$ ->
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
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
// 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);
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})"
#######
# Bad #
#######
class Dog
end
class Cat
end
a = 0101 = 5
b = 0011 = 3
a | b means:
0101
| 0011
======
def something?
true
end
def something_else?
false
end
x = 0
# Directory structure
.
├── README.md
└── lib
├── a.rb
├── b.rb
└── c.rb
# Blob SHAs:
README.md's SHA is 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8