This file contains hidden or 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
angular.module('myApp3', []) | |
.run(function ($templateCache) { | |
$templateCache.put('myDirective1.html', '<div class="foo"> {{ msg }} </div>'); | |
$templateCache.put('myDirective2.html', '<div class="bar"> {{ msg }} </div>'); | |
}) | |
.service('$myDirective', function () { | |
return function (messageFunction) { | |
function defaultMessageFunction (message) { | |
return 'Our message is: ' + message; |
This file contains hidden or 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
curl -X POST http://localhost:9000/ | |
This file contains hidden or 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'; | |
/* this is placed in the root of your project */ | |
module.exports = { | |
scripts: [ | |
'lib/foo1.js', | |
'lib/*.js', | |
'src/*.js' | |
] |
This file contains hidden or 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
# Good reminder that sometimes we overthink things | |
# First I tried this, obviously it doesn't work because it gets evaluated when you run the command | |
# alias gulp='node --harmony $(which gulp)' | |
# Then I tried this, which works but is sorta long... | |
# alias gulp='node --harmony $(for x ($(which -a gulp)); do; if [ -e $x ]; then echo $x; break; fi; done)' | |
# | |
# Expanded: | |
# for x ($(which -a gulp)) |
This file contains hidden or 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
# Make sure you have the fakes3 gem installed | |
group :test do | |
gem 'fakes3' | |
end |
This file contains hidden or 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'; | |
var pg = require('co-pg')(require('pg')), | |
co = require('co'); | |
var env = process.env.NODE_ENV || 'development', | |
config = require('../config/database')[env], | |
database = config.database; | |
delete config.database; |
This file contains hidden or 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
(function(n,c){ | |
if (c[n] === void 0) { | |
c[n] = function () { | |
c[n].clients.push(this); | |
this._init = [Array.prototype.slice.call(arguments)]; | |
}; | |
c[n].clients = []; | |
var action = function(method){ |
This file contains hidden or 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
var promises = require('./request.promisify'), | |
superagent = require('superagent'), | |
cookies = require('cookies-js'), | |
methods = require('methods'), | |
clientRequest = {} | |
methods.concat('del').forEach(method => { | |
if (superagent[method]) | |
clientRequest[method] = (...args) => { | |
return superagent[method].apply(superagent, args).use(xsrfToken).use(promises) |
This file contains hidden or 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
var React = require('react') | |
var Html = React.createClass({ | |
propTypes: { | |
assets: React.PropTypes.object.isRequired | |
}, | |
render () { | |
var {scripts, styles} = this.props.assets | |
return ( |
This file contains hidden or 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
var cn = require('classnames'), | |
React = require('react/addons'), | |
hotkey = require('react-hotkey'), | |
PureRenderMixin = React.addons.PureRenderMixin | |
var Dialog = React.createClass({ | |
mixins: [ | |
PureRenderMixin, | |
hotkey.Mixin('_handleHotkey') | |
], |