This file contains hidden or 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
mongodump --host your-hostname --port your-port --ssl --sslAllowInvalidCertificates --db=your-db-name --archive=./ep-ao-dump -u admin -p your-password --authenticationDatabase admin |
This file contains hidden or 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
# start the mongo shell, then set to the appropriate db and create a user | |
# in this case, create a user with dbadmin, and read write access roles | |
use my_db | |
db.createUser( { user: "my_user", pwd: "MyP@ssw0rd", roles: [ { role: "readWrite", db: "my_db"}, { role: "dbAdmin", db: "my_db" } ] }) |
This file contains hidden or 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
// Part of https://github.com/chris-rock/node-crypto-examples | |
// Nodejs encryption with CTR | |
var crypto = require('crypto'), | |
algorithm = 'aes-256-ctr', | |
password = 'd6F3Efeq', | |
key = Buffer.from('5ebe2294ecd0e0f08eab7690d2a6ee69', 'hex'), | |
iv = Buffer.from('26ae5cc854e36b6bdfca366848dea6bb', 'hex'); | |
function encrypt(text){ |
This file contains hidden or 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
cat ~/.aws/config | |
[default] | |
region = us-standard | |
output = json |
This file contains hidden or 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
# formatted as key=value | |
MY_ENV_VAR1=some_value | |
MY_EVV_VAR2=some_value |
This file contains hidden or 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
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Mocha Tests", | |
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", | |
"protocol": "inspector", | |
"args": [ | |
"-u", | |
"tdd", | |
"--timeout", |
This file contains hidden or 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 main() { | |
person := new(Person) | |
person.Name = "Carmine" | |
SavePerson(person).Then(func(obj interface{}) error { | |
fmt.Printf("Successfully created %v\n", obj) | |
return nil | |
}, func(err error) { | |
fmt.Printf("Failed to create %v\n", err) | |
}).Then(func(obj interface{}) error { |
This file contains hidden or 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
function getJSON(url, data) { | |
return Rx.Observable.create(observer => { | |
var canceled = false; | |
if (!canceled) { | |
jQuery.getJSON(url, data). | |
done(data => { | |
observer.onNext(data); | |
observer.onCompleted(); | |
}). | |
fail(err => observer.onError(err)); |
This file contains hidden or 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 Observable = Rx.Observable; | |
Observable.fromObservations = function(obj) { | |
return Observable.create(function forEach(observer) { | |
var handler = changes => observer.onNext(changes); | |
Object.observe(obj, handler); | |
return function dispose() { | |
Object.unobserve(obj, handler); | |
}; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.6/rx.all.js"></script> | |
<meta charset="utf-8"> | |
<title>Test</title> | |
</head> | |
<body> | |
<input id="textbox"> |