Skip to content

Instantly share code, notes, and snippets.

@NickCis
NickCis / youtube-screenshot.js
Created July 9, 2017 19:44
Youtube Screenshot bookmarklet
javascript: !function(){var a=document.querySelector(".video-stream.html5-main-video"),b=document.createElement("canvas"),c=b.getContext("2d");b.addEventListener("click",function(){b.parentNode.removeChild(b)}),b.width=a.videoWidth,b.height=a.videoHeight,c.drawImage(a,0,0,a.videoWidth,a.videoHeight),a.parentNode.parentNode.insertAdjacentElement("afterend",b)}();
@NickCis
NickCis / city-blocks.js
Created May 29, 2017 06:56
Get city blocks by coordinates
const fetch = require('node-fetch'),
polygonize = require('polygonize'),
interpreterUrl = 'http://overpass-api.de/api/interpreter';
function buildOverpassQL(lat, lon, around='500') {
return '[out:json];(' +
['primary', 'secondary', 'tertiary', 'residential', 'trunk'].map(
e => `way["highway"="${e}"](around:${around}, ${lat}, ${lon});`
).join('')+'); out body; >; out skel qt;';
}
@NickCis
NickCis / sphixbase.yaml-spec
Created June 7, 2014 08:49
sphinxbase for sailfish OS .yaml and .spec
-------------------------- sphinxbase.yaml ------------------------------
Name: sphinxbase
Summary: Common library for sphinx speech recognition.
Version: 0.8
Release: 1
Group: System/Libraries
License: BSD
URL: http://cmusphinx.sourceforge.net/
Description: |
Common library for sphinx speech recognition.