Deployed to
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
<script src="/bower_components/webcomponentsjs/webcomponents.js"></script> | |
<!-- added the following script after importing webcomponents.js because Twitter | |
widgets call matches.apply(<something other than an element>) . Without it | |
the error "Can only call Element.matches on instances of Element" when trying | |
to embed a tweet on iOS Safari. | |
--> | |
<script> | |
Element.prototype._matches = Element.prototype.matches | |
Element.prototype.matches = function(element){ | |
if(!(this instanceof 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
(function(){ | |
var lang = function(term){ | |
//todo other languages | |
return term; | |
} | |
Date.prototype.ago = function(){ | |
var now = new Date(); | |
var diff = (now - this)/1000; |
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 httpProxy = require('http-proxy') | |
var fs = require('fs'); | |
var proxy = httpProxy.createProxy({ | |
ws : true, | |
}); | |
var ssl = { | |
key: fs.readFileSync('server_nopass.key', 'utf8'), | |
cert: fs.readFileSync('server.crt', 'utf8') |
#SSH Tunnel, Upstart, Launchd, and BTSyncで手ぶらで帰れるようになった
##問題:会社はマシンを支給してくれないので毎日自分のMacbook Proをオフィスに運ばないといけない。家でも作業したいけど、MBP思いし、途中で落としちゃったりすると大惨事になる
##解決:初号機をSSH TunnelでWeb Facing Computer経由でどこからでもアクセスできるようにして会社に置いとく。電源が入ってれば零号機(家にあるMacbook Pro)からアクセスできる。電源が入ってないと何もできないのでBTSyncで常に同期する。
###Step 1 - Setup SSH Tunnel
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/bash | |
sudo apt-get update | |
sudo apt-get install python-software-properties python g++ make git -y # install dependencies with -y to avoid prompt | |
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh # get the node.js install script | |
source ~/.nvm/nvm.sh | |
[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM without having to restart your console | |
nvm install 0.10 | |
nvm use 0.10 | |
nvm alias default 0.10 | |
source ~/.profile |
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
@grey: #ccc; | |
.retina-border-left(@color : @grey){ | |
background-image: linear-gradient(90deg, @color, @color 50%, transparent 50%); | |
background-size: 1px 100%; | |
background-repeat: no-repeat; | |
background-position: left; | |
} | |
.retina-border-right(@color : @grey){ | |
background-image: linear-gradient(90deg, transparent 50%, @color 50%, @color); |
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 httpProxy = require('http-proxy') | |
var proxy = httpProxy.createProxy({ | |
ws : true | |
}); | |
var options = { | |
'herp.dev': 'http://0.0.0.0:9008', | |
'derp.dev' : 'http://0.0.0.0:3000' | |
} |
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 success_count = 0; | |
var trial_count = 1000000; //とりあえず1000000回繰り返す | |
var unique_sticker_count = 22; //22種のシール | |
var purchase_count = 40; //40枚買った | |
for(var i = 0; i < trial_count; i++){ | |
var collection = []; | |
for(var j = 0; j < purchase_count; j++){ | |
collection.push(Math.floor(Math.random()*unique_sticker_count)); | |
} |