Skip to content

Instantly share code, notes, and snippets.

veltman / gist:4519251
Last active December 11, 2015 00:49
Individual events
View gist:4519251
"beat": "local",
"event": "weather",
"description": "Boston's current temperature of 51° F is higher than this day's previous record of 49° F set on January 12, 1970.",
"url": "http:\/\/\/weather-forecast\/US\/MA\/Boston.html",
"importance": 1,
"timestamp": "2013-01-12T18:37:06-05:00"
View gist:4519311
"local": {
"beat": "local",
"name": "Local",
"description": "Local news for Boston.",
"icon": "local.png",
"triggers": [
"name": "hotspot",
"description": "Local restaurants and shops receiving a sudden increase of attention.",
veltman / Printable Markdown
Last active August 24, 2020 05:40
Bookmarklet to create a printable version of a Markdown file on GitHub. Create a bookmark in your toolbar with this code as the URL, then click the bookmark while viewing a Markdown document (like a README) on GitHub to strip away the rest of the page for a clean, printable version. Or, if what I just said sounded scary, visit this page: http://…
View Printable Markdown
javascript:(function(){ document.body.innerHTML = document.getElementById("readme").getElementsByTagName("article")[0].outerHTML; })();
veltman / gist:5952642
Created July 8, 2013 21:25
Changing the stroke-linecap of a polyline in leaflet
View gist:5952642
testPolyline = new L.Polyline(
//Left-click makes it flat
veltman / gist:6186441
Last active December 20, 2015 19:49
Bookmarklet, when executed on a google search results page it will cycle through everything in search_terms[] and record the suggestions to a big JSON object. After it cycles through all the terms, it will replace the document HTML with the stringified JSON. Minify it before using it.
View gist:6186441
//get jQuery
if (window.jQuery === undefined) {
var done = false;
var script = document.createElement("script");
script.src = "http:////";
script.onload = script.onreadystatechange = function(){
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) {
done = true;
View gist:6369472
-Step 1: basic HTML skeleton for a full-screen map
-Step 2: initialize a map
-Step 3: add a tile layer
-Step 4: Add a marker
-Step 5: Add a line
-Step 6: Add a polygon
-Step 7: Styling: add a polygon with different styling
-Step 8: Click/hover
-On click, re-center map
-On hover, change styling of polygon
veltman / gist:6475297
Created September 7, 2013 12:47
JavaScript function for stitching two arrays with overlapping ends into a single array (e.g. [1,2,3] and [3,4,5] into [1,2,3,4,5]).
View gist:6475297
function stitch(s1,s2) {
var l1 = s1.length;
var l2 = s2.length;
if (!l1) return s2;
if (!l2) return s1;
if (s2[0] == s1[l1-1]) return s1.concat(s2.slice(1));
if (s1[0] == s2[l2-1]) return s2.concat(s1.slice(1));
View gist:6681784
tell application "System Events" to start current screen saver
delay 60
tell application "System Events" to key code 59
delay 1
end repeat
View gist:7029964
from bs4 import BeautifulSoup
import requests
url = ""
text = requests.get(url).text
page = BeautifulSoup(text)
for link in page.find_all("a"):
veltman / index.html
Last active January 1, 2018 19:42
For creating an approval matrix/magic quadrant viz in d3.
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
.grid {
stroke-width: 0.5px;
stroke: steelblue;
fill: none;
opacity: 0.5;