Skip to content

Instantly share code, notes, and snippets.

View kentquirk's full-sized avatar

Kent Quirk kentquirk

View GitHub Profile
@kentquirk
kentquirk / test.js
Created June 28, 2018 03:40
Using Go structs from JS
m = require("./objtest2.js");
h = m.hashobj({
name: "Kent",
address: "Somewhere in Space and Time",
city: "Specificity",
state: "CT"
})
console.log(h.hash.slice(0, 4))
@kentquirk
kentquirk / .bash_profile
Created August 9, 2018 02:10
kent's color prompt
#################################################################
# Here's a bunch of stuff to do prompts that are sensitive to git and svn
# sets the title of the iterm2 window
title()
{
TITLE=$*;
export PROMPT_COMMAND='echo -ne "\033]0;$TITLE\007"'
}
@kentquirk
kentquirk / .bash_profile
Created August 9, 2018 02:27
persistent history
#################################################################
# keep a permanent history of commands typed across all windows.
# This uses the history command to match the part that was typed,
# then uses BASH_REMATCH to extract that part and store it in the
# .persistent_history file. This is run automatically every time
# the prompt is redisplayed.
log_bash_persistent_history() {
[[
$(history 1) =~ ^[[:space:]]*[0-9]+[[:space:]]+(.*)$
@kentquirk
kentquirk / main.go
Created November 17, 2022 22:52
Dynamic sampler fun
package main
import (
"fmt"
"math/rand"
"time"
dynsampler "github.com/honeycombio/dynsampler-go"
)