Skip to content

Instantly share code, notes, and snippets.

View wataruoguchi's full-sized avatar
🦥
Curiosity Driven

Wataru Oguchi wataruoguchi

🦥
Curiosity Driven
View GitHub Profile
// package.json
{
...
"scripts": {
...
"deploy": "aws lambda update-function-code --function-name arn:aws:lambda:us-east-1:000000000000:function:transcode-video --zip-file fileb://Lambda-Deployment.zip",
"predeploy": "zip -r Lambda-Deployment.zip * -x *.zip *.log"
}
...
}
// package.json
{
...
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm run jest"
}
},
"lint-staged": {
// package.json
{
...
"scripts": {
...
"test": "run-local-lambda --file index.js --event tests/event.json",
"jest": "jest",
...
},
...
// __tests__/handler.spec.js
const handler = require('../handler.js');
const event = require('../tests/event.json');
test('correct keys get generated', () => {
handler.handler(event, null, (error, success) => {
expect(error).toBe(null);
expect(success.key).toBe('my video.mp4');
expect(success.sourceKey).toBe('my video.mp4');
expect(success.outputKey).toBe('my video');
})
// handler.js
'use strict';
export handler = function(event, context, callback) {
const key = event.Records[0].s3.object.key;
const sourceKey = decodeURIComponent(key.replace(/\+/g, ' '));
const outputKey = sourceKey.split('.')[0];
const success = { key, sourceKey, outputKey };
const error = null;
callback(error, success);
};
@wataruoguchi
wataruoguchi / EBPM-note-Feb-02-2019
Created March 29, 2019 05:42
EBPM (Evidence Based Policy Making) presented by Sayoko Shimoyama
EBPMの「エビデンス」っていったい何なのか?
エビデンス:再現性を保証するもの
相関と因果。相関関係があっても因果関係がある場合がある
ランダム化比較試験(RCT)
神奈川県葉山町 放置ゴミ削減施策 AB test
3つのランダムなグループにそれぞれ別の施策をした。対策1, 2, 対策なし
結果を比較しやすい。属人性を排除できる。
@wataruoguchi
wataruoguchi / MASTERING_THE_BRAND_PROMISE.md
Created October 21, 2018 08:35
Bookclub Note: Rockefeller Habits - Chapter 9 - MASTERING THE BRAND PROMISE

Chapter 9 - MASTERING THE BRAND PROMISE

Identify the single most important measurable in building value

What really matters to your customers? What is it that brings your customers to you, and keep those customers loyally returning, purchase after purchase, year after year? It's your brand promise.

  • FedEx: 10 a.m. deadline

It was more than a marketing slogan. It was the key decision that drove all others.

@wataruoguchi
wataruoguchi / MASTERING_THE_DAILY_AND_WEEKLY_EXECUTIVE_MEETING.md
Created October 12, 2018 06:01
Bookclub Note: Rockefeller Habits - Chapter 8 - MASTERING THE DAILY AND WEEKLY EXECUTIVE MEETING

Chapter 8 - MASTERING THE DAILY AND WEEKLY EXECUTIVE MEETING

Structure meetings to enhance executive team performance!

The faster you want to grow, the faster you have to pulse.

With these meetings you'll have opportunities to focus your executives on what's important. You'll also solve problems more quickly and easily.

Meetings: A Routine to Set You Free

@wataruoguchi
wataruoguchi / file0.txt
Last active November 9, 2019 01:42
VuexFireでNuxt.jsアプリに一瞬でFirestoreを導入する ref: https://qiita.com/wataruoguchi/items/8fdda8e9754658be06be
<proj>
L src
L plugins
L components
L package.json
L ...
L functions
L public
@wataruoguchi
wataruoguchi / MASTERING_EMPLOYEE_FEEDBACK.md
Created October 5, 2018 06:07
Bookclub Note: Rockefeller Habits - Chapter 7 - MASTERING EMPLOYEE FEEDBACK

Chapter 7 - MASTERING EMPLOYEE FEEDBACK

De-hassle your organization!

Recurrent customer and employee hassles 40% of our time.

It makes people hate their jobs, problems never getting fixed.

It's never just one person's problem. To reduce your costs, shorten your cycle time, and generally improve your internal working environment, you need to systematically gather data on what's hassling your employees.