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
// ascending, non-decreasing | |
func BubbleSort(data []int) { | |
for i := 0; i < len(data); i++ { | |
for j := 1; j < len(data)-i; j++ { | |
if data[j] < data[j-1] { | |
data[j], data[j-1] = data[j-1], data[j] | |
} | |
} | |
} |
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
c := make(chan os.Signal) | |
signal.Notify(c, os.Interrupt) | |
go func() { | |
select { | |
case sig := <-c: | |
fmt.Printf("Got %s signal. Aborting...\n", sig) | |
os.Exit(1) | |
} | |
}() |
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 hashAndSalt(pwd []byte) string { | |
hash, err := bcrypt.GenerateFromPassword(pwd, bcrypt.MinCost) | |
if err != nil { | |
log.Println(err) | |
} | |
return string(hash) | |
} | |
func comparePasswords(hashedPassword string, plainPassword []byte) bool { |
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
package main | |
import ( | |
"fmt" | |
"github.com/headzoo/surf" | |
) | |
// const x509UnknownAuthorityError = "Get \"https://digitalmint.exchange/\": x509: certificate signed by unknown authority" |
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
vault operator init -key-shares=3 -key-threshold=2 |
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
yarn create react-app my-app |
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
exec -l $SHELL |
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
rm -rf ios/build/ && kill $(lsof -t -i:8081) && watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ rm -f package-lock.json && npm cache clean --force && rm -rf /tmp/metro-* && npm cache verify && npm install && react-native start --reset-cache && react-native run-ios |
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
gcloud container clusters create circle-ci-cluster --zone us-central1-a --node-locations us-central1-a,us-central1-b,us-central1-f --num-nodes 2 --enable-autoscaling --min-nodes 1 --max-nodes 4 |
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
rails new project-name-here --skip-test --api --database=postgresql |