This file contains hidden or 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 python | |
# encoding: utf-8 | |
# | |
# Requires statlib http://code.google.com/p/python-statlib/ | |
""" | |
process_tornado_bm.py | |
Created by Jacob Kristhammar on 2010-12-09. | |
""" |
This file contains hidden or 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() { | |
$("div.content").live("showoff:show", function(evt) { | |
var bg_img = $("img[alt=background]", evt.target); | |
if (bg_img.size() > 0) { | |
var src = bg_img.attr("src"); | |
bg_img.hide(); | |
// Set new background on body | |
$("body").css("background", "url(" + src + ") no-repeat center center fixed") | |
.css("-webkit-background-size", "cover") |
This file contains hidden or 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
import random as r;_,N=range,1e6;l=_(13)*4 | |
print sum([r.shuffle(l)or 0in[x-y for x,y in zip(l[1:],l)]for i in _(N)])/N |
This file contains hidden or 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
# Make sure people know who saw it first! | |
# | |
# TODO | |
# * Figure out how to properly check content (hash) | |
# - perhaps only usable for images | |
# * Make it possible to post link you know is old | |
# * List last links | |
# * List most posed links | |
# * Test if a link has been posted before |
This file contains hidden or 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
# Get money donated to musikhjälpen 2011 | |
# | |
# show me the money - returns how much money that has been donated | |
# | |
module.exports = (robot) -> | |
robot.respond /(show me the money|mh)/i, (msg) -> | |
msg.http("http://sverigesradio.se/p3/musikhjalpen/xml/ticker.htm") | |
.get() (err, res, body) -> | |
if res.statusCode is 200 |
This file contains hidden or 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 bash | |
FORCE=false | |
while getopts f o; do | |
case $o in | |
f) FORCE=true;; | |
esac | |
done |
This file contains hidden or 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
# Flip things!!! | |
# | |
# flip <something> - Flips something | |
# flip <something>, <something else>, ... - Flips all the things | |
# FLIP!?|flip! <something> - Really flips something | |
module.exports = (robot) -> | |
robot.respond /FLIP( ME)? (.*)/, (msg) -> | |
msg.send flip_angry(msg.match[2]) |
This file contains hidden or 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
# Metadata lookup for youtube links | |
# | |
# <youtube link> - returns info about the link | |
# | |
module.exports = (robot) -> | |
robot.hear youtube.link, (msg) -> | |
msg.http(youtube.uri msg.match[1]).get() (err, res, body) -> | |
if res.statusCode is 200 | |
data = JSON.parse(body) |
This file contains hidden or 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
├ app/config.js | |
│ | |
├ app/em.js | |
│ ├─ jquery | |
│ ├─ use!underscore | |
│ ├─ use!backbone | |
│ ├─ use!handlebars | |
│ └─ use!plugins/backbone.layoutmanager | |
│ | |
├ app/main.js |
OlderNewer