Skip to content

Instantly share code, notes, and snippets.


Matt Fairbrass matt-d-rat

View GitHub Profile
[Raster tiles][rt] [Vector tiles][vt] GeoJSON virtual-dom offline map quality React component React Native
google maps + + good [4 unsupported][gm-react] [+][gm-native]
leaflet * + [+][ll-vt] + [+/-][ll-offline] depends [+][ll-rect]
d3 * + [+/-][d3-vdom] +/- depends [+][d3-react]
MapboxGL + + depends [+][mb-react] [+][mb-native]
Yandex Maps +
Vestride /
Last active Sep 22, 2021
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
spoike / webapi_example.js
Last active May 12, 2017
Simple WebAPI example
View webapi_example.js
var PostsApi = require('webapi/posts'),
// assuming the api object from the jsbin snippet
Reflux = require('reflux');
var PostActions = createActions(["load", "loadError"]);
// load action is invoked either from:
// * top most component's componentDidMount
// function in your application, or
// * window.onLoad
// I prefer the first strategy because that'll
mikomatic / ng-prism.js
Created Jul 17, 2014
Angularjs directive with prism code highlight
View ng-prism.js
* Usage
* <ng-prism class="language-css">
* body {
* color: red;
* }
* </ng-prism>
* the files prismjs and prism css must be included in HTML, use class "language-XXX" to specify language
#!/usr/bin/env zsh
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# How it works:
# 1| Display a textual history of all commits.
# 2| Ancestors of the current commit are indicated
# by a star. Filter out everything else.
View Gruntfile.js
module.exports = function(grunt) {
pkg: grunt.file.readJSON('package.json'),
watch: {
css: {
files: ['styles/*'],
tasks: ['sass', 'cssmin', 'copy:css']
dergachev /
Last active Sep 22, 2021
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application: