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 / dln.go
Created February 4, 2015 08:36
dln - prints derivative of line-separated integer series (for use with histograms)
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
@rjeczalik
rjeczalik / hist.go
Created February 4, 2015 09:52
hist - ASCII histograms in terminal, with unicorns
package main
import (
"bufio"
"fmt"
"io"
"os"
"sort"
"strconv"
"strings"
@rjeczalik
rjeczalik / pandagate.go
Created June 5, 2015 13:39
Panda Gate - signing proxy for Panda API
// +build ignore
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"flag"
"fmt"
@rjeczalik
rjeczalik / rand.go
Last active August 29, 2015 14:25
rand helper
package main
import (
"crypto/sha256"
"encoding/hex"
"flag"
"fmt"
"math"
"math/rand"
"os"
@rjeczalik
rjeczalik / jq.go
Last active September 11, 2015 12:17
package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
@rjeczalik
rjeczalik / migrate-dies
Last active September 27, 2015 13:21
Migrate your app from DEIS to Build.io
#!/bin/bash
# Copyright (c) 2015 Build.io. All rights reserved.
set -euo pipefail
APP_NAME=
REPO=
BRANCH=
DEIS_NAME=
@rjeczalik
rjeczalik / dataserver.go
Last active September 20, 2015 10:58
drop-in file server for go-bindata
package main
import (
"bytes"
"net/http"
"os"
)
type file struct {
name string
@rjeczalik
rjeczalik / gcr-tags.go
Last active October 4, 2018 11:37
Reads a tag list for Google Container Registry for the given image.
package main
import (
"encoding/json"
"flag"
"fmt"
"net/url"
"os"
"os/user"
"path/filepath"
@rjeczalik
rjeczalik / boolmap.go
Last active September 27, 2015 21:17
BoolMap
package boolmap
// BoolMap is a data structure for storing binary
// states of elements indexed by non-negative
// integer key.
type BoolMap []byte
// New gives new bool map capable of storing state for
// n elements without growing.
func New(n int) BoolMap {
@rjeczalik
rjeczalik / qwatch.go
Last active January 13, 2019 00:46
queued watch
package main
import (
"log"
"os"
"sync"
"github.com/rjeczalik/notify"
)