Skip to content

Instantly share code, notes, and snippets.

@JulianG
JulianG / introducing-bananatabs.md
Last active February 18, 2019 12:31
Introducing Banana Tabs!

Introducing Banana Tabs!

Has this ever happened to you?

You keep lots of tabs in a single window to the point where you can't tell what's what anymore.

too many tabs

Or worse: you try -like me- to group your tabs by task, or subject, or anything, and as a result you end up with too many windows instead:

@jrencz
jrencz / q-race.es6
Last active May 7, 2018 08:58
Quick attempt to add spec-compliant race method to Angular $q
(function () {
'use strict';
angular
.module('q.race', [])
.config(function ($provide) {
$provide.decorator('$q', function ($delegate) {
$delegate.race = promises => $delegate((resolve, reject) => {
const bind = promise => {
@pc035860
pc035860 / async-chunk-queued.js
Created December 28, 2013 10:54
Chunked Executions Need "setImmediate" and "Promise"
// async version of timedChunk plus queued by robin
function asyncChunkQueued(items, process, context, callback) {
var todo = items.concat(), //create a clone of the original
i = 0, // index counter
dfd = $.Deferred(),
routine = function () {
process.call(context, todo.shift(), i++)
.then(function () {
if (todo.length > 0) {
_setImmediate(routine);
@stephen-james
stephen-james / rasterizeElement.js
Last active December 11, 2015 03:48
A helper script for use with phantomJS (http://phantomjs.org/) similar to rasterize.js allowing you to rasterize elements of a web page by specifying a selector.
/*
rasterizeElement.js
This file is a helper script for use with phantomJS (http://phantomjs.org/) similar to rasterize.js
allowing you to rasterize elements of a web page by specifying a selector.
Author - Stephen James
Twitter - @stephenhjames
GitHub - https://github.com/stephen-james
@eduardocereto
eduardocereto / gist:2312353
Created April 5, 2012 16:29 — forked from anonymous/gist:2309745
Track Client-Side Errors with Google Analytics
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);
_gaq.push(['_setDomainName', 'yoursite.com']);
_gaq.push(['_addIgnoredRef', 'yoursite.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@millermedeiros
millermedeiros / gist:882682
Created March 23, 2011 05:47
RequireJS Async Load Plugin
/*!
* RequireJS plugin for async dependency load like JSONP and Google Maps
* @author Miller Medeiros
* @version 0.0.1 (2011/03/23)
* Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
define(function(){
function injectScript(src){
var s, t;