Skip to content

Instantly share code, notes, and snippets.

View MathRobin's full-sized avatar
🌍
<3

Mathieu KIM ROBIN MathRobin

🌍
<3
  • CTO Airporting
  • Pessac, Gironde, France
View GitHub Profile
@wilhelm-murdoch
wilhelm-murdoch / JSONCountries.json
Created December 6, 2010 02:45
Here is a JSON object which contains a list of all countries and their associated abbreviations. Thought others might find this useful.
[
{"US":"United States"},
{"CA":"Canada"},
{"AF":"Afghanistan"},
{"AL":"Albania"},
{"DZ":"Algeria"},
{"DS":"American Samoa"},
{"AD":"Andorra"},
{"AO":"Angola"},
{"AI":"Anguilla"},
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@tobitailor
tobitailor / get_barcode_from_image.js
Created June 1, 2010 19:33
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@steeve85
steeve85 / weesms.py
Created April 12, 2015 20:36
Send and receive SMS Text Messages in Weechat
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import weechat, csv, re, gammu, time, unicodedata
"""
README
======
2015-04-12: v0.1 - Initial/draft/beta version
@dhoko
dhoko / countWatcher.js
Created September 22, 2015 09:42
[Bookmarklet] Debug AngularJS
// Version without jQuery
javascript:(function () { var root = angular.element(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) { if (element.data() && element.data().hasOwnProperty(scopeProperty)) { angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) { watchers.push(watcher); }); } }); angular.forEach(element.children(), function (childElement) { f(angular.element(childElement)); }); }; f(root); var watchersWithoutDuplicates = []; angular.forEach(watchers, function(item) { if(watchersWithoutDuplicates.indexOf(item) < 0) { watchersWithoutDuplicates.push(item); } }); console.log(watchersWithoutDuplicates.length); })();
// Version with jQuery
javascript:(function () { var root = $(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watche
@mxriverlynn
mxriverlynn / 1.js
Last active January 4, 2016 17:39
switch to registry
var employee = someEmployee;
var action = "view";
switch (action) {
case "view":
showEmployee(someEmployee);
break;
case "edit":
editEmployee(someEmployee);
@getify
getify / gist:876d0431352cd68d44a3
Last active August 29, 2015 14:05
Some issues with "JS Loaders" list of "advanced comparisons" (http://mathrobin.github.io/js_loaders/)
  • Load CSS
  • Load CSS without blocking
  • Load CSS in parallel

These 3 seem like unfair comparisons. A "JS Loader" loads JavaScript, that's it. The fact that some also do other things not related to loading JavaScript is not relevant.

Put another way, if you're going to list those 3, why not list these as well:

  • Load Images
  • Load HTML