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
var quotes = { | |
'shakespeare': "All the world's a stage, And all the men and women merely players; They have their exits and their entrances, And one man in his time plays many parts, His acts being seven ages.", | |
'fry': "An original idea. That can't be too hard. The library must be full of them.", | |
'wright': "I almost had a psychic girlfriend but she left me before we met.", | |
'gandhi': "An eye for an eye, and soon the whole world is blind", | |
'mlk': "A nation that continues year after year to spend more money on military defense than on programs of social uplift is approaching spiritual doom." | |
} | |
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
<div class="block"> | |
<h2>Upcoming Events</h2> | |
<h3>Month Name</h3> | |
<ul class="events"> | |
<li> | |
<img alt="" src="/images/icon_cal.png"> | |
<a href="event.url">event.title</a> | |
<br> | |
event.date | |
<br> |
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 random_pronouncable_password(size = 6) | |
c = %w(b c d f g h j k l m n p qu r s t v w x z ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr lt) | |
v = %w(a e i o u y) | |
f, r = true, '' | |
(size * 2).times do | |
r << (f ? c[rand * c.size] : v[rand * v.size]) | |
f = !f | |
end | |
r | |
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
$('body').click(function(e){ | |
var target = e ? e.target : window.event.srcElement; | |
console.log("you clicked" + target); | |
if (target.nodeName.toLowerCase === a) { | |
alert ("hello"); | |
} | |
}) |
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
# On the Receiving Server | |
rsync -arvt -e ssh --progress root@IPADDRESS:/path/to/files/ /path/to/where/you/want/to/put/files/on/recievingserver/ |
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
function (e) { | |
e = e || event; | |
var target = e.target || e.srcElement; | |
... | |
} |
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
walkTheDOM(node, function (e) { | |
for (var n in e) { | |
if (typeof e[n] === 'function') { | |
e[n] = null; | |
} | |
} | |
}); |
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
function purgeEventHandlers(node) { | |
walkTheDOM(node, function (e) { | |
for (var n in e) { | |
if (typeof e[n] === 'function') { | |
e[n] = null; | |
} | |
} | |
}); | |
} |
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
function addEventHandler(node, type, f) { | |
if (node.addEventListener) { | |
node.addEventListener(type, f, false); | |
} else if (node.attachEvent) { | |
node.attachEvent("on" + type, f); | |
} else { | |
node["on" + type] = f; | |
} | |
} |
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
#!/usr/bin/env ruby | |
abort "Integer argument is required" if ARGV.empty? | |
limit = ARGV[0].to_i | |
# accepts an integer and simply returns the passed in integer | |
# which should be inherently additive. | |
def secret n | |
n |
OlderNewer