View findSelectors.js
'use strict';
const file = 'some_file.js';
const ignore = [
echo -n "$(git rev-parse --abbrev-ref HEAD)" | pbcopy
View mobile-width-helpers.js
// not for production use
function MobileWidthHelpers () {
this.stringName = stringName;
var ignoreElements = [
function stringName ($el) {
View indefinite_mutation_observer.js
// support multiple browsers
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
var elementId = 'some-id';
// instantiate initial observer
var observer = new MutationObserver(observeIndefinitely(elementId));
observer.observe(document.getElementById(elementId), {
// expensive, only use what's needed of these
attributes: true,
childList: true,
View nodejs-express-request-proxy-response-cookies.js
// where res is the Express res
// where response is the request module response
// assumes Lodash or Underscore is present
function proxyResponseCookies (res, response) {
var setCookie = response.headers['set-cookie'];
if (setCookie) {
_.each(setCookie, function (cookie) {
var name;
var value;

openssl thrown in the callback of a node.js request module request:

error: Error: 140735274562320:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1293:SSL alert number 40

    at SlabBuffer.use (tls.js:235:18)
    at [as _read] (tls.js:455:29)
    at (_stream_readable.js:341:10)
    at EncryptedStream.write [as _write] (tls.js:369:25)
    at doWrite (_stream_writable.js:226:10)
    at writeOrBuffer (_stream_writable.js:216:5)
View routes.js
// Premise:
// Your app interacts with some data resource.
// There is a route registered per resource type.
// After requesting a resource of a certain type, it's possible for the data to be of another type.
// E.g. You're requesting a category from an API but you are served a member of that category
// instead because there is only one member in the category.
// this route catches all incoming category requests
View write.snippet
(function(n,c){require('fs').writeFile('/somePath/'+n+'.html',c);})('${1:c}',${1}); // @test
View todo.sublime-snippet
// @todo
View test.sublime-snippet
// @test