Skip to content

Instantly share code, notes, and snippets.

View edthrn's full-sized avatar

ed edthrn

View GitHub Profile
@edthrn
edthrn / pw.sh
Last active November 20, 2019 20:31
Put a password stored in `1password` to clipboard
# Usage: ./pw.sh Github.com
op get item $1 | jq -r '.details.fields[] | select(.designation=="password").value' | xclip -selection c
@edthrn
edthrn / remove-from-git.sh
Created February 10, 2021 20:15
Remove old data from Git repo and Git history
# Taken from https://docs.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository
# Warning:
# --------
# All stashes may be lost!
PATH_TO_REMOVE=big-folder/commited/by/error
# 1. Force Git to process, but not check out, the entire history of every branch and tag
# 2. Remove the specified file, as well as any empty commits generated as a result
@edthrn
edthrn / redis.clj
Created February 20, 2021 16:27 — forked from ragnard/redis.clj
Using Redis for persistent memoization of Clojure functions
(ns util.redis
(:refer-clojure :exclude [memoize])
(:require [taoensso.carmine :as car]))
;; boilerplate stuff that is not in Carmine
(def ^:dynamic ^:private *pool*)
(def ^:dynamic ^:private *spec*)
(defmacro with-redis