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
var crypto = require('crypto'); | |
var config = require('config'); | |
module.exports = function(app) { | |
app.get('/s3-policy', function(req, res, next) { | |
var data = { | |
'expiration': new Date(+ new Date + 864e5).toISOString(), | |
'conditions': [{ | |
'bucket': config.s3.bucket | |
}, { |
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
function flatten(input) { | |
if (!input) return | |
var output = []; | |
while(input.length) | |
if(input[0] instanceof Array) | |
input.unshift.apply(input, input.shift()) | |
else | |
output.push(input.shift()) | |
return output | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="./react-with-addons.js"></script> | |
<script src="./JSXTransformer.js"></script> | |
</head> | |
<body> | |
<div id="content"></div> | |
<script type="text/jsx"> | |
var Item = React.createClass({ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="./react-with-addons.js"></script> | |
<script src="./JSXTransformer.js"></script> | |
</head> | |
<body> | |
<div id="content"></div> | |
<script type="text/jsx"> | |
var Item = React.createClass({ |
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
useradd -mrU git | |
mkdir /home/git/.ssh | |
chmod 700 /home/git/.ssh | |
cp /root/.ssh/authorized_keys /home/git/.ssh | |
chmod 600 .ssh/authorized_keys | |
chsh -s /usr/bin/git-shell git | |
mkdir /home/git/apps.git | |
cd /home/git/apps.git | |
git init --bare | |
export DEPLOYDIR=/location/of/your/stuff |
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
* { | |
font-size: 12pt !important; | |
font-family: monospace !important; | |
font-weight: normal !important; | |
font-style: normal !important; | |
text-decoration: none !important; | |
color: black !important; | |
cursor: default !important; | |
background: none !important;; | |
width: auto !important; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Proxy</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.2.min.js"></script> | |
<script type="text/javascript" src="js/porthole.min.js"></script> | |
<script type="text/javascript"> | |
var parentDomain = 'PARENTDOMAIN' | |
var windowProxy; | |
window.onload=function(){ |
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
var nodes = document.querySelectorAll('.path .toggleOperation') | |
Array.prototype.slice.apply(nodes).map(function(v){ return v.text }) |
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
var a = [{ value:"4a55eff3-1e0d-4a81-9105-3ddd7521d642", display:"Jamsheer"}, { value:"644838b3-604d-4899-8b78-09e4799f586f", display:"Muhammed"}, { value:"b6ee537a-375c-45bd-b9d4-4dd84a75041d", display:"Ravi"}, { value:"e97339e1-939d-47ab-974c-1b68c9cfb536", display:"Ajmal"}, { value:"a63a6f77-c637-454e-abf2-dfb9b543af6c", display:"Ryan"}]; | |
var b = [{ value:"4a55eff3-1e0d-4a81-9105-3ddd7521d642", display:"Jamsheer", $$hashKey:"008"}, { value:"644838b3-604d-4899-8b78-09e4799f586f", display:"Muhammed", $$hashKey:"009"}, { value:"b6ee537a-375c-45bd-b9d4-4dd84a75041d", display:"Ravi", $$hashKey:"00A"}, { value:"e97339e1-939d-47ab-974c-1b68c9cfb536", display:"Ajmal", $$hashKey:"00B"}]; | |
var onlyInFirst = function(equal, a, b){ | |
return a.filter(function(current){ | |
return b.filter(equal(current)).length == 0 | |
}); | |
} | |
var onlyInFirstMyObject = onlyInFirst.bind(0, function equal(a){ | |
return function(b){ |
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
const equal = (a, b) => a === b | |
const create = (...args) => { | |
const rules = [] | |
const creator = { | |
when(arg, valid, value, definition) { | |
const key = args.indexOf(arg) | |
rules[key] = rules[key] || [] | |
rules[key].push([ (a) => valid(a, value), definition ]) | |
return creator |