Skip to content

Instantly share code, notes, and snippets.

var AppConstants = require('../constants/AppConstants.js');
var AppDispatcher = require('../dispatchers/AppDispatcher.js');
var api = require('../utils/api');
var ActionTypes = AppConstants.ActionTypes;
module.exports = {
create_customer: function(data){
api.customer.create(data);
}
/**
* Adapted from https://github.com/Khan/react-components/blob/master/js/timeout-transition-group.jsx
*/
var React = require('react/addons');
var ReactTransitionGroup = React.addons.TransitionGroup;
var Velocity = require('velocity-animate');
var transitions = {
// Forcefeeding: property order = [after, before]
/**
* Adapted from https://github.com/Khan/react-components/blob/master/js/timeout-transition-group.jsx
*/
var React = require('react/addons');
var ReactTransitionGroup = React.addons.TransitionGroup;
var Velocity = require('velocity-animate');
var transitions = {
// Forcefeeding: property order = [after, before]
@randylien
randylien / introrx.md
Last active August 29, 2015 14:07 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Auto deployment script for CI with Git/Node.JS/Forever

Usage

1.Simply add the deploy.sh to your application folder

2.Start your service

deploy.sh start myApp.js
/*timestamp and datacreate
don't forget to set validate columns to ONLY DATA_VALUES for datacreate and timstamp columns
Do not allow to enter not valid data!
I don't know how to do this inside the script.*/
function onEdit(e) {
//########################## SETUP BEGIN ###################################
var dc = 'datacreate'; //set datacreate_column_header
var ts = 'timestamp'; //set timestamp_column_header
// var dc_fontcolor = '#808080'; //set font-color in HEX or CSS mode for datacreate column
// var ts_fontcolor = '#808080'; //set font-color in HEX or CSS mode for timestamp column
fs = require('fs')
cheerio = require('cheerio')
staticFolder = 'static'
imgFolder = 'img'
cssFolder = 'css'
cssRoot = __dirname + '/' + cssFolder
htmlFolder = 'views'
htmlRoot = __dirname + '/../application/' + htmlFolder