Skip to content

Instantly share code, notes, and snippets.

// addEventListener polyfill IE6+
if ( !window.addEventListener ) {
(function ( win, doc ) {
var Event, addEventListener, removeEventListener, head, style;
Event = function ( e, element ) {
var property, instance = this;
for ( property in e ) {
instance[ property ] = e[ property ];
<script type="text/javascript">
// See MDN: https://developer.mozilla.org/en-US/docs/DOM/MutationObserver?redirectlocale=en-US&redirectslug=DOM%2FDOM_Mutation_Observers
(function(){
// select the target node
var target = document.querySelector('body');
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
var i={};
// create an observer instance
var observer = new MutationObserver(function(mutations) {
steps from huge shape file to topo json:
topojson -q 1e3 --id-property ELECT_DIV national-esri-16122011/COM20111216_ELB_region.shp -o aussieMapTopoFromShp.json
/* -q 1e3 */ //This is the quality/simplification property, the lower the number the lower the quality
/* --id-property ELECT_DIV */ //This copies over the ELECT_DIV property from the shape file to the topoJSON file
//national-esri-16122011/COM20111216_ELB_region.shp //This is the input shape file
@Rich-Harris
Rich-Harris / gtfo.py
Last active August 29, 2015 13:56 — forked from wuub/gtfo.py
import sublime, sublime_plugin
BUILD_COLOR_SCHEME = "Packages/Color Scheme - Default/Dawn.tmTheme"
def in_build_dir(view):
if not view or not view.file_name():
return False
return "/build/" in view.file_name()
@Rich-Harris
Rich-Harris / App.html
Created March 28, 2018 15:33 — forked from paulocoghi/App.html
Multiple components and store variables ($)
<InputAdd></InputAdd>
<List></List>
<script>
import InputAdd from './InputAdd.html'
import List from './List.html'
import { Store } from 'svelte/store.js';