Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Helper script to clean all persistent volumes (PVs) and persistent volume claims (PVCs)
# from a minikube-based environment.
# First let's clean persistent volume claims
# Get the total lines and subtract one for the header
total=$(expr $(kubectl --context minikube get pvc | wc -l) - 1)
@kevsmith
kevsmith / congress_words.md
Last active April 20, 2022 13:43
Analysis of US Congressional bills 2015 - 2021
congress start end pandemic climate women law gay racial racist
114 2015 2017 51 1094 112 50706 10 12 0
115 2017 2019 149 1674 206 56036 14 21 4
116 2019 2021 4699 5538 282 70473 14 86 29
117 2021 2023 3526 7740 355 43873 16 33 19
@kevsmith
kevsmith / flow_timings.txt
Created April 6, 2022 22:32
Flow execution timings
flow_id average_step max_step min_step flow_elapsed
------- ------------ -------- -------- ------------
17846 6.352 8.768 4.125 12.102
17847 6.2 8.785 3.638 12.061
17848 5.816 8.161 3.821 11.458
17849 5.864 8.672 3.918 11.214
17850 6.106 9.118 3.971 12.134
17851 6.148 7.93 3.937 11.346
17852 5.948 8.636 3.879 12.059
17853 5.75 7.814 3.78 11.125
defmodule Addr do
def extract_subnet(addr, mask) when is_binary(addr) and is_binary(mask) do
<<converted_addr::integer-big-size(32)>> = addr
<<converted_mask::integer-big-size(32)>> = mask
subnet = Bitwise.band(converted_addr, converted_mask)
<<octet1::integer-big-size(8), octet2::integer-big-size(8), octet3::integer-big-size(8),
octet4::integer-big-size(8)>> = <<subnet::integer-big-size(32)>>
{octet1, octet2, octet3, octet4}
@kevsmith
kevsmith / resources.md
Last active August 8, 2020 18:57
Elixir & Erlang Resources
@kevsmith
kevsmith / ansible_run.txt
Last active July 7, 2020 21:02
Bootstrapping dev environment w/Ansible
> ansible-playbook playbooks/provision_local_dev.yml
PLAY [Provision Local Dev Environment]
<snip lots of progress output>
included: /Users/kevsmith/experiments/ansible/roles/developer/tasks/setup_darwin.yml for localhost
<snip>
TASK [developer : Install required Homebrew casks]
changed: [localhost] => (item=docker)
changed: [localhost] => (item=podman)
TASK [developer : Install required Homebrew packages]
@kevsmith
kevsmith / git-history-cloc
Created December 30, 2019 17:06
Retrieve historical LOC within a Git repo
> git history-cloc 6
2019-06-30 20f3e2cf16972f9fa1a20e7e936ce9009442bad3 45280
2019-07-31 3eeea800e5230e77de8bba90cf7e5c84dee549fe 47312
2019-08-31 b765ca0d2477b25efd2720fc064162f7cafbcc59 47442
2019-09-30 bcca0795db6d46839021e8d2c51a6f1902a9cc09 48977
2019-10-31 513d85eccdf7131dcfbecd827859414c98e18348 45672
2019-11-30 e6c775cff9359322b0db232dd028cd253c9fd3c0 47877
>
@kevsmith
kevsmith / foo.java
Last active September 27, 2019 19:57
public class Foo {
private RedisConnection _connection;
public void doSomething() {
// get connection from existing pool
// store ref to connection in object state
_connection = RedisConnectionPool.get().checkout();
try {
// write or read data from Redis here
}

Keybase proof

I hereby claim:

  • I am kevsmith on github.
  • I am kevasmith (https://keybase.io/kevasmith) on keybase.
  • I have a public key ASCj7W5E2GFAVvvNab7gG3oyNzgr0CnvQQChGeCIXCX0xAo

To claim this, I am signing this object: