Skip to content

Instantly share code, notes, and snippets.

View klaascuvelier's full-sized avatar

Klaas Cuvelier klaascuvelier

View GitHub Profile
@klaascuvelier
klaascuvelier / typeCheck.js
Last active December 23, 2015 08:29
Type check for JavaScript objects. Based on code from @jonbretman's slides from JsConf (https://speakerdeck.com/jonbretman/ask-not-what-javascript-can-do-for-you, slide 25) Fix for non-isNaN types.
var toString = Object.prototype.toString,
regex = /\[object (.*?)\]/,
type = function (o) {
var match, typeMatch;
// Special case for DOM elements
if (o && o.nodeType === 1) {
return 'element';
}
@klaascuvelier
klaascuvelier / $q-all-spread.js
Last active August 29, 2015 14:08
Add spread method to $q.all promise
angular
.module('$q-spread', [])
.config(function ($provide) {
$provide.decorator('$q', function ($delegate) {
var originalAll = $delegate.all;
$delegate.all = function (promises) {
var promise = originalAll(promises);
@klaascuvelier
klaascuvelier / userstyle.css
Created June 4, 2015 22:31
flowdock-userstyle
.bubble.thread {
opacity: 0.65;
}
.bubble.green {
border-color: #9554D2 !important;
color: #9554D2 !important;
fill: #9554D2 !important;
}
@klaascuvelier
klaascuvelier / README.md
Last active January 12, 2016 13:01
Collapse diffs for certain file extensions in a PR

Collapse file diffs for files with a certain exentions. The list of extensions is on the end of gist.