Skip to content

Instantly share code, notes, and snippets.

@harel
harel / markjump.sh
Created August 10, 2021 21:18
Add to your .bashrc to have mark/jump functionality with autocomplete
##############################################################################
# mark/jump support + completion
# un/mark name : bookmark a directory or remove one (unmark)
# jump name : jump to directory
# marks : show all bookmarks
export MARKPATH=$HOME/bin/.marks
function jump {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function mark {

Keybase proof

I hereby claim:

  • I am harel on github.
  • I am harelmalka (https://keybase.io/harelmalka) on keybase.
  • I have a public key ASDcq_0DEB_cgo1yAxAc2a9VWJ0Syb8tiM_Td5QUpvI6Tgo

To claim this, I am signing this object:

@harel
harel / Python LRU Cache with non hashable inputs
Last active December 5, 2018 02:11
Decorator for using dicts/lists with python LRU Cache
def hashable_lru(func):
cache = lru_cache(maxsize=1024)
def deserialise(value):
try:
return json.loads(value)
except Exception:
return value
def func_with_serialized_params(*args, **kwargs):
Verifying I am +harel on my passcard. https://onename.com/harel