Skip to content

Instantly share code, notes, and snippets.

View Babbleshack's full-sized avatar
😎

Dominic Lindsay Babbleshack

😎
View GitHub Profile
@Babbleshack
Babbleshack / cockroachdb_client_secure.fish
Created October 1, 2024 09:59
Shell function for accessing cockroachdb via client_secure
function client_secure -d "Starts client secure pod in the current env"
set -l namespace "cockroachdb"
set -l command "bash"
argparse -x c,s h/help n/namespace= c/command= s/sql -- $argv
or begin
echo "Invalid arguments. Use '--help' to see usage information."
return 1
end
@Babbleshack
Babbleshack / gist:58ff864910f9eb648e6a99e2a48f6b09
Created September 18, 2022 21:47
create horizontal legend at bottom of subplot
for ax in fig.axes:
ax.legend().set_visible(False)
fig.tight_layout()
#ncol set number of cols in plot, loc sets location, bbox set offset
fig.gca().legend(bbox_to_anchor = (0, -.4), loc='center', ncol=4).set_visible(True)

Keybase proof

I hereby claim:

  • I am babbleshack on github.
  • I am babbleshack (https://keybase.io/babbleshack) on keybase.
  • I have a public key ASAbpXoeDWFUvO_VjhGWGJ2dyivV82j_juVxIUCygl1IYQo

To claim this, I am signing this object:

@Babbleshack
Babbleshack / pub_keys
Last active November 30, 2018 13:38
Public_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Rl8HZVHVr+dfPGNvAK4Q18MCl2G2V/s8G/aEN/KxcW0kJHLNhMA0HMnCT9uA5jjjR9+SdVdTxlBGxZoB70n1r3+QozmC5OwLaG5wr/vwLuwC7gTPB7Oio1Jx/Z5PDSZoNipaubJYgORF1lJ/Yv9qmhN09Cd5Rfd+rI9UpnaV2NuJ2u2TOVDkr2vodLbDIUc9sTQnJIaZ73XwlyRwgu72wjVrAqYZw69rHT9vqXtmI8jy45knI3mcBRtwu3DtfI/+nzqsXEbU23niN/zztSQAXAUEgbZIEVAbkyN0mOPyjf8roJLqbrWtnxacTN1u8Po3dZ49rzzDpTWBL3KVHPKZ dcrl94@gmail.com
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOVO7L4hxWAavgcjCcbcAHDz4eeakFJLSfAIg0yd4AkzA4rsKsEwaJl6d6TCvXnP6+x8Kf1wRRQTNtQgpXzvMyPhfsH5PYWZIgRJO27OXznkcUofQ+qcF2Q2kRENyC6S9zMLYWZ8DzbVBZT/MC5ZHNpYHzSpZ3uwmKpUSGzYAMOvhLpacsnTFYki4lGyvVaPGhK2e/YRkYjCo+YRdVPj+uYuF31VpNDuTfRmlzmUhKcAqbJsKOWAAsD5q4ZxjXj4wWrU0U7mfG+1uajH7aStrARWKyd7iN7XxhhpW4gWjVDl6wjhTssjAJugrPqwgP4ptVb/G3tZDhXNMOfMGmwsMF3uNMYroufbU/Uce/4HvOdXu1kd93vYop2HDgpXLxLdHMS82qnIEncBOJb1d20IyCdSn9uhSmW/ZWARBF9oYANLpqKcTZDHLh0cGUucHl8XZT1gLjwF2H91murld57SE0AAC8/PkWbnRPac9H8ttn8Yf0sDf04sr6nr5Zl+5skmBrRBTWt0w7rD9cnrYkdEnqKtsFpSLmiDa7CJ+57Sowq06Rwm0OqHjz0KBlGhdVt1AGiBfw9nHSL5
@Babbleshack
Babbleshack / Submodule Readme
Created July 17, 2017 13:08
Submodule Notes
# Git Submodules
A git submodule is simply a git repository referenced from another git repository.
Submodule can be modified independantly of their hosting git repository, including merging, commiting, push and pulling.
## Adding a submodule.
Adding a submodule to a repository is easy, simply run `git add submodule <submodule repository url>`.
This will create two new files:
* .gitmodules
lists all submodules of the current git repository and their git urls.
# Git Submodules
A git submodule is simply a git repository referenced from another git repository.
Submodule can be modified independantly of their hosting git repository, including merging, commiting, push and pulling.
## Adding a submodule.
Adding a submodule to a repository is easy, simply run `git add submodule <submodule repository url>`.
This will create two new files:
* .gitmodules
lists all submodules of the current git repository and their git urls.
@Babbleshack
Babbleshack / Insertion Sort
Created April 28, 2017 14:44
Insertion sort for algo course
from random import randint
vals = list()
saved_vals = list()
"""
Sort Ascending
"""
def sort(values):
for idx, key in enumerate(values[1:]):
#idx = idx - 1
@Babbleshack
Babbleshack / .vimrc
Created April 6, 2017 11:33
My vim config
set nocompatible " be iMproved, required
"filetype off " required see [https://github.com/VundleVim/Vundle.vim/issues/176]
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@Babbleshack
Babbleshack / Write Geoms to Sample Size files
Created December 11, 2016 17:50
Simply writes geom jsons to sample files of size sample size
#!/usr/bin/env python
import json
import os
def loadGeoms(geomsJson):
geomsHolder = json.loads(geomsJson)
geoms = geomsHolder['geonames']
return geoms
@Babbleshack
Babbleshack / ReadUltrasonicData
Last active August 29, 2016 14:25
Arduino takes 5 readings and averages them before writing to serial.
#/usr/bin/python3
"""
Arduino makes 5 readings and averages those readings,
the sensor is able to make 20 readings a second with 20 uS
delay.
This script therefore gets 4 readings a second and draws them to a plot
"""
import serial
from matplotlib import pyplot as plt