start new:
tmux
start new with session name:
tmux new -s myname
// Example of using Underscore's _.debounce function | |
// debounce is useful for situations where you get multiple events fired | |
// from one action. For example resize event is sent multiple times when | |
// window is resized | |
var reloadIfResizeChange = _.debounce(function() { | |
window.location.reload(); | |
}, 200); | |
window.addEventListener('resize', reloadIfResizeChange); |
import { EditorState, SelectionState } from 'draft-js'; | |
import getSelectedBlocks from './getSelectedBlocks'; | |
/** | |
* Calls a provided `modifier` function with a selection for each | |
* selected block in the current editor selection. Passes through additional | |
* arguments to the modifier. | |
* | |
* Note: At the moment it will retain the original selection and override |
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Atom if you're running vim mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
/* | |
Another way of splitting a gulpfile into multiple files based on: | |
http://macr.ae/article/splitting-gulpfile-multiple-files.html | |
https://github.com/gulpjs/gulp/blob/master/docs/recipes/split-tasks-across-multiple-files.md | |
*/ | |
'use strict'; | |
var gulp = require('gulp'), | |
plugins = require('gulp-load-plugins')(), |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" href="../libs/mocha.css" type="text/css" media="screen" title="no title" charset="utf-8"> | |
</head> | |
<body> | |
<div id="mocha"></div> | |
<script src="../libs/mocha.js" type="text/javascript" charset="utf-8"></script> |
/* jQuery plugin textselect | |
* version: 1.0 | |
* tested on jQuery 1.3.2, 1.5 | |
* author: josef.moravec@gmail.com, duane.johnson@gmail.com | |
* | |
* usage: | |
* $(function() { | |
* $(document).bind('textselect', function(e) { | |
* Do stuff with e.text | |
* }); |
//Download jquery.js and place it in the build, do not use require-jquery.js | |
//in the build, since each of the build layers just needs almond and not the | |
//full require.js file. | |
//This file is run in nodejs to do the build: node build.js | |
//Load the requirejs optimizer | |
var requirejs = require('./r.js'); | |
//Set up basic config, include config that is | |
//common to all the requirejs.optimize() calls. |
/* | |
* a backwards compatable implementation of postMessage | |
* by Josh Fraser (joshfraser.com) | |
* released under the Apache 2.0 license. | |
* | |
* this code was adapted from Ben Alman's jQuery postMessage code found at: | |
* http://benalman.com/projects/jquery-postmessage-plugin/ | |
* | |
* other inspiration was taken from Luke Shepard's code for Facebook Connect: | |
* http://github.com/facebook/connect-js/blob/master/src/core/xd.js |