Skip to content

Instantly share code, notes, and snippets.

View ryan-allen's full-sized avatar
🐒
Turtles

Ryan Allen ryan-allen

🐒
Turtles
View GitHub Profile
@ryan-allen
ryan-allen / 1_pi.rb
Created November 16, 2010 02:16 — forked from geelen/1_pi.rb
def poop1(x,y)
Math.sqrt(x * x + y * y)
end
def poop2(x,y)
poop1(x,y) < 1
end
def random_poop
rand * 2 - 1
@ryan-allen
ryan-allen / unicode-methods.rb
Created November 16, 2010 05:31
the fact that this works i think was worth all the effort
def ΒΏ
puts 'IMA UPSIDEDOWN QUESTIONMARK LOL'
end
ΒΏ # => IMA UPSIDEDOWN QUESTIONMARK LOL
ΒΏ # => IMA UPSIDEDOWN QUESTIONMARK LOL
ΒΏ # => IMA UPSIDEDOWN QUESTIONMARK LOL
ΒΏ # => IMA UPSIDEDOWN QUESTIONMARK LOL
ΒΏ # => IMA UPSIDEDOWN QUESTIONMARK LOL
ΒΏ # => IMA UPSIDEDOWN QUESTIONMARK LOL
var unique = function(array) {
var pushed = {}, output = []
for (n in array) {
var value = array[n]
if ( !pushed[value] ) {
output.push(value)
pushed[value] = true
}
}
return output
@ryan-allen
ryan-allen / scan_until.php
Created February 2, 2011 05:32
recursive string scanner
<?php
function scan_until($subject, $search, $position = 0, $match_position = 0, $buffer = '') {
$char = substr($subject, $position, 1); // take of a character
$position += 1; // increment our subject position
if ($position == strlen($subject)) { // are we at the end and haven't found shit?
return $subject;
}
@ryan-allen
ryan-allen / u-mad.txt
Created April 1, 2011 03:15
problem?
.........,....................,......,.............,......,........................
...,,..,...........................,......:,,::,,:,.,,,,:,.,,.........,...,..,,....
..,..,,.....,......2illlβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–“β–“β–“β–“β–ˆβ–ˆβ–“.........,..,,..
,...,..,...,.kβ–“β–ˆβ–“β–“β–“β–“lBEnjjBllllllBjzvβ–‘1JTHtq8tL;..,...nllβ–ˆβ–“.......,...,,
..,......vβ–“β–ˆM:..,::,,:;1JBt;,...,....q:......:vFllβ–“β–“llEL.....β–ˆβ–“,......,...
,...,.....β–ˆ,,,...β–‘;........;x,.......,:,,..,,:,,........,β–‘,,,.....β–ˆlM.......,,
.....,:nβ–ˆβ–“...,..Liiβ–ˆβ–ˆβ–ˆβ–“B1........tjβ–“β–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆlM.,,........jβ–ˆβ–“;......
...Wβ–ˆβ–ˆβ–“w,,..,Yβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆM...kβ–ˆβ–ˆβ–“β–“β–“β–ˆβ–“lllβ–“β–“vβ–“β–“β–“β–“β–“;.β–“β–ˆβ–“...
..#llβ–ˆ::vnβ–“β–“β–“β–“g;J:..,.tβ–ˆβ–“................,nβ–“β–“glllβ–“β–“β–“β–“Wlβ–“β–“.wllβ–ˆ..
...ziβ–ˆ;:..,..,tβ–“7β–“β–“β–‘2llβ–ˆβ–“:......,.Xβ–“Bq..,.........Bllβ–“β–“β–ˆβ–“.Elβ–ˆ3.Fβ–ˆlll
Hip hip hooray! It's Cogent Day!
Let's get together and share the love!
We're all Men, but that's OK!
Hip hip hooray! It's Cogent Day!
var Circle = function(radius) {
var calculateDiameter = function() {
return radius * 2
}
// here's a new 'circle'
return {
radius: radius,
calculateDiameter: calculateDiameter
}
printscreen::f5
^printscreen::send {Control down}{f5}{Control up}
scrolllock::send {shift down}{f5}{shift up}
pause::send {shift down}{control down}{b}{shift up}{control up}
control::capslock
capslock::control
insert::media_play_pause
pgup::volume_up
pgdn::volume_down
// ==UserScript==
// @name Hide Google Inbox Canned Reply Buttons
// @namespace http://tampermonkey.net/
// @version 0.1
// @match https://inbox.google.com/*
// ==/UserScript==
(function() {
document.styleSheets[0].insertRule("div.GP { display: none; }", 1);
})();