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
(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 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 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: 'bob@foo.com'}, | |
{name: 'Susy', email: 'susy@foo.com'} | |
] | |
}; |
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
// 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 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
".vimrc | |
syntax on | |
set autoindent | |
set smartindent | |
"filetype plugin indent on | |
"set iskeyword+=_,$,@,%,# | |
set noerrorbells | |
set incsearch | |
set list |
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 HaveJson | |
def initialize(selector) | |
@selector = selector | |
end | |
def matches?(json) | |
@json = json | |
return traverse(@json, @selector) | |
end |
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 HaveJson | |
def initialize(selector) | |
@actual = [] | |
@depths = [] | |
@selector = selector | |
@path, @test = selector.split('=') | |
@path = @path.split('/') | |
end | |
def matches?(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
#http://stackoverflow.com/questions/5513558/executing-code-for-every-method-call-in-a-ruby-module | |
module M | |
def self.before(*names) | |
names.each do |name| | |
m = instance_method(name) | |
define_method(name) do |*args, &block| | |
yield | |
m.bind(self).(*args, &block) | |
end |
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
================================================================ | |
# Key | |
<- indicates a dependency | |
-> indicates a result | |
================================================================ | |
# pre-build (all settings default to user dotfile, then factory settings) | |
<- find project root |
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
exports.findParent = findParent = (dir, pred) -> | |
return null if dir == '/' | |
if pred(dir) | |
return dir | |
else | |
upDir = normalize(dir + '/..') | |
return findParent(upDir, pred) | |
end |
OlderNewer