Skip to content

Instantly share code, notes, and snippets.

View ytkang's full-sized avatar
:octocat:

Yountae Kang ytkang

:octocat:
  • nWay
  • Seoul
View GitHub Profile
@ytkang
ytkang / convertJsonToECSTaskDefinition.go
Created September 5, 2019 03:43
[ECS TaskDefinition] convert json to golang sdk object
func makeTaskDefnInput(jsonPath string) *ecs.RegisterTaskDefinitionInput {
var defn ecs.RegisterTaskDefinitionInput
fileBytes, err := ioutil.ReadFile(jsonPath)
if err != nil {
log.Println("cannot read task file", err.Error())
return nil
}
err = json.Unmarshal(fileBytes, &defn)
if err != nil {
log.Println("cannot parse task file", err.Error())
// this is golang implementation of python flask secure cookie's create_signed_value, decode_signed_value
// create_signed_value: CreateSecret
// decode_signed_value: DecodeSecret
const (
SECRET = "secret"
SECRET_NAME = "secret"
SECRET_EXPIRE = 60 * 60
)
func TimeIndependentEquals(a, b []byte) bool {
@ytkang
ytkang / mongodbIndexExporter.js
Last active May 6, 2024 08:15
Mongodb Index exporter importer
/*
How to export
* mongo is mongoshell command
mongo dbname --quiet mongodbIndexExporter.js > index.js
*/
let collectionNames = db.getCollectionNames();
let index_data = {'collections': []};
for (let i in collectionNames) {