What's the difference between val
and var
?
- A
val
variable can not have it's value changed, but avar
variable can.
What's the deal with implicit val
?
[core] | |
editor = vim | |
[diff] | |
tool = kompare | |
[difftool] | |
prompt = false | |
[color] | |
ui = true | |
branch = auto | |
diff = auto |
#!/usr/bin/env bash | |
. /etc/init.d/functions | |
declare -a env_variables=(FOO BAR) | |
function checkVariables { | |
for var in "${env_variables[@]}" | |
do | |
if env | grep -q ^"$var=" |
I hereby claim:
To claim this, I am signing this object:
// original: https://slack-files.com/T029RQSE6-F02ATJ4RW-75d559 | |
func (h *corsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS") | |
w.Header().Set("Access-Control-Allow-Origin", "*") | |
w.Header().Set("Access-Control-Allow-Headers", "*") | |
if r.Method == "OPTIONS" { | |
fmt.Fprint(w) | |
return | |
} |
At DockerCon 2014, Solomon Hykes presented a keynote that discussed the future of Docker. One topic of discussion was orchestration, in which he showed a slide that listed a bunch of projects that have come up around this problem:
alias ll='ls -alh' | |
alias gcm='git commit -m' | |
alias gp='git push origin $(git_full_branch_name)' | |
alias ga='git diff --check && git add' |
# docker run --rm -it -v /Users/craig/projects/cadvisor:/cadvisor centos /bin/bash | |
yum install -y golang git mercurial | |
mkdir -p /code/{bin,pkg,src} | |
cd /code | |
export GOPATH=$(pwd) | |
export PATH=$PATH:$GOPATH/bin | |
# install godep and cover |
# Host A | |
docker0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 | |
inet addr:10.100.64.1 Bcast:0.0.0.0 Mask:255.255.255.0 | |
flannel.1 Link encap:Ethernet HWaddr <some stuff> | |
inet addr:10.100.64.0 Bcast:0.0.0.0 Mask:255.255.0.0 | |
# Host B | |
docker0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 | |
inet addr:10.100.7.1 Bcast:0.0.0.0 Mask:255.255.255.0 |
package main | |
import ( | |
"encoding/base64" | |
"net/http" | |
"strings" | |
) | |
type handler func(w http.ResponseWriter, r *http.Request) |