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
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"apigateway:*", | |
"cloudformation:CancelUpdateStack", | |
"cloudformation:ContinueUpdateRollback", | |
"cloudformation:CreateChangeSet", | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", |
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
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 | |
} |
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 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)); | |
}); |
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
import { readFile, writeFile } from 'fs' | |
import { promisify } from 'util' | |
import * as JSZip from 'jszip' | |
const main = async () => { | |
const oldPath = 'old.zip' | |
const oldBuf = await promisify(readFile)(oldPath) | |
const oldZip = await JSZip.loadAsync(oldBuf) | |
const files = oldZip.files |
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 sharp = require('sharp') | |
const path = require('path') | |
const filePath = './image.png' | |
const fileName = path.basename(filePath, path.extname(filePath)) | |
sharp(filePath) | |
.resize(1024, 1024, { | |
fit: sharp.fit.inside, | |
withoutEnlargement: true |
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 inputLines = [String]() | |
while let line = readLine() { | |
inputLines.append(line) | |
} | |
let rows = inputLines.dropFirst() | |
rows.forEach { print($0) } |
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
# vim: syntax=ruby | |
private_lane :custom_slack do |options| | |
ENV["TZ"] = "Asia/Tokyo" | |
slack( | |
message: options.fetch(:message, "No messages"), | |
success: options.fetch(:success, true), | |
slack_url: "hoge", | |
payload: { | |
"Build Date" => Time.new.to_s, |
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
import UIKit | |
protocol Roundable { | |
var cornerRadius: CGFloat { get set } | |
} | |
protocol Borderable { | |
var borderWidth: CGFloat { get set } | |
var borderColor: UIColor? { get set } | |
} | |
protocol Shadowable { |
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
@IBDesignable | |
final class ClipToRoundView: UIView { | |
@IBInspectable | |
var fillColor: UIColor = .white { | |
didSet { | |
shapeLayer.fillColor = fillColor.cgColor | |
} | |
} | |
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
import Foundation | |
import Differentiator | |
struct SingleSectionModel<ItemType: Equatable> { | |
var items: [ItemType] | |
init(items: [ItemType]) { | |
self.items = items | |
} | |
} |
NewerOlder