Using the -ldflags parameter can help set variable values at compile time.
Using the example provided here:
- Running
make buildwill create abuildexecutable. Running it will result in:
$> ./build
no version (Mon YYYY)
$>Using the -ldflags parameter can help set variable values at compile time.
Using the example provided here:
make build will create a build executable. Running it will result in:$> ./build
no version (Mon YYYY)
$>| # Get Sudo. | |
| if [ $EUID != 0 ]; then | |
| sudo "$0" "$@" | |
| exit $? | |
| fi | |
| # Install Xcode first - https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 | |
| # Install Xcode command line tools. | |
| xcode-select --install |
| default_platform(:android) | |
| platform :android do | |
| desc "Submit a new QA Build to Crashlytics Beta" | |
| lane :qa do | |
| crashlytics( | |
| api_token: 'CRASHLYTICS_API_TOKEN', | |
| build_secret: 'CRASHLYTICS_BUILD_SECRET', | |
| notes_path: 'qa-change.log', |
apt-get install python-pip
pip install shadowsocks
sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start| minikube start --extra-config=apiserver.authorization-mode=RBAC | |
| kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default | |
| minikube dashboard |
| #!/bin/sh | |
| # install needed curl package | |
| sudo apt install --no-install-recommends curl -y | |
| # install kubectl | |
| curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ | |
| chmod +x /tmp/kubectl && \ | |
| sudo mv /tmp/kubectl /usr/local/bin/kubectl | |
| # kubectl tab completion | |
| sudo sh -c 'echo "source <(kubectl completion bash)" > /etc/bash_completion.d/kubectl' | |
| # install needed packages for kvm (see https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver) |
Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
| package main | |
| import "strconv" | |
| import "fmt" | |
| type Color string | |
| type Make string | |
| type Model string | |
| const ( |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/codegangsta/negroni" | |
| "github.com/gorilla/mux" | |
| "log" | |
| "net/http" | |
| ) |
| import( | |
| "reflect" | |
| "time" | |
| "github.com/gorilla/schema" | |
| ) | |
| func ConvertFormDate(value string) reflect.Value { | |
| s, _ := time.Parse("2006-01-_2", value) | |
| return reflect.ValueOf(s) | |
| } |