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
/* | |
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) { |
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
// 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 { |
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
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()) |