- Always spaces, never tabs
- 2 spaces indents
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
var less = require('less'); | |
exports.translate = function(load) { | |
return less.render(load.source).then(function(output) { | |
return output.css; | |
}); | |
} | |
exports.instantiate = function(load) { | |
load.metadata.format = 'css'; |
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
var each = function(arr, cb){ | |
var i = 0, len = arr.length; | |
for(; i < len; i++) { | |
if(cb(arr[i]) === false) { | |
return; | |
} | |
} | |
}; | |
var baseImport = System.import; |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
- It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
- It is free, with no quotas.
- Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
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
{ | |
"name": "funcunit-dmeo", | |
"version": "0.0.0", | |
"main": "lib/index.js", | |
"license": "ISC", | |
"private": true, | |
"devDependencies": { | |
"mocha": "~1.15.0", | |
"chai": "~1.8.1", | |
"funcunit": "git://github.com/bitovi/funcunit.git#abeedf7e7e75445e0ef6bb82a8cef250664d4c67" |
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
app.post('/login', function(req, res) { | |
console.log(res); | |
passport.authenticate('local', function(err, user) { | |
if (req.xhr) { | |
//thanks @jkevinburton | |
if (err) { return res.json({ error: err.message }); } | |
if (!user) { return res.json({error : "Invalid Login"}); } | |
req.login(user, {}, function(err) { | |
if (err) { return res.json({error:err}); } | |
return res.json( |
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
var locomotive = require('locomotive'), | |
env = process.env.NODE_ENV || 'development', | |
port = process.env.PORT || 3000, | |
address = '0.0.0.0'; | |
locomotive.boot(__dirname, env, function(err, server) { | |
if (err) { throw err; } | |
server.listen(port, address, function() { | |
var addr = this.address(); | |
console.log('listening on %s:%d', addr.address, addr.port); |
NewerOlder