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" | |
"reflect" | |
) | |
type Animal interface { | |
Move() | |
} |
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
// Use the sliding window method | |
func findAnagrams(full string, anagram string) []int { | |
var ( | |
result []int | |
sample = []rune(full) | |
gram = make(map[rune]int) | |
mirror = make(map[rune]int) | |
) | |
for _, character := range anagram { |
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 ( | |
"crypto/rsa" | |
"encoding/base64" | |
"encoding/binary" | |
"encoding/json" | |
"fmt" | |
"github.com/dgrijalva/jwt-go" | |
"io/ioutil" |
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
### Usage: kong.sh [--no-db] | |
### | |
### - Run kong with an in memory database | |
### kong.sh --no-db | |
### | |
### - Run kong with postgre | |
### kong.sh | |
print_usage() { | |
awk -F'### ' '/^###/ { print $2 }' "$0" |
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 client_test | |
import ( | |
"math" | |
"testing" | |
) | |
func TestUnitClient(t *testing.T) { // go test will hit this method | |
t.Run("Client Test", testClient) | |
} |
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 rune2Index(r rune) int { | |
return int(r) - int('a') | |
} | |
func index2Rune(i int) rune { | |
return rune(i) + 'a' | |
} |
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
cors: | |
whitelist: | |
- https://localhost:3000 | |
- https://marketplug.app | |
alpaca: | |
schedule: | |
start: 9 | |
close: 19 |
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 postgres | |
import ( | |
"database/sql" | |
"github.com/lib/pq" | |
"time" | |
) | |
type TransactionRecord struct { | |
ID string `db:"id"` |
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/sh | |
open -na "GoLand.app" --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
tell application "System Events" | |
keystroke "a" using {command down} | |
delay 0.1 | |
keystroke "c" using {command down} | |
delay 0.1 | |
key code 122 using {command down} -- the F1 key | |
end tell |