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
#!/bin/bash | |
USER="foo" | |
PASS="bar" | |
AUTHDB="someDb" | |
mongo $1 -u $USER -p $PASS --authenticationDatabase $AUTHDB |
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
package main | |
import ( | |
"bytes" | |
"encoding/xml" | |
"fmt" | |
) | |
const ( | |
book = `<?xml version="1.0" encoding="UTF-8"?> |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
// So ungefähr | |
type Contrib struct { |
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
package main | |
import ( | |
"os" | |
"io/ioutil" | |
) | |
// FileReadable returns true only if path is readable. | |
func FileReadable(path string) bool { | |
fi, err := os.Stat(path) |
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
package main | |
import ( | |
"fmt" | |
"golang.org/x/crypto/bcrypt" | |
) | |
func main() { | |
pwd := []byte("password") | |
fmt.Println("Generating hashes...") |
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
{ | |
"_id":"$objectid", | |
"name": { "$choose" : { "from" : [ "Foo", "Bar", "Baz", "Blarg", "Blubb" ] } }, | |
"categoriesIds": { | |
"$array":{ | |
"of":{ | |
"$number" : {"min" : 1, "max" : 1000 } | |
}, | |
"number":{ | |
"$number" : {"min" : 1, "max" : 100 } |
NewerOlder