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
node_modules | |
*.swp |
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 downloadFromUrl(url string) { | |
tokens := strings.Split(url, "/") | |
fileName := tokens[len(tokens)-1] | |
fmt.Println("Downloading", url, "to", fileName) | |
// TODO: check file existence first with io.IsExist | |
output, err := os.Create(fileName) | |
if err != nil { | |
fmt.Println("Error while creating", fileName, "-", err) | |
return |
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 HTTPDownload(uri string) ([]byte, error) { | |
fmt.Printf("HTTPDownload From: %s.\n", uri) | |
res, err := http.Get(uri) | |
if err != nil { | |
log.Fatal(err) | |
} | |
defer res.Body.Close() | |
d, err := ioutil.ReadAll(res.Body) | |
if err != nil { | |
log.Fatal(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
func removeDuplicates(elements []string) []string { | |
// Use map to record duplicates as we find them. | |
encountered := map[string]bool{} | |
result := []string{} | |
for v := range elements { | |
if encountered[elements[v]] != true { | |
// Record this element as an encountered element. | |
encountered[elements[v]] = true | |
// Append to result slice. |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
License Key PhpStorm 8 | |
User Name : EMBRACE | |
===== LICENSE BEGIN ===== | |
43136-12042010 | |
00002UsvSON704l"dILe1PVx3y4"B3 | |
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh | |
gd1BebYc5U"6OxDbVsALB4Eb10PW8" | |
===== LICENSE END ===== |