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 csv | |
from collections import defaultdict | |
with open('/Users/adam/Downloads/languages-2014.csv', 'r') as f: | |
results_2014 = [row for row in csv.reader(f)][1:] | |
with open('/Users/adam/Downloads/languages-2013.csv', 'r') as f: | |
results_2013 = [row for row in csv.reader(f)][1:] | |
with open('/Users/adam/Downloads/languages-2012.csv', 'r') as 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
TSTapstream *tracker = [TSTapstream instance]; | |
// Call getConversionData to get the user's timeline history | |
[tracker getConversionData:^(NSData *jsonInfo) { | |
if(jsonInfo == nil) | |
{ | |
// No conversion data available | |
} | |
else | |
{ |
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
// Chart.redraw | |
redraw: function (animation) { | |
var chart = this, | |
//... | |
series = chart.series, | |
//... | |
; | |
// ...<snip>... |
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
### Keybase proof | |
I hereby claim: | |
* I am adambard on github. | |
* I am adambard (https://keybase.io/adambard) on keybase. | |
* I have a public key whose fingerprint is D7B0 3610 4BA0 86AA 366A 2733 2E89 85DE 39A5 2FFC | |
To claim this, I am signing this object: |
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 hashlib | |
import requests | |
from bs4 import BeautifulSoup | |
URL = ("http://www.forbes.com/pictures/emjl45gkke/on-startups/") | |
# $('.next.prev_next a').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
(ns multipart-test | |
(:import | |
javax.ws.rs.core.MediaType | |
com.sun.jersey.api.client.Client | |
com.sun.jersey.api.client.ClientResponse | |
com.sun.jersey.api.client.config.DefaultClientConfig | |
com.sun.jersey.api.client.filter.HTTPBasicAuthFilter | |
com.sun.jersey.multipart.FormDataMultiPart | |
com.sun.jersey.multipart.file.FileDataBodyPart | |
com.sun.jersey.multipart.impl.MultiPartWriter) |
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 csv | |
import numpy | |
with open("c46145.csv", "rb") as f: | |
r = csv.reader(f) | |
headers = r.next() | |
print headers | |
vwh_idx = headers.index('VWH$') |
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
# Count contributors | |
ready do | |
# Prepare the pages | |
pages = sitemap.resources.select{ |r| | |
r.path.match(/^docs\/.*\.html/) and not r.path.include?("README") and not r.path.match /file\.html$/ | |
}.sort_by{ |r| | |
r.metadata[:page]["language"].downcase | |
} |
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
; Comments start with semicolons. | |
; Clojure is written in "forms", which are just | |
; lists of things inside parentheses, separated by whitespace. | |
; | |
; The clojure reader assumes that the first thing is a | |
; function or macro to call, and the rest are arguments. | |
; | |
; Here's a function that sets the current namespace: | |
(ns test) |
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
(ns example.errors) | |
(defn clean-address [params] | |
"Ensure (params :address) is present" | |
(if (empty? (params :address)) | |
[nil "Please enter your address"] | |
[params nil])) | |
(defn clean-email [params] | |
"Ensure (params :email) matches *@*.*" |