Skip to content

Instantly share code, notes, and snippets.

View danvk's full-sized avatar

Dan Vanderkam danvk

View GitHub Profile
<!DOCTYPE html>
<title>d3.behavior.drag test</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
circle { fill-opacity: 0.5; }
.c-Bob { fill: red; }
.c-Raven { fill: black; }
.c-Dan { fill: blue; }
.c-Adrian { fill: orange; }
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danvk
danvk / -
Created August 17, 2014 17:36
/*
Copyright (c) 2012, Canal TP
This is an example file, do whatever you want with it! (for example if you are in Paris, invite us for a beer)
This shows the simplest way to use the osm.pbf reader. It just counts the number of objects in the file.
To build this file :
g++ -O2 -o counter example_counter.cc -losmpbf -lprotobuf
To run it:
#!/usr/bin/env python
'''Removes all non-polygon features from a GeoJSON file.
For now, these must be FeatureCollections of Features.
'''
import sys
import json
assert len(sys.argv) == 2
{{Infobox Tennis Grand Slam events|2014|US Open|
| defchamp = {{flagicon|ESP}} [[Rafael Nadal]]
| before_name = US Open – Men's Singles
| after_name = US Open – Men's Singles
}}
{{main|2014 US Open (tennis)}}
[[Rafael Nadal]] was the defending champion, but withdrew before the tournament because of a right wrist injury.<ref>[http://www.tennis.com/pro-game/2014/08/rafael-nadal-withdraws-2014-us-open-right-wrist-injury/52465/#.U_H-hvmSySp Rafael Nadal withdraws from 2014 U.S. Open with right wrist injury], ''tennis.com'', 18 August 2014</ref>
<script src="http://fb.me/react-0.11.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script>
<div id="content"></div>
<script type="text/jsx">
/** @jsx React.DOM */
var Root = React.createClass({
/**
* Mix this in to a component to check that all its props are also in propTypes.
* This uses the ES6 Proxy object, currently only available in Firefox or
* Chrome with special flags.
*/
var PropertyValidationMixin = {
getInitialState: function() {
if (typeof(Proxy) == 'undefined') {
console.warn('Proxy is not available in this browser; props will be unchecked.');
return;
<script src="http://fb.me/react-0.11.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script>
<div id="content"></div>
<script type="text/jsx;harmony=true">
/** @jsx React.DOM */
var Root = React.createClass({
<script src="http://fb.me/react-0.11.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script>
<div id="content"></div>
<script type="text/jsx;harmony=true">
/** @jsx React.DOM */
var Root = React.createClass({
nav.navigation {
font-size: 12px;
position: absolute;
top: 0; left: 0; right: 0;
background: #fefefe;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
nav.navigation ul {
margin: 0;
padding: 0;