Skip to content

Instantly share code, notes, and snippets.

View dehart's full-sized avatar

Michael dehart

  • The Netherlands
View GitHub Profile
@topliceanu
topliceanu / micro-mustache.js
Created December 30, 2011 04:22
John Resig's Micro Template with changed tags from <%=, %> into more mustache-esque {{= and }}
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@ganglio
ganglio / gist:4464968
Created January 6, 2013 03:08
JS: $ shortcut to querySelectorAll
function $(expr, con) {
return [].slice.call((con || document).querySelectorAll(expr));
}
@DevWouter
DevWouter / whatsapp-countdown.js
Last active May 4, 2020 12:30
Countdown timer for whatsapp (now with instructions)
/**
* This script was written in 2015 and no longer works since 2017.
* The issue is most likely the `document.querySelector` since the queries return no results.
*/
// How to use this script:
// 1. Go to web.whatsapp.com and connect your device.
// 2. Open the developer console in chrome (F11 on windows, command+alt+i on mac)
// 3. Go to the tab console
// 4. Copy the script below, paste it and press enter.