Skip to content

Instantly share code, notes, and snippets.

@wjdennen
wjdennen / README.md
Last active August 29, 2015 14:04
Simple Leaflet map

Code to create a simple map with Leaflet

from json import load, JSONEncoder
from optparse import OptionParser
from re import compile
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
parser = OptionParser(usage="""%prog [options]
Group multiple GeoJSON files into one output file.
@wjdennen
wjdennen / README.md
Last active August 29, 2015 14:03 — forked from mbostock/.block
Creates a map with a background image (tiles).

A demo of the d3.geo.tile plugin, which determines which 256x256 tiles are visible in the viewport based on a scale and translate. This demo combines the tile plugin with d3.behavior.zoom for panning and zooming, resulting in a a simple slippy map. Based partly on an example by Tom MacWright.

@wjdennen
wjdennen / 0_reuse_code.js
Created July 2, 2014 18:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wjdennen
wjdennen / network-authors.php
Created May 10, 2012 00:52
get authors of all network sites
<?php
// update: this code seems to work now
require('/home/username/public_html/wp-load.php');
$list = get_blog_list( 0, 'all' );
foreach ($list as $site) {
switch_to_blog( $site["blog_id"] );
@wjdennen
wjdennen / list-attachments-shortcode-mod.php
Created March 17, 2012 01:48
Adds mime type to attachment list
<?php
// modified to add mime type
/*
Plugin Name: List Attachments Shortcode
Plugin URI: http://plugins.ten-321.com/category/list-attachments/
Description: This plug-in simply adds a new shortcode that allows you to list all of a post's attachments inline.
Version: 0.4a
Author: Curtiss Grymala