$ export DEBUG='*' && node your_app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const higherOrderAction = (func) => (...args) => (dispatch, ...props) => { | |
// Do whatever you need. | |
// Call the wrapped action. | |
const call = func(undefined, ...args); | |
// Check if the call returns a function, which means it is an async action | |
if (call && call.constructor && call.call && call.apply) { | |
return call(dispatch, ...props); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExtendableError extends Error { | |
constructor(message) { | |
super(message); | |
this.name = this.constructor.name; | |
this.message = message; | |
if (typeof Error.captureStackTrace === 'function') { | |
Error.captureStackTrace(this, this.constructor); | |
} else { | |
this.stack = (new Error(message)).stack; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# n: the database number | |
# r: repeat command a number of times | |
# | |
redis-cli -n 4 -r 1 flushall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When working with Phystrix-bundle you must supply configuration in config.yml. | |
// Phystrix-Dashboard offers helper classes to serve phystrix metrics but you need to pass a config array with | |
// the config. | |
// Next code shows how you can create a symfony2 controller that passes the phystrix config.yml configuration and | |
// avoids duplications. | |
<?php | |
namespace MyBundle\Controller; |
- Download a given pull request:
- Checkout a file from another branch (overwrite file):
- Recover a deleted file
- Compare files from different commits/branches
- Upload local branch to a remote but into a new branch
- Show files changed on each commit
- How to know which tracks each branch
- How to change the remote branch tracking a local branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/** | |
* Specification base class | |
* @class | |
*/ | |
var Specification = { | |
and: function(spec) { | |
return new AndSpecification(this, spec); | |
}, |