Skip to content

Instantly share code, notes, and snippets.

View tomzmtl's full-sized avatar

Thomas Andreo tomzmtl

  • Montréal, QC, Canada
View GitHub Profile
@tomzmtl
tomzmtl / fresh-chrome-with-custom-tz.sh
Created January 29, 2018 22:16 — forked from prasadsilva/fresh-chrome-with-custom-tz.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@tomzmtl
tomzmtl / es6-emoji.js
Created May 23, 2017 19:30
ES6 Emoji
String.fromCodePoint(0x1F4A9)
@tomzmtl
tomzmtl / stringToNodes.js
Created December 9, 2015 16:38
JS stringToNodes
function stringToNodes ( string )
{
var div = document.createElement('div');
div.innerHTML = string;
var allNodes = div.childNodes;
var nodes = [];
for ( var i = 0 ; i < allNodes.length ; i++ )
{
if ( allNodes[i].nodeType === Node.ELEMENT_NODE )
@tomzmtl
tomzmtl / Ajax.js
Last active December 11, 2015 03:33
Simple Ajax wrapper (Vanilla JS + Q Promises)
var Ajax = (function()
{
/**
* Serialize and URL-encode provided object.
* Note: not recursive, for single-level objects only.
* @param Object params
* @return String
*/
function _serializeParams ( params )
@tomzmtl
tomzmtl / getViewportDimensions.js
Created October 15, 2015 15:06
Get viewport dimensions, vanilla JS
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);