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
| defmodule BM.Mixfile do | |
| use Mix.Project | |
| def project do | |
| [app: :benchmarks, | |
| version: "0.0.1", | |
| elixir: "~> 1.1", | |
| build_embedded: Mix.env == :prod, | |
| start_permanent: Mix.env == :prod, | |
| deps: deps] |
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
| require('babel-register') | |
| require('./src/test') |
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
| // related discussion: https://github.com/strongloop/strong-pm/issues/45 | |
| var _ = require('lodash') | |
| , e = process.env | |
| , join = require('path').join; | |
| var envConfigs = { | |
| development: { | |
| config: { | |
| host: "0.0.0.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
| module.exports = { | |
| Student: [ | |
| {name: 'Bob', email: '[email protected]'}, | |
| {name: 'Susy', email: '[email protected]'} | |
| ] | |
| }; |
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
| require=( | |
| // t = mapping | |
| // n = cache? | |
| // r = entry points? | |
| function e(t,n,r){ | |
| // s = global require | |
| // o = module name | |
| // u = ??? | |
| function s(o,u){ | |
| // can we find it in the cache? |
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 async = require('async'); | |
| Project.afterCreate = function(done) { | |
| var self = this; | |
| function createRelation(rel, next, name) { | |
| self[name].create(rel, next); | |
| }; | |
| objMapAsync(this.__cachedRelations, createRelation, 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
| (defn make-seq [item] | |
| (if (coll? item) | |
| item | |
| (list item))) | |
| (defn flatten-once [items] | |
| (apply concat (map make-seq items))) | |
| (defn flatten-all [items] | |
| (let [res (flatten-once items)] |
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
| $ npm test | |
| > [email protected] test /Users/brandon/Projects/Code/js/stampit | |
| > scripts/test.sh | |
| Running "browserify:dist/stampit.js" (browserify) task | |
| >> Bundled dist/stampit.js | |
| Running "connect:server" (connect) task | |
| Started connect web server on localhost:4445. |
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 mongo = require('mongodb'); | |
| var client = new mongo.Db('test', new mongo.Server('localhost', 27017), {w: 1}); | |
| // connect to DB and insert a record | |
| client.open(function(err) { | |
| client.collection('users', function(err, users) { | |
| users.insert({email: '[email protected]'}, function(err) { | |
| // listen for changes | |
| var stream = users.find().stream(); |
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
| collector = [] | |
| compare = (target) -> | |
| -> | |
| console.log 'in timeout, collector length:', collector.length | |
| for fn, i in collector | |
| console.log "#{i}:", (fn is target) | |
| for i in [1..3] | |
| do (i) -> |