Skip to content

Instantly share code, notes, and snippets.

View alonronin's full-sized avatar
:octocat:
Me. Write. Code.

Alon Valadji alonronin

:octocat:
Me. Write. Code.
View GitHub Profile
@benjamingr
benjamingr / gist:0237932cee84712951a2
Last active October 6, 2023 08:31
Promise unhandled rejection tracking global handler hook

Possibly Unhandled Rejection NodeJS Promise Hook

###Unhandled Rejection Tracking

Several promise libraries such as bluebird and when as well as some native promise implementations offer potentially unhandled rejection tracking. This means that the following:

Promise.reject(new Error("err")); // never attach a `catch`
@staltz
staltz / introrx.md
Last active May 11, 2025 22:46
The introduction to Reactive Programming you've been missing
@eyy
eyy / mail.js
Last active December 20, 2015 04:39
send mail with express and sendgrid
/**package
{
"name": "mailson",
"description": "Mailing for kids",
"version": "0.1.0",
"author": {
"name": "Etay Perez",
"email": "[email protected]"
},
"dependencies": {
@mailtruck
mailtruck / colormeter.js
Created April 18, 2012 07:09 — forked from krypton/colormeter.js
Calculate difference in percentage between 2 hex colors
function color_meter(cwith, ccolor) {
if (!cwith && !ccolor) return;
var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith;
var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor;
var _r = parseInt(_cwith.substring(0,2), 16);
var _g = parseInt(_cwith.substring(2,4), 16);
var _b = parseInt(_cwith.substring(4,6), 16);
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}