start new:
tmux
start new with session name:
tmux new -s myname
| // ------------ | |
| // counterStore.js | |
| // ------------ | |
| import { | |
| INCREMENT_COUNTER, | |
| DECREMENT_COUNTER | |
| } from '../constants/ActionTypes'; | |
| const initialState = { counter: 0 }; |
| 'use strict'; | |
| var React = require('react'); | |
| function createAsyncHandler(getHandlerAsync, displayName) { | |
| var Handler = null; | |
| return React.createClass({ | |
| displayName: displayName, |
| function obj(o) { | |
| function F() {} | |
| F.prototype = o; | |
| return new F(); | |
| } | |
| function inheritPrototype(sub, sup) { | |
| var p = obj(sup.prototype); | |
| p.constructor = sub; | |
| sub.prototype = p; |
| { | |
| "estados": [ | |
| { | |
| "sigla": "AC", | |
| "nome": "Acre", | |
| "cidades": [ | |
| "Acrelândia", | |
| "Assis Brasil", | |
| "Brasiléia", | |
| "Bujari", |
| MongoDB provides a Javascript shell. But Javascript is no fun without underscore.js | |
| Turned out its straight forward to use underscore.js while scripting mongodb. | |
| Here are the steps. | |
| 1) Use underscore to write your db script file (say my_commands.js) | |
| E.g: _.each(db.dbname.find().toArray(), function(itm) { ... }) |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| // NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
| { | |
| // Settings | |
| "passfail" : false, // Stop on first error. | |
| "maxerr" : 100, // Maximum error before stopping. | |
| // Predefined globals whom JSHint will ignore. | |
| "browser" : true, // Standard browser globals e.g. `window`, `document`. |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |