Skip to content

Instantly share code, notes, and snippets.

View rjeczalik's full-sized avatar
💭
defer sleep()

Rafal Jeczalik rjeczalik

💭
defer sleep()
View GitHub Profile
@rjeczalik
rjeczalik / .travis.yml
Last active August 29, 2015 14:04
CI configuration templates for Go projects
language: go
go:
- 1.3.1
- tip
matrix:
fast_finish: true
env:
@rjeczalik
rjeczalik / README.md
Last active March 31, 2019 20:16
Go, multiple packages and coveralls.io

Go, multiple packages and coveralls.io

Single profile for single Go package

For Go projects that consist of only one package, the following Travis configuration is enough to get started with coveralls.io. You may want to encrypt your $COVERALLS_TOKEN via Travis encryption keys though.

language: go
go:
 - 1.3.1
@rjeczalik
rjeczalik / toggle-turbo
Created September 28, 2014 15:17
Turns Turbo Boost on/off.
#!/usr/env/bash
toggle-turbo() {
if kextstat | grep DisableTurboBoost &>/dev/null; then
for i in {0..6}; do
if sudo kextunload /System/Library/Extensions/DisableTurboBoost.kext &>/dev/null; then
echo "# toggle-turbo: DisableTurboBoost unloaded"
return 0
fi
done
@rjeczalik
rjeczalik / pulsecli-provision.sh
Created September 30, 2014 08:17
Deploying cmd/pulsecli
#!/usr/bin/env bash
GO_VER=1.3.1
PULSE_VER=2.6.19
PULSE_HOST=http://pulse
# Go
apt-get install -y curl git mercurial bison gcc make
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
@rjeczalik
rjeczalik / README.md
Last active August 29, 2015 14:07
max - naive tool for printing maximum floating-point value from given set

Example usage:

~ $ g++ max.cc -o max
~ $ max 10 20 0 0 2 3 1 # reads input from command line
20
~ $ (echo 10; echo 20; echo 0; echo 0; echo 2) | max -i # or from stdin
20
~ $ max -0.3 -0.5 -0.1 -2.3
-0.1000
@rjeczalik
rjeczalik / main.go
Created October 13, 2014 09:10
Socollab - CodeCollaborator client (abandoned, got stuck at encoding GWT-RPC structs in its requests)
package main
import (
"fmt"
"os"
"socollab"
)
const usage = `usage: socollab COMMAND [ARG...]`
@rjeczalik
rjeczalik / main.go
Last active August 29, 2015 14:07
re2match - command line tool matching re2-like regexes on data read from stdin
package main
import (
"bufio"
"fmt"
"os"
"regexp"
)
const usage = "usage: echo TEXT | re2match REGEXP"
@rjeczalik
rjeczalik / gh-gopath
Last active August 29, 2015 14:08
Imports all Go projects from your GitHub account into a GOPATH workspace
#!/bin/bash
# Rafal Jeczalik <[email protected]>
# https://gist.github.com/rjeczalik/db886c79049d83f318e2
type curl 1>/dev/null || exit
type jq 1>/dev/null || exit
die_usage() {
if [ ! -z "${*}" ]; then
@rjeczalik
rjeczalik / main.go
Created November 18, 2014 09:29
go-exec: debugging os/exec with interactive scripts
package main
import (
"fmt"
"os"
"os/exec"
)
func die(v interface{}) {
fmt.Fprintln(os.Stderr, v)
package main
import (
"errors"
"fmt"
"log"
"reflect"
"strconv"
"strings"
)