Skip to content

Instantly share code, notes, and snippets.

@tschaub
tschaub / .gitignore
Last active January 20, 2023 14:23
OpenLayers + Webpack
/node_modules/
bundle.js
@tschaub
tschaub / index.html
Last active March 28, 2017 00:12
Test polyfill.io Promise in a Worker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test Promise.resolve() in a Worker</title>
</head>
<body>
This is a simple smoke test for <code>Promise.resolve()</code> in a Worker.
You should see an alert telling you if things worked or not.
<script src="./main.js"></script>
/**
* 1. Go to http://labs.strava.com/gpx-to-route/
* 2. Enter a Strava activity URL
* 3. Run this snippet
*/
map.eachLayer(layer => {
if (layer.getLatLngs) {
const coordinates = layer.getLatLngs().map(latLng => {
return [latLng.lng, latLng.lat];
});
@tschaub
tschaub / tools-as-depdendencies.md
Last active September 29, 2024 14:00
Reproducible module builds with tools (commands) as dependencies

Tools as dependencies

This example is a slight tweak on the best-practices example for working with Go modules as development dependencies.

The downside of the existing example is that someone who git clones your module to make a contribution, would not be able to run go generate (without extra work).

$ go generate
painkiller.go:5: running "stringer": exec: "stringer": executable file not found in $PATH