Skip to content

Instantly share code, notes, and snippets.

View kyptin's full-sized avatar

Jeff Terrell kyptin

View GitHub Profile
@jacobobryant
jacobobryant / deploy.cljs
Created May 10, 2019 19:31
Script for automating Datomic Cloud Ion push + deploy
#!/usr/bin/planck
(ns deploy.core
(:require [cljs.reader :refer [read-string]]
[planck.shell :as shell]))
(defn sh [& args]
(let [result (apply shell/sh args)]
(if (= 0 (:exit result))
(:out result)
(throw (ex-info (:err result) {})))))
@JanSellner
JanSellner / MeasureTime.py
Last active January 13, 2023 21:57
Measure Time in Python
from timeit import default_timer
class MeasureTime(object):
"""
Easily measure the time of a Python code block.
>>> import time
>>> with MeasureTime() as m:
... time.sleep(1)
Elapsed time: 0 m and 1.00 s
@aconz2
aconz2 / live-reload.sh
Last active November 3, 2022 13:12
simple way to get live reloading browser. Pipe list of filenames that will trigger a refresh (see entr)
#!/usr/bin/env bash
trap 'kill $(jobs -pr) 2>/dev/null' SIGINT SIGTERM EXIT
browser=chromium-browser
python3 -m http.server &
$browser "http://localhost:8000/$1" 2>/dev/null &
browserpid=$!