I hereby claim:
- I am davidgtonge on github.
- I am davidgtonge (https://keybase.io/davidgtonge) on keybase.
- I have a public key ASBBSg-GEvhAI3QaCjVBMAlnOjHy900waad7MYyXSyRlugo
To claim this, I am signing this object:
const replace = require("replace-in-file") | |
const files = "./test/**/*.js" | |
const opts1 = { | |
files, | |
from: /import\s([a-zA-Z]*)\sfrom\s("[a-z\.\/\_\-\@]*")/g, | |
to: (match, p1, p2) => `const ${p1} = require(${p2})`, | |
} |
I hereby claim:
To claim this, I am signing this object:
input { | |
syslog { | |
add_field => { | |
"docker" => "true" | |
} | |
} | |
} | |
output { |
This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.
This stacked bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:
width = 960 | |
height = 500 | |
projections = | |
"Aitoff": d3.geo.aitoff | |
"Albers equal": d3.geo.albers | |
"August conformal": d3.geo.august | |
"Lambert azimuthal equal": d3.geo.azimuthalEqualArea | |
"Azimuthal equidistant": d3.geo.azimuthalEquidistant | |
"Bonne": d3.geo.bonne |
scroller = (elem, width, initialised = false) -> | |
multiple = 1 | |
unless initialised | |
if width < 960 | |
mutiple += Math.floor(960 / width) | |
cloned = (elem.text() for i in [1...multiple]).join('...') | |
elem.text cloned | |
animateBy = multiple * width |
<?php | |
/* | |
* This function uses the mapit.mysociety.org api to | |
* retrieve ward names based on postcode | |
*/ | |
function sc_get_ward_from_postcode($postcode) | |
{ | |
//remove spaces and plus signs from the postcode | |
$postcode = str_replace(" ", "", $postcode); | |
$postcode = str_replace("+", "", $postcode); |
# Simple Coffeescript Templating | |
# Global Object to hold the templates | |
window.simpleCoffeeTemplates = | |
# An example template | |
example: (a) -> | |
""" | |
<div> | |
<h1 class='header'>#{a.header}</h1> |
<?php | |
function get_wpml_home_ids(){ | |
//Globalizse the $wpdb variable (instantiation of the wpdb class) | |
global $wpdb; | |
//Get the front-page id from the options table | |
$home_id = get_option('page_on_front'); | |
//Run the query |