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
macro swap { | |
rule { $x and $y } => { | |
var tmp = $x; | |
$x = $y; | |
$y = tmp | |
} | |
} | |
// Let's go! | |
var a = "a", |
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 isNull( str ){ | |
return str === null ? true : false; | |
} |
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 tmpl(text, o){ | |
return text.replace(/({(.+)})/gm, function( exp, conj, innerExp ){ | |
return eval(innerExp); | |
}); | |
} |
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
Security.defineMethod("ifHasUserId", { | |
fetch: [], | |
transform: null, | |
deny: function (type, args, userId, document) { | |
return userId !== arg; | |
} | |
}); |
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
ArgumentsSchema = function(args, schema, extra){ | |
var orderedArgs = {}; | |
for(var arg in args){ | |
for(var field in schema){ | |
if(schema.hasOwnProperty(field)){ | |
if(args[arg].constructor === schema[field]){ | |
orderedArgs[field] = args[arg]; | |
} | |
} |
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
SessionHandler = { | |
_deps: new Tracker.Dependency, | |
get(target, name){ | |
this._deps.depend(); | |
return target[name]; | |
}, | |
set(target, name, value){ | |
target[name] = value; | |
this._deps.changed(); |
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
// @locus: server | |
if(Meteor.isServer){ | |
Tracker.autorun(() => { | |
CollectionObserved.find(); | |
collectAndSaveData(); | |
}); | |
function collectAndSaveData(){ | |
var aggregateData = CollectionObserved.aggregate(...); | |
var aggregateDocId = ...; |
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
if [ ! -d "spacejam" ]; then | |
git clone https://github.com/practicalmeteor/spacejam.git --depth=1 | |
fi | |
cd spacejam/ | |
npm link | |
cd ../ | |
spacejam test-packages ./ |
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
#!/bin/sh | |
for file in `g ls-files`; do | |
mkdir -p $(dirname app/$file) | |
g mv "$file" "app/$file" -f | |
done | |
# Note: also do a normal move for files in .gitignore |
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
export ZSH=/home/gabriel/.oh-my-zsh | |
ZSH_THEME="bureau" | |
plugins=(git bower common-aliases meteor npm node nyan sudo wd) | |
# User configuration | |
alias gfd="g flow feature diff" | |
export PATH="/home/gabriel/.nvm/versions/node/v4.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" | |
# export MANPATH="/usr/local/man:$MANPATH" |