Skip to content

Instantly share code, notes, and snippets.

Avatar

Sindre Wimberger sindre

View GitHub Profile
@nico-martin
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="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script>
<script>
window.gtagTrackingID = 'UA-XXXXXXXX-X';
window.gtagDisableStr = 'gtag-disable-' + gtagTrackingID;
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
@rikschennink
rikschennink / README.md
Last active Jan 29, 2019
Sass OO Mixins: OOCSS without the HTML clutter
View README.md

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>
View README.md

The issue:

..mobile 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 https://developers.google.com/mobile/articles/fast_buttons 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
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
View storytelling_from_space.md

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
cubiq / select-reset.html
Created May 27, 2014
How to reset a select tag
View select-reset.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Styled Select</title>
</head>
<style>
* {
View reading_list.md
@fnicollet
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
goog.provide('L.SingleTileWMSLayer');
goog.require('L.Map');
L.SingleTileWMSLayer = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',
@paulirish
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
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: http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html
View wp8-ie10-fix.js
(function() {
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(
document.createTextNode("@-ms-viewport{width:auto!important}")
);
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
})();
You can’t perform that action at this time.