Skip to content

Instantly share code, notes, and snippets.

View jsdt's full-sized avatar

Jeffrey Dallatezza jsdt

View GitHub Profile
@jsdt
jsdt / start_repl.py
Created September 12, 2019 16:44
Python shell
def start_repl():
import code
import readline
import rlcompleter
vars = globals()
vars.update(locals())
readline.set_completer(rlcompleter.Completer(vars).complete)
readline.parse_and_bind("tab: complete")
code.InteractiveConsole(vars).interact()
@jsdt
jsdt / springer-free-maths-books.md
Created December 29, 2015 06:55 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@jsdt
jsdt / tmux.conf
Last active June 2, 2016 23:45
Tmux conf
# To reload this conf, run:
# :source-file ~/.tmux.conf
# or
# $ tmux source-file ~/.tmux.conf
#
# To sync panes:
# :setw synchronize-panes
# this can be followed by on/off
set-option -g default-shell /usr/bin/zsh
@jsdt
jsdt / TimerBasedThrottler.scala
Last active January 4, 2017 19:51
Creates futures that can be used to throttle access to something
import collection.mutable.Queue
import java.util.concurrent.locks.ReentrantLock
import java.util.Timer
import java.util.Date
import java.util.TimerTask
import concurrent.Promise
import concurrent.Future
object TimerBasedThrottler {
lazy val timer: Timer = new Timer(true)