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
inject = (target,injected_modules) -> | |
fs = require 'fs' | |
coffeescript = require 'coffee-script' | |
index = (fs.readFileSync target).toString() | |
index = (index.split('\n').map (x) -> "\t#{x}").join('\n') | |
source = "(require) ->\n#{index}" | |
(coffeescript.eval source) (module) -> | |
injected_modules[module] or require module |
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
# install docker | |
sudo yum install -y docker; sudo service docker start | |
# install git | |
sudo yum install -y git | |
# remote git repo | |
(mkdir -p worktree/.git; cd worktree/.git; git init --bare;) | |
# install nvm |
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 | |
mkdir -p /home/ec2-user/var | |
PID=$(cat /home/ec2-user/var/gitrepo.pid) | |
kill -9 $PID | |
git --work-tree=/home/ec2-user/git-repo checkout -f | |
cd /home/ec2-user/git-repo | |
[ -s "/home/ec2-user/.nvm/nvm.sh" ] && . "/home/ec2-user/.nvm/nvm.sh" # This loads nvm | |
nvm use 0.10.26 | |
nohup coffee app.coffee > /home/ec2-user/var/gitrepo.log 2>&1 & | |
echo $! > /home/ec2-user/var/gitrepo.pid |
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
[ | |
{ | |
"buildImage" : ["web","ssh://[email protected]/redduck/server.git"] | |
}, | |
{ | |
"buildImage" : ["cdn","ssh://[email protected]/redduck/cdn.git"] | |
}, | |
{ | |
"buildImage" : ["devices","ssh://[email protected]/redduck/devices.git"] | |
}, |
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 HOST=$(hostname -f) | |
targets=( zko url_feedback gift mailbox email server_saga server_heart remotelog cdn user eventbus db router gateway nginx devices server ) | |
for target in ${targets[@]}; do ((echo $target) && ([ -d $target ] && cd $target && git pull) || (git clone ssh://[email protected]/redduck/$target.git) && (test $(docker images | grep $target | grep $(cd $target; git rev-parse HEAD) | wc -l) -eq 0) && docker build -t $target $target && docker tag $target $target:$(cd $target; git rev-parse HEAD)); done | |
# zookeeper | |
docker run -d --name zk -p 2181:2181 -p 2888:2888 -p 3888:3888 jplock/zookeeper | |
# redis |
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
sudo apt-get install -y unzip | |
curl -OL https://dl.bintray.com/mitchellh/consul/0.2.1_linux_amd64.zip | |
unzip -o * | |
chmod +x consul | |
sudo cp consul /usr/local/bin |
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
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../topeka-elements/topeka-datasource.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<link rel="import" href="../paper-slider/paper-slider.html"> | |
<link rel="import" href="../yt-video/yt-search-video.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<polymer-element name="my-element"> | |
<template> |
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
<link rel="import" href="../paper-slider/paper-slider.html"> | |
<link rel="import" href="../ace-element/ace-element.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<link rel="import" href="../paper-toast/paper-toast.html"> | |
<link rel="import" href="../paper-ripple/paper-ripple.html"> | |
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<polymer-element name="my-element"> |
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 test2 = { | |
"font.size" : 3, | |
"font.family" : "Arial", | |
"text" : "Attr", | |
"some-nice-attr.some-nice-child.some-nice-grand-child" : 3, | |
"some-nice-attr.some-nice-niece" : 4 | |
}; | |
var _ = require('lodash') |
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
// non-latent version | |
function Tokenizer(cb) { | |
var rules = []; | |
var buf = ''; | |
function test(buf) { | |
for (var kk in rules) { | |
var rule = rules[kk]; | |
if (rule[0].test(buf)) return rule; | |
} |