(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
{ | |
"name": "my-app", | |
"version": "1.0.0", | |
"description": "My test app", | |
"main": "src/js/index.js", | |
"scripts": { | |
"jshint:dist": "jshint src/js/*.js", | |
"jshint": "npm run jshint:dist", | |
"jscs": "jscs src/*.js", | |
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js", |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
Service Worker - offline support for the web
Progressive apps - high-res icon, splash screen, no URL bar, etc.
var fs = require('fs'), | |
colors = require('colors'), | |
_ = require('underscore'); | |
var log = console.log; | |
var ins = require('util').inspect; | |
var filename = process.argv[2]; | |
if (filename == undefined) { | |
log("filename missing".red); |
initialize: -> | |
@bind 'all', @_trackPageview | |
_trackPageview: -> | |
url = Backbone.history.getFragment() | |
_gaq.push(['_trackPageview', "/#{url}"]) |
const ABORTABLE_ERROR_KEY = '__abortablePromise'; | |
/** | |
* @typedef {Promise.<*>} AbortablePromise | |
* | |
* @property {function} abort Additional method for abort original promise | |
*/ | |
/** | |
* |
// Takes an adjacency list like: | |
// { 1: [2, 3], 2: [1, 3], 3: [2, 1] } | |
function pick(arr) { | |
var idx = (arr.length * Math.random()) | 0; | |
return arr[idx]; | |
} | |
function remove(arr, el){ | |
var idx; |
javascript:(function(){function getRealUrl(l){if(l.indexOf('/url?')<0)return null;var a=document.createElement('a');a.href=l;seg=a.search.replace(/^\?/,'').split('&');for(i=0;i<seg.length;i++){if(!seg[i])continue;s=seg[i].split('=');if(s[0]=='url')return decodeURIComponent(s[1]);}return null;}var real=getRealUrl(location.href);if(real){window.location.href=real;return;};document.addEventListener('click',function(e){for(a=e.target;a;a=a.parentNode){if(a.localName!='a')continue;real=getRealUrl(a.getAttribute('href'));if(real){alert('d');a.setAttribute('href',real);a.removeAttribute('onmousedown');}break;}},false);})(); |