I hereby claim:
- I am derek-watson on github.
- I am dcwca (https://keybase.io/dcwca) on keybase.
- I have a public key ASAAJN3pQwa-0zO63HrqN7dKGC2rUPmm9EeqmuBnHARbcQo
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
# Supports post types: regular, quote, link, photo, video and audio | |
# Saves local copies of images | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' |
(function() { | |
function proxyAjaxEvent(event, options, dit) { | |
var eventCallback = options[event]; | |
options[event] = function() { | |
// check if callback for event exists and if so pass on request | |
if (eventCallback) { eventCallback(arguments) } | |
dit.processQueue(); // move onto next save request in the queue | |
} | |
} | |
Backbone.Model.prototype._save = Backbone.Model.prototype.save; |
var isThrottled = false, | |
throttleDuration = 24; // ms | |
function thingToThrottle() { | |
if (isThrottled) { return; } | |
isThrottled = true; | |
setTimeout(function () { isThrottled = false; }, throttleDuration); | |
// do your work here | |
} |
# - Reads from STDIN until EOF | |
# - Writes to STDOUT. | |
# - Requires Nokogiri (gem install nokogiri) | |
# | |
# Hi Tom! | |
require 'nokogiri' | |
doc = Nokogiri::HTML.parse(STDIN.read) |
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
/* | |
npm install --save bunyan | |
Basic usage: | |
var logger = require('./logger') | |
logger.info('hi') | |
log.warn({lang: 'fr'}, 'au revoir') | |
Create specific loggers for various parts of your app, |
I hereby claim:
To claim this, I am signing this object:
// extend Promise | |
Promise.allObj = promises => { | |
return Promise | |
.all(Object.values(promises)) | |
.then(values => { | |
return values.reduce((obj, val, i) => { | |
obj[Object.keys(promises)[i]] = val | |
return obj | |
}, {}) | |
}) |
from shapely.geometry import shape, mapping | |
from shapely.ops import unary_union | |
import fiona | |
import itertools | |
with fiona.open('Data/NonRegulatoryLayers_Subset.shp') as input: | |
# preserve the schema of the original shapefile, including the crs | |
meta = input.meta | |
with fiona.open('Out/dissolved.shp', 'w', **meta) as output: | |
# groupby clusters consecutive elements of an iterable which have the same key |