Skip to content

Instantly share code, notes, and snippets.

View walkermatt's full-sized avatar
💭
Drinking tea

Matt Walker walkermatt

💭
Drinking tea
View GitHub Profile
function* runTimer(getState) {
while(yield take('START')) {
while(true) {
const {stop, tick} = yield race({
stop : take('STOP'),
tick : call(wait, ONE_SECOND);
})
if ( !stop ) {
yield put(actions.tick());
@t-mart
t-mart / netrw quick reference.md
Last active June 9, 2025 02:06
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
@javisantana
javisantana / speed.sql
Created August 12, 2015 11:05
speed from a track table
WITH deltas as (
SELECT
st_distance(the_geom::geography, lag(the_geom::geography, 1) over(order by timestamp)) as ddist,
timestamp - lag(timestamp, 1) over(order by timestamp) as dt
from out_2 offset 1000
)
select avg(ddist/dt) as speed from deltas
@AustinDizzy
AustinDizzy / pre-commit
Created July 12, 2015 04:47
A pre-commit git hook that prompts you to automatically `gofmt` Go files staged to commit.
#!/bin/sh
# Modified 2015, Austin Dizzy
# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# git gofmt pre-commit hook
#
# To use, store as .git/hooks/pre-commit inside your repository and make sure
# it has execute permissions.
@alicebartlett
alicebartlett / Hiring-links.md
Last active November 26, 2018 03:41
A while ago I asked twitter for resources on hiring, here are some links:
-- Open These views with QGIS
-- You can label the ticks view with this expression : "CASE WHEN m % 5 = 0 THEN h END" to get hour numbers
-- Set categorized styles on typ and unit to set different styles for dials, and for the hands
-- Please tweet your best clock designs with #PostGISClock hashtag
create or replace view ticks as
select
m as id
, case when m % 5 = 0 then 'h' else 'm' end as typ
, m % 5 as h
var Dialog = React.createClass({
render: function() {
// 1) render nothing, this way the DOM diff will never try to do
// anything to it again, and we get a node to mess with
return React.DOM.div();
},
componentDidMount: function() {
// 2) do DOM lib stuff
this.node = this.getDOMNode();
bash$ GLOBIGNORE="confidential.txt"
bash$ ls -l /opt/too_many_files/*
secret.txt
top_secret.txt
public.txt
@elithrar
elithrar / wale_postgres_recovery.md
Last active June 6, 2025 20:55
WAL-E + Postgres 9.x (single server + DB) Setup and Recovery

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E: https://github.com/wal-e/wal-e
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).

Setup:

  1. These packages:
@sgillies
sgillies / GNU parallel vs concurrent.futures console
Last active March 30, 2017 20:41
Python concurrency benchmarks
vas-y:parallelz seang$ time parallel wc ::: `find ~/writing/blog/2013 -name *.rst`
18 128 791 /Users/seang/writing/blog/2013/10/07/downgrading-my-blog.rst
106 567 4011 /Users/seang/writing/blog/2013/10/08/linking-geojson.rst
34 249 1586 /Users/seang/writing/blog/2013/10/24/joining-mapbox.rst
70 373 2910 /Users/seang/writing/blog/2013/11/24/introducing-rasterio.rst
14 45 395 /Users/seang/writing/blog/2013/12/02/geojson-website-refreshed.rst
25 158 1256 /Users/seang/writing/blog/2013/12/03/atom-extension-for-tinkerer.rst
16 74 627 /Users/seang/writing/blog/2013/11/27/new-home-on-github-for-geojson.rst
143 685 6211 /Users/seang/writing/blog/2013/12/04/json-diff-and-patch-for-geojson.rst
26 202 1237 /Users/seang/writing/blog/2013/12/05/first-blog-post-at-mapbox.rst