This gist holds a few images used in the chroma.js wiki.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Alpha-Shapes</title> | |
<script src="http://mbostock.github.com/d3/d3.js"></script> | |
<script src="http://mbostock.github.com/d3/d3.geom.js"></script> | |
<style type="text/css"> | |
path { |
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
/** | |
* This is the light version of Danial Wachsstock's jQuery based CSS parser | |
* http://bililite.com/blog/2009/01/16/jquery-css-parser/#parserdetails | |
* | |
* Everything is removed but the core css2object parsing | |
* | |
* Usage is straight forward: | |
* | |
* $.parseCSS('body { background: red; font-weight: 300 }'); | |
* // returns { 'body': { 'background': 'red', 'font-weight': 300 } } |
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
<?php | |
/* | |
Template Name: sitemap.json | |
*/ | |
$args = array(); | |
$args['post_per_page'] = -1; | |
$args['nopaging'] = true; | |
query_posts( $args ); |
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::bind ?= (scope) -> | |
_function = this | |
() -> | |
_function.apply scope, arguments | |
$.ender | |
loadAssets: (opt) -> | |
data = {} | |
cnt = 0 | |
for id of opt.assets |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from twitter import Twitter, OAuth | |
import json | |
auth_token = 'xxxxxxxxxxxxxx' | |
auth_token_secret = 'xxxxxxxxxxxxxxxx' | |
consumer_key = 'xxxxxxxxxxxxxxxx' | |
consumer_secret = 'xxxxxxxxxxxxxxxx' | |
user = "driven_by_data" |
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
# read csv file | |
ds <- read.csv('2012-Presidential-Campaign-Finance-Contributors.tsv', sep='\t') | |
# aggregate by candidate | |
res <- aggregate(ds$contb_receipt_amt, by=list(ds$cand_nm), FUN=sum, na.rm=TRUE) | |
X = data.frame(name=res$Group.1, amount=res$x) | |
# make data columns callable without typing X$ everytime | |
attach(X) |
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() { | |
function fmt_amount(a) { | |
a*=1000000; | |
if (a > 1000000000) a = Math.round(a/100000000)/10 + ' bio'; | |
else if (a > 1000000) a = Math.round(a/100000)/10 + ' mio'; | |
else if (a > 1000) a = Math.round(a/100)/10 + ' k'; | |
else a = Math.round(a*10)/10; | |
return '€ '+a; | |
}; |
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
{ | |
"proj": { | |
"id": "satellite", | |
"up": 23, | |
"dist": 1.15 | |
}, | |
"layers": [{ | |
"id": "regions", | |
"src": "italy-nuts2.shp", | |
"attributes": [{ "src": "NUTS_ID", "tgt": "nuts2" }] |