Skip to content

Instantly share code, notes, and snippets.

View yukin01's full-sized avatar

Yuji Kinjo yukin01

  • Tokyo / Japan
View GitHub Profile
@yukin01
yukin01 / spawn.js
Last active December 14, 2019 16:22
Promisify child_process.spawn
const childProcess = require("child_process");
const spawn = (command, args) => {
return new Promise((resolve, reject) => {
const p = Array.isArray(args)
? childProcess.spawn(command, args, { stdio: "inherit" })
: childProcess.spawn(command, { stdio: "inherit" });
p.on("close", code => resolve(code));
p.on("error", err => reject(err));
});
@yukin01
yukin01 / convert.go
Created May 6, 2020 16:20
Convert json struct to map in Go
import "encoding/json"
func structToMap(s interface{}) map[string]interface{} {
m := make(map[string]interface{})
b, _ := json.Marshal(s)
json.Unmarshal(b, &m)
return m
}
@yukin01
yukin01 / IAMCredentials.json
Created December 20, 2023 16:50 — forked from ServerlessBot/IAMCredentials.json
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",