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 ( | |
| "context" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "os" | |
| "github.com/dropbox/dropbox-sdk-go-unofficial/dropbox" |
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
| #!/bin/bash | |
| # Set the log file path and backup directory path | |
| LOG_FILE="/var/log/example.log" | |
| BACKUP_DIR="/var/log/backups" | |
| # Create the backup directory if it doesn't exist | |
| if [ ! -d "$BACKUP_DIR" ]; then | |
| mkdir -p "$BACKUP_DIR" | |
| fi |
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
| #!/bin/bash | |
| # MySQL database credentials | |
| USER="username" | |
| PASSWORD="password" | |
| DATABASE="database_name" | |
| # Backup directory | |
| BACKUP_DIR="/path" |
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/go-redis/redis" | |
| ) | |
| var ( | |
| channel = "EXAMPLE" |
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" | |
| "math/rand" | |
| "time" | |
| "github.com/go-redis/redis" | |
| ) |
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
| [alias] | |
| tree = log --graph --decorate --pretty=oneline --abbrev-commit | |
| gam = "!git add -A && git commit -m " | |
| gco = git checkout | |
| gcb = git checkout -b | |
| gpullm = git pull origin master | |
| gpushm = git push -u origin master | |
| gbl = git brach -l | |
| gpusho = git push origin "$(git rev-parse --abbrev-ref HEAD)" | |
| gpullo = git pull origin "$(git rev-parse --abbrev-ref HEAD)" |
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
| export GOPATH=$HOME/Workspace/Go | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin | |
| export ANDROID_HOME=/Users/albertwaruwu/Android | |
| export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools | |
| export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home | |
| export PATH=${JAVA_HOME}/bin:$PATH | |
| export PATH="$PATH:/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin" | |
| code-insiders () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCodeInsiders" --args $* ;} |
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 WordCount(s string) map[string]int{ | |
| result := make(map[string]int) | |
| split := strings.Fields(s) | |
| for _, word := range split { | |
| v, ok := result[word] | |
| hitung:= v | |
| if ok { | |
| hitung+=1 | |
| result[word]= hitung |
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
| version: '3' | |
| services: | |
| db: | |
| image: postgresql | |
| ports: | |
| - "25432:5432" | |
| app: | |
| image: sample-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
| #!/bin/bash | |
| set -e | |
| psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL | |
| CREATE USER docker; | |
| CREATE DATABASE docker; | |
| GRANT ALL PRIVILEGES ON DATABASE docker TO docker; | |
| EOSQL | |
| PGPASSWORD=docker psql -U docker docker < /var/lib/postgresql/sample_db.sql |
NewerOlder