- package.json
- lib
- a.js
- lambdas
- index.js
- users
- list.js
- create.js
- node_modules
- 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
var aws = require('aws-sdk') | |
var s3 = new aws.S3() | |
var exec = require('child_process').exec | |
var fs = require('fs') | |
exports.handler = function (event, context) { | |
console.log(JSON.stringify(event, null, 2)) | |
var bucket = event.Records[0].s3.bucket.name; | |
var key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")) ; |
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 config = require('./package.json') | |
var extend = require('xtend') | |
function lambdaUri (args) { | |
var region = 'us-east-1' | |
var accountId = args.accountId | |
var functionName = args.functionName | |
return 'arn:aws:apigateway:' + region + ':lambda:path/2015-03-31/functions/arn:aws:lambda:' + region + ':' + accountId + ':function:' + functionName + '/invocations' | |
} |
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
❯ echo 'I like basketbll' | hunspell | |
Hunspell 1.3.3 | |
* | |
* | |
& basketbll 1 7: basketball | |
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
test.register(function hoge () { | |
}) | |
register = function (name, fn) { | |
function add (name, fn) { | |
Test.prototype[name] = function () { | |
this._assert() | |
return fn() |
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 fs = require('fs') | |
var babel = require('babel-core') | |
var estraverse = require('estraverse-fb') | |
var match = require('escallmatch')('I18n.t(message, [params])') | |
var code = fs.readFileSync(process.argv[2], 'utf8') | |
estraverse.traverse(babel.parse(code), { | |
enter: function (node) { |
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 qwery = require('qwery') | |
var unescape = require('lodash/string/unescape') | |
module.exports = function () { | |
return qwery('script[type="application/json"]').reduce(function (obj, el) { | |
var key = el.getAttribute('data-key') | |
if (key) { | |
try { | |
obj[key] = JSON.parse(unescape(el.textContent)) |
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 embedded = require('embedded-json') | |
var data = embedded() | |
data.foo | |
data.bar |
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
boot2docker-up() { | |
[ "$(boot2docker status)" = "running" ] || boot2docker up | |
} | |
alias docker='boot2docker-up && docker' |
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 type boot2docker > /dev/null 2>&1; then | |
[ "$(boot2docker status)" = "running" ] || boot2docker up | |
fi |