Skip to content

Instantly share code, notes, and snippets.

View mark-rushakoff's full-sized avatar
🙈
I'm not watching GitHub notifications. Contact me directly to get my attention.

Mark Rushakoff mark-rushakoff

🙈
I'm not watching GitHub notifications. Contact me directly to get my attention.
View GitHub Profile
{
"builders": [
{
"type": "qemu",
"iso_url": "http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-amd64.img",
"iso_checksum_url": "http://cloud-images.ubuntu.com/releases/bionic/release/SHA256SUMS",
"iso_checksum_type": "sha256",
"disk_image": true,
"disk_size": 5120,
"disk_interface": "virtio-scsi",
@mark-rushakoff
mark-rushakoff / old_tendermint_links.md
Last active August 5, 2022 13:35
Outdated links in tendermint
@mark-rushakoff
mark-rushakoff / mark-rushakoff_work.json
Last active November 16, 2020 13:34
My Planck Keymap
{
"version": 1,
"notes": "Planck Work Map v1",
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "planck/rev6",
"keymap": "mark-rushakoff_work",
"layout": "LAYOUT_ortho_4x12",
"layers": [
[
"KC_ESC",
@mark-rushakoff
mark-rushakoff / gist:d84957d47ebbdfabaafbfdf9e476bef7
Last active September 16, 2020 20:06
List all imports of your project, by count
go list -json ./... | jq -r '.Imports | map(select(contains("."))) | join("\n")' | sort | uniq -c | sort -n
@mark-rushakoff
mark-rushakoff / gist:65d587799de9f3f353055333ed907807
Created September 15, 2020 15:36
Find packages that are declared in your project but not referenced anywhere
go list -test ./... | sort -u > /tmp/full_list_with_tests
go list -test -json ./... | jq -r '.Deps | map(select(startswith("github.com/YOUR/PROJECT/"))) | join("\n")' | sort -u > /tmp/is_depended_with_tests
comm -23 /tmp/full_list_with_tests /tmp/is_depended_with_tests | grep -v '.test$'
@mark-rushakoff
mark-rushakoff / trimpkg.go
Created September 19, 2019 17:25
Print out all the files required to build a single Go package.
package main
import (
"fmt"
"os"
"golang.org/x/tools/go/packages"
)
func main() {
@mark-rushakoff
mark-rushakoff / backup_restore.bash
Last active November 16, 2020 14:53
Backup and restore influxdb inside Docker
#!/bin/bash
set -e
# Default working directory to current directory, but allow override via WORKDIR environment variable.
WORKDIR=${WORKDIR:-$PWD}
NOW="$(date +%s)"
INFLUXDIR="$WORKDIR/influxdb-$NOW"
BACKUPDIR="$WORKDIR/backup-$NOW"
@mark-rushakoff
mark-rushakoff / fields.go
Created September 1, 2016 16:28
Result parsing for InfluxDB
package resultparser
import (
"encoding/json"
"fmt"
)
// Field is implemented by TimeField, IntField, FloatField, and StringField
type Field interface {
columnIndex([]string) (int, error)
@mark-rushakoff
mark-rushakoff / Dockerfile_client
Created August 18, 2016 04:31
Simple micro-load generator for InfluxDB using docker-compose
FROM alpine:latest
RUN apk add --no-cache \
bash \
curl
COPY ./client.sh /client.sh
CMD ["/client.sh"]
@mark-rushakoff
mark-rushakoff / results.txt
Created December 19, 2015 18:48
Which is faster: `s += str` or `buf.WriteString(str) ... buf.String()`?
PASS
BenchmarkStringConcat-4 2000000 3901 ns/op
BenchmarkByteBuffer-4 10000000 966 ns/op