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
| import System.Environment | |
| import System.Directory | |
| import System.IO | |
| import Data.List | |
| dispatch :: [(String, [String] -> IO ())] | |
| dispatch = [ ("add", add) | |
| , ("view", view) | |
| , ("remove", remove) | |
| , ("bump", bump) |
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 getData(callback) { | |
| setTimeout(function() { | |
| callback(null, Date.now()); | |
| }, 1000); | |
| } | |
| function asyncCallback(generator) { | |
| return function() { | |
| var resolve = function(gen, data) { | |
| var next = gen.next(data); |
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
| gulp.task "test", -> | |
| server = require('./server/server.coffee').listen 9002 | |
| new Promise (resolve, reject) -> | |
| test = spawn 'casperjs', ['test', './test'], | |
| stdio: 'inherit' | |
| test.on 'close', (code) -> | |
| server.close() | |
| return reject(new Error("Tests failed")) unless code is 0 |
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
| #!/usr/bin/env node | |
| var readline = require('readline'); | |
| var actions = [], | |
| actionCount = null; | |
| var debug = function(data) { | |
| require('fs').writeFileSync(Date.now() + '.log', data); | |
| }; |
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
| user.populate 'creators', (err, user) -> | |
| return next err if err? | |
| async.map user.creators, (creator, done) -> | |
| creator.populate 'city', done | |
| , (err, creators) -> | |
| return next err if err? | |
| next response.ok creators |
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
| module.exports = ['$rootScope', 'Restangular', class FooService | |
| constructor: (@$rootScope, @Restangular) -> | |
| $rootScope.on '$foo', -> | |
| # ... | |
| getBars: -> | |
| @Restangular.all('bars').getList() | |
| module.exports = ['$rootScope', 'Restangular', ($rootScope, Restangular) -> | |
| $rootScope.on '$foo', -> |
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
| path = require 'path' | |
| express = require 'express' | |
| bodyParser = require 'body-parser' | |
| app = express() | |
| if app.get('env') in ['development', 'test'] | |
| app.use express.static path.join __dirname, '../', 'public' |
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
| it 'should not be possible for students to edit', (done) -> | |
| options = form: name: 'foobar' | |
| api('test-instance') | |
| .put "groups/#{groupId}", options | |
| .expectStatus 401 | |
| .then done.bind(null, null), done |
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
| { | |
| "all": { | |
| "nickname": "botti", | |
| "username": "botti", | |
| "realName": "botti the bot", | |
| "host": "localhost", | |
| "port": 6667, | |
| "channels": ["#test"], | |
| "database": "ircbot" | |
| }, |
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
| /*jslint node: true */ | |
| 'use strict'; | |
| var _ = require('lodash'); | |
| var config = require('../../config.json'); | |
| var env = process.env.NODE_ENV || 'development'; | |
| module.exports = _.merge({}, config.all, config[env]); |