socat -d -d TCP4-LISTEN:15432,fork UNIX-CONNECT:/srv/mongodb-27017.sock
./forward-port-to-socket.sh 15432 /srv/mongodb-27017.sock
package util_test | |
import ( | |
"fmt" | |
"math" | |
"regexp" | |
"strconv" | |
"testing" | |
) |
path_your_folder/* | |
!path_your_folder/.gitkeep | |
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 |
#!/bin/bash | |
SERVER_IP=<MY_SERVER_IP> | |
# copy cloud-config.yml to the server | |
scp cloud-config.yml core@$SERVER_IP:~/ | |
# validate cloud-config file | |
ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml" | |
if [[ $? == "0" ]]; then |
pull_pr() { | |
pr_num=$1 | |
git fetch origin refs/pull/$pr_num/head:pr/$pr_num | |
} |
<FormattedHTMLMessage | |
id="news-publish.not-allowed.html" | |
values={{ emailSupport: support.email }} | |
defaultMessage={"Please contact <a href=\"mailto:{emailSupport}\">support</a>."} /> |
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' |
# setting a new alias | |
git config --global --add alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all" | |
# using the new alias | |
git lol |
# Simple version using only "find" | |
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |