Skip to content

Instantly share code, notes, and snippets.


Sindre Wimberger sindre

View GitHub Profile
nico-martin / gtag-gdpr-ready.html
Last active Feb 24, 2020
This little snippet provides a simple way to a) implement Google Tag Manager with anonymized IP and b) provide a Opt-Out / Opt-In mechanism: gtagOptOutIn();
View gtag-gdpr-ready.html
<script async src=""></script>
window.gtagTrackingID = 'UA-XXXXXXXX-X';
window.gtagDisableStr = 'gtag-disable-' + gtagTrackingID;
window.dataLayer = window.dataLayer || [];
function gtag() {
rikschennink /
Last active Jan 29, 2019
Sass OO Mixins: OOCSS without the HTML clutter

Sass OO Mixins: OOCSS without the HTML clutter

  • Less HTML clutter (caused by all those fragmented class names).
<button class="btn btn-primary btn-large btn-outline">Buy!</button>
  • Descriptive classes (or no classes at all) in the HTML results in cleaner and easier to read HTML.
<button class="btn-call-to-action">Buy!</button>

The issue: browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

tobie / whatfreq.js
Last active Sep 7, 2015
Sensor sample frequency
View whatfreq.js
// Trying to find the formula to determine the frequency
// at which to sample GPS coordinates of a moving vehicle
// in order to have the maximum precision but not to store
// more data than necessary.
let precision = 1; // The precision of the GPS in meters
let max_speed = 180 / 3.6 // 180km/h converted to m/s = 50m/s
let max_frequency = max_speed / precision;
// Nyquist–Shannon sampling theorem[1] tells us a

Storytelling from Space: Tools/Resources

This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.

Acquiring Landsat & MODIS

Web Interface

cubiq / select-reset.html
Created May 27, 2014
How to reset a select tag
View select-reset.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Styled Select</title>
* {
fnicollet / gist:5764080
Created Jun 12, 2013
Single tile WMS layer for Leaflet. Kind of hacked on top of ImageOverlay, a new image is requested when the viewport is changed. Supports reprojection through proj4-leaflet There are actually 2 images (_image and _imageSwap) because if you use the _image from ImageOverlay, and set his "src" attribute to the new WMS bbox, your layer will disappea…
View gist:5764080
L.SingleTileWMSLayer = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',
paulirish / gist:5558557
Last active Oct 20, 2020
a brief history of detecting local storage
View gist:5558557

A timeline of the last four years of detecting good old window.localStorage.

Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

stowball / wp8-ie10-fix.js
Last active Jul 8, 2020
Microsoft's stop-gap solution to fix IE 10 & 11's viewport on Windows Phone 8. I've also added another condition so it won't run on other browsers that spoof the user agent. Details:
View wp8-ie10-fix.js
(function() {
if ("-ms-user-select" in && navigator.userAgent.match(/IEMobile/)) {
var msViewportStyle = document.createElement("style");
You can’t perform that action at this time.