Skip to content

Instantly share code, notes, and snippets.

View tempor1s's full-sized avatar
πŸ™‚

Ben Lafferty tempor1s

πŸ™‚
View GitHub Profile
@tempor1s
tempor1s / bktree_struts.rs
Created May 13, 2020 08:11
BKTree Structure with Node
pub struct BKTree<K, V>
where
K: Distance,
{
root: Option<BKTreeNode<K, V>>,
}
struct BKTreeNode<K, V>
where
K: Distance,
fn osa_distance(a: &str, b: &str) -> usize {
let a_len = a.chars().count();
let b_len = b.chars().count();
if a == b {
return 0;
} else if a_len == 0 {
return b_len;
} else if b_len == 0 {
return a_len;

Keybase proof

I hereby claim:

  • I am tempor1s on github.
  • I am temporis (https://keybase.io/temporis) on keybase.
  • I have a public key ASBTsrq8IYDDFcef5omeg6ewbyf4TMevA2X1MuZhB4egxgo

To claim this, I am signing this object:

docker run --rm --privileged \
-v $PWD:/go/src/github.com/<github_username>/<github_repo> \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/<github_username>/<github_repo> \
-e GITHUB_TOKEN='YOURGITHUBTOKENHERE'
mailchain/goreleaser-xcgo goreleaser --rm-dist
@tempor1s
tempor1s / .goreleaser.yml
Last active September 3, 2022 11:48
GoReleaser homebrew configuration
# Seperate repo that you need to create before you deploy.
brews:
- github:
owner: <github_username>
name: homebrew-<repo_name>
folder: Formula
homepage: https://github.com/<github_username>/<repo_name>
description: A simple description of your application.
# Same repo deployment
@tempor1s
tempor1s / .goreleaser.yml
Last active February 28, 2020 18:17
My default GoReleaser config file.
# set environment variables to be used in the build process
env:
# enable GO111Modules if you are using Go1.11 modules in your project for dependency management
- GO111MODULE=on
# Disable CGO - We will go more into this later
- CGO_ENABLED=0
# before are hooks that will be run before any builds are done, so good to put install scripts and stuff that your builds need here
before:
hooks:
# Remove unused packaged from the build process
@tempor1s
tempor1s / goreleaser_install.sh
Last active February 28, 2020 18:15
GoReleaser Installation
# Homebrew Tap - Use this one ideally!
brew install goreleaser/tap/goreleaser
# Homebrew main build - may not be latest version
brew install goreleaser
# Linux Snapcraft - Untested by me
sudo snap install --classic goreleaser
# Windows Scoop - Untested
@tempor1s
tempor1s / πŸ“Š Weekly development breakdown
Last active July 26, 2020 20:45
πŸ“Š Weekly Coding Stats
TypeScript 8 hrs 26 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž 96.8%
Other 13 mins β–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.5%
JSON 3 mins β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0.6%
Git Config 0 secs β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0.0%