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
// Save a copy of this request for debugging. | |
requestDump, err := httputil.DumpRequest(r, true) | |
if err != nil { | |
fmt.Println("--->DEBUG ERROR", r.URL, err) | |
} | |
fmt.Println("--->DEBUG BODY", r.URL, string(requestDump)) |
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
for i in $(docker ps -aq); do docker inspect -f '{{.Name}}: IP={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$i"; done | grep <ip-here> |
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 util_test | |
import ( | |
"fmt" | |
"math" | |
"regexp" | |
"strconv" | |
"testing" | |
) |
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
go test -bench=. -memprofile=mem0.out -benchmem -benchtime=5s | |
goos: darwin | |
goarch: amd64 | |
pkg: github.com/InVisionApp/craft-api/util | |
BenchmarkHello/concat-8 300000000 19.8 ns/op 0 B/op 0 allocs/op | |
BenchmarkHello/sprintf-8 50000000 119 ns/op 19 B/op 2 allocs/op | |
PASS |
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
pull_pr() { | |
pr_num=$1 | |
git fetch origin refs/pull/$pr_num/head:pr/$pr_num | |
} |
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
# Simple version using only "find" | |
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |
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
Code move event for unknown code: 0x3c010c699080 | |
Code move event for unknown code: 0x3c010c69b9c0 | |
Code move event for unknown code: 0x3c010c5729a0 | |
Code move event for unknown code: 0x3c010c57daa0 | |
Code move event for unknown code: 0x3c010c5c8f00 | |
Code move event for unknown code: 0x3c010c5d90a0 | |
Statistical profiling result from v8.log, (22371 ticks, 0 unaccounted, 0 excluded). | |
[Shared libraries]: | |
ticks total nonlib name |
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
μ sqlectron/sqlectron-gui master ❯ npm run dist | |
> @ dist /Users/maxcnunes/Development/sqlectron/sqlectron-gui | |
> npm run compile && build --arch all | |
> @ compile /Users/maxcnunes/Development/sqlectron/sqlectron-gui | |
> rimraf app/out && cross-env NODE_ENV=production babel-node scripts/compile.js -v | |
> cleaning old distribution files |
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
brew install dnsmasq | |
mkdir -pv $(brew --prefix)/etc/ | |
echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf | |
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons | |
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
sudo mkdir -v /etc/resolver | |
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev' |
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 connectionURIFromEnvConfig() string { | |
errMsg := "no valid connection string provided" | |
connConfig, err := url.Parse(os.Getenv("DB_PORT")) | |
if err != nil { | |
log.Fatalln(errMsg) | |
} | |
dbHost, dbPort, err := net.SplitHostPort(connConfig.Host) | |
if err != nil { |
NewerOlder