Skip to content

Instantly share code, notes, and snippets.

View saralilyb's full-sized avatar
🤷‍♀️

Sara Burke saralilyb

🤷‍♀️
View GitHub Profile
@saralilyb
saralilyb / JWT Decode.sh
Created April 22, 2022 23:29 — forked from patro85/JWT Decode.sh
A BBEdit Text Filter script to take textual input and produce decode of JWT tokens.
#!/bin/bash
#
# JWT Decode
# https://gist.github.com/patro85/2a76d16181730989b9b9af6a7ca6cd1e
#
# A BBEdit Text Filter script to take textual input and produce decode of JWT tokens.
# Note: Signature section is ignored. Meant to be used in conjunction with a separate JSON
# formatter.
#
# Installation instructions: Place this file in BBEdit's "Text Filters" folder inside of
/* see here on how to use https://nesslabs.com/roam-research-themes-custom-styling-css */
/* @import url('https://itsjustmath.github.io/roam-css/beau-haan/ref-formatting.css'); */
/* @import url('https://itsjustmath.github.io/roam-css/beau-haan/zettelkasten.css'); */
@import url('https://itsjustmath.github.io/roam-css/beau-haan/colored-lines-colored-bullets.css');
@import url('https://itsjustmath.github.io/roam-css/beau-haan/sticky-headers.css');
/* @import url('https://abhayprasanna.github.io/kanban%20agenda/kanban-agenda.css'); */
@media (prefers-color-scheme: dark) {
html {
@saralilyb
saralilyb / ToggleDarkMode.scpt
Created July 13, 2020 14:35
A simple JavaScript script (JXA) to toggle Dark Mode in macOS
// Toggles dark mode in macOS
pref = Application("System Events").appearancePreferences
pref.darkMode = !pref.darkMode()
function gaborgenhelper(tilt, freq, title, sc, reso, phase, contrast, aspectratio)
if nargin < 4
reso = 400;
phase = 0;
sc = 50.0;
%freq = .07;
%tilt = 0;
contrast = 100.0;
aspectratio = 1.0;
@saralilyb
saralilyb / wordlist-snippet.json
Created September 13, 2018 14:46
Example of wordlist
{
"a-buff_t-fuchsia": [
"p-chestnut_a-buff_t-fuchsia",
"t-fuchsia_a-buff_t-fuchsia",
"s-limegreen_a-buff_t-fuchsia",
"a-buff_p-chestnut_t-fuchsia",
"a-buff_s-lilac",
"i-darkpink_t-fuchsia"
],
"i-darkpink_t-fuchsia": [
@saralilyb
saralilyb / findPath.ts
Created September 12, 2018 15:22
BFS search example
const findPath = (targetNode, startNode = startWord, graph = wordlist ) => {
// source: https://books.google.com/books?id=GSBKDwAAQBAJ&pg=PA187&lpg=PA187&dq=bfs+lodash&source=bl&ots=FmkF1thzTu&sig=XjRtFH5vZH-mSRfIYowlwDdtIzM&hl=en&sa=X&ved=2ahUKEwjol-HZwbXdAhUDNd8KHW81Ao8Q6AEwCHoECAIQAQ#v=onepage&q=bfs%20lodash&f=false
// initialize the path to traverse
let travelledPath = [];
// mark the nodes that need to be visited breadthwise
let nodesToVisit = [];
// mark all visited nodes
@saralilyb
saralilyb / uw-diss-title-page.tex
Last active March 26, 2018 16:55
Title page for a dissertation in LaTeX adhering to UW Madison's title page requirements
% adapted from https://texblog.org/2014/05/08/template-for-latex-phd-thesis-title-page/
% Fits University of Wisconsin's dissertation requirements:
% https://grad.wiscweb.wisc.edu/wp-content/uploads/sites/329/2017/11/new_phd_title_page.pdf
\begin{titlepage}
\thispagestyle{empty}
\begin{fullwidth}
\begin{center}
\centering
% %Thesis title
{\sc{\Large The Incidental Learning\\ of\\ Feature Distributions\\ in\\ Supervised Classification\par}}
@saralilyb
saralilyb / shh.rb
Created March 8, 2018 19:07 — forked from robinsloan/shh.rb
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
@saralilyb
saralilyb / make-iso8601-timestamp.clj
Created February 4, 2018 23:27
makes an iso8601 timestamp using JUST CLOJURE WITHOUT SEVEN THOUSAND LIBRARIES COME ON KIDS LEARN HOW TO USE WHAT YOU HAVE
(defn maketimestamp
"makes iso8601 timestamp manually
(works pre java 8)
from https://stackoverflow.com/questions/3914404/how-to-get-current-moment-in-iso-8601-format-with-date-hour-and-minute"
[]
(let [tz (java.util.TimeZone/getTimeZone "UTC")
df (new java.text.SimpleDateFormat "yyyy-MM-dd'T'HH:mm:ss'Z'")]
(.setTimeZone df tz)
(.format df (new java.util.Date))))
is <- 12/2 # in units on the drawn grid, NOT pixels
relvals <- c(9, 25, 41, 59, 75, 91)
incvals <- c(9, 25, 41, 59, 75, 91)
imagelist <- list()
# loop through and make list of grobs using both
for (r in relvals) {
for (i in incvals) {
strvals <- paste("/Users/jtth/diss/RFCs/", r, "-", i, ".png", sep = "")
grob <- rasterGrob(readPNG(strvals), interpolate = FALSE)
v <- list(img = grob, x = r, y = i)