... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
# See docs/examples | |
# http://doc.gitlab.com/ce/ci/quick_start/README.html | |
# http://doc.gitlab.com/ce/ci/yaml/README.html | |
# GitLab CI template for Go tests. Note this installs | |
# a new working copy of Go in a non-standard path such | |
# that sudo/root is not needed for the install stage. | |
# note that this particular install-environment stage | |
# is overly verbose in order to debug anything tricky |
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
if test -n $HOME | |
set -l NIX_LINK $HOME/.nix-profile | |
if test ! -L $NIX_LINK | |
echo "creating $NIX_LINK" >&2 | |
set -l _NIX_DEF_LINK /nix/var/nix/profiles/default | |
/nix/store/cdybb3hbbxf6k84c165075y7vkv24vm2-coreutils-8.23/bin/ln -s $_NIX_DEF_LINK $NIX_LINK | |
end | |
set -x PATH $NIX_LINK/bin $NIX_LINK/sbin $PATH |
//usr/bin/env go run $0 "$@"; exit | |
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
fmt.Println("Hello world!") |
package main | |
import ( | |
"code.google.com/p/gcfg" | |
"fmt" | |
r "github.com/dancannon/gorethink" | |
irc "github.com/fluffle/goirc/client" | |
"log" | |
"strings" | |
) |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
# Add this to your ~/.config/fish/config.fish | |
# Syntax: | |
# To just rerun your last command, simply type '!!' | |
# This forked version supports "sudo !!" via two functions. | |
function !! | |
eval $history[1] $argv | |
end function | |
function sudo | |
if test $argv |
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
// path/to/whatever does not exist | |
} | |
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
// path/to/whatever exists | |
} |
#!/bin/bash | |
# Copyright 2014-2016 Renato Alves | |
# distributed under the GPLv3 licence | |
if [ -z "$TASKDIR" ]; then | |
#TODO Look for data location in rc:location instead of assuming ~/.taskrc | |
TASKDIR="$(grep data.location $HOME/.taskrc | cut -d '=' -f 2)" | |
if [[ "$TASKDIR" == "~/"* ]]; then |
WARNING: If you're reading this in 2021 or later, you're likely better served by reading:
(This gist was created in 2013 and targeted the legacy GOPATH mode.)
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"