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
{"yes":"stations","stations":[{"name":"KLYY","desc":"97.5 - La Cumbia Caliente","genre":"Latin","market":"Riverside - San Bernardino, CA","type":"radio","id":"778","tz":"PST","stream":"189001d24c8e78fcf2277c84c39c404c1458fb74","relay":"r2b"},{"name":"KXLM","desc":"102.9 - ","genre":"Latin","market":"Riverside - San Bernardino, CA","type":"radio","id":"2540","tz":"PST","stream":"04556ba4ffac3258ab48aaf0f3b03474c5272f2c","relay":"r2a"},{"name":"KXOL","desc":"96.3 - Latino 96.3","genre":"Latin","market":"Los Angeles, CA","type":"radio","id":"3189","tz":"PST","stream":"9bd1cc714ef4e6e7817f59a99e37b1ae2a3999e3","relay":"r2b"},{"name":"KIIS","desc":"102.7 - The #1 Hit Music Station","genre":null,"market":"Los Angeles, CA","type":"radio","id":"4436","tz":"PST","stream":"b26881d6b3bc02b87635826abc3db76809fe7268","relay":"r2b"},{"name":"KJLH","desc":"102.3 - ","genre":"R&B\/Soul","market":"Los Angeles, CA","type":"radio","id":"7154","tz":"PST","stream":"1eab73420c8ec0c161d1a48080a39ce30a444799","relay":"r2b"},{"name": |
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
import reddit, getpass | |
if __name__ == "__main__": | |
r = reddit.Reddit(user_agent="test") | |
user_name = raw_input("User name: ") | |
password = getpass.getpass("Password: ") | |
r.login(user=user_name,password=password) | |
saved_links = r.get_saved_links() | |
for link in saved_links: | |
print "Title: " + link.title |
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
<html> | |
<head> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<style type="text/css"> | |
input#email { z-index:1; height:27px; } | |
label[for='email_label'] { z-index:0; position:absolute; } | |
</style> | |
<script type="text/javascript"> |
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
require 'rubygems' | |
require 'sourcify' | |
require 'andand' | |
def with_andand(&blk) | |
methods = blk.to_source.split("{")[1].split("}")[0].split(".").each { |w| w.strip! } | |
main_object = methods.first | |
methods = methods.slice(1,methods.length) | |
methods.each do |meth| | |
main_object = eval("#{main_object}.andand.#{meth}") |
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
$(document).ready(function() { | |
// grab urls for all the images | |
var pin_elems = $("a.PinImage"); | |
$.each(pin_elems, function(i,v) { | |
$.get(v.href, {}, function(data) { | |
$("img", v).attr("src", $("div#PinImage a", $(data)).attr("href")); | |
}); | |
}); | |
}); |
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 currying | |
function curry(fn) { | |
var s = Array.prototype.slice; | |
var vargs = s.call(arguments, 1); | |
return function() { | |
var nargs = s.call(arguments); | |
var args = vargs.concat(nargs); | |
return fn.apply(null, args); | |
}; |
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
ruby -e "require 'date'; puts \"It's been #{(Date.today - Date.new(2012,01,16)).to_i} days since the beginning\!\"" |
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 scrape_all_the_idioms | |
url = "http://www.learnenglishfeelgood.com/americanidioms/lefgidioms" | |
idioms = {} | |
("b".."z").each do |letter| | |
idioms[letter] = {} | |
doc = Nokogiri::HTML(open(url + "_" + letter + ".html")) | |
idiom_definition = 3 | |
doc.css("#content .blue").each do |nodes| | |
definition = doc.xpath("//*[@id='content']/text()[#{idiom_definition}]") | |
idioms[nodes.content] = doc.xpath("//*[@id='content']/text()[#{idiom_definition}]").text.strip! |
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
import scala.actors._ | |
import scala.actors.Actor._ | |
case object Poke | |
case object Feed | |
class Kid() extends Actor { | |
def act() { | |
loop { | |
react { | |
case Poke => { |
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
These are metasyntatic variables often used in computer programming, people seem to not know about this. | |
* Foo | |
* Bar | |
* Baz | |
* Qux | |
* Quux | |
This is to avoid future questions about: "what's a qux?", "who's actually named Foo Bar?", "Did you mean <some absurd correction>?" |
OlderNewer