Skip to content

Instantly share code, notes, and snippets.

View mavbozo's full-sized avatar

Maverick Bozo mavbozo

View GitHub Profile
;; auto set updated_at for postgres
CREATE OR REPLACE FUNCTION trigger_set_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
@mavbozo
mavbozo / datomic-entity-history.clj
Created November 15, 2019 04:46 — forked from pesterhazy/datomic-entity-history.clj
Inspect a datomic entity's history
;; Show history of an entity
;;
;; useful for interactively inspecting what happened to a datomic entity in its lifetime
;;
;; use `entity-history` to get a list of transactions that have touched the entity (assertions, retractions)
;;
;; use `explain-tx` to find out what else was transacted in the txs
(defn entity-history
"Takes an entity and shows all the transactions that touched this entity.
@mavbozo
mavbozo / install-jdk-webfaction.sh
Last active April 11, 2016 18:25
install jdk 8u66-b17 webfaction
#!/bin/bash
#jdk version 8u77-b03
# jdk tar is in ~/installer dir
# jdk install is in ~/program-files
jdk_version=1.8.0_77
jdk_ver=8u77
jdk_suffix=b03
jdk_tar=jdk-$jdk_ver-linux-x64.tar.gz
;;; xah-fly-keys.el --- A efficient modal keybinding set minor mode based on ergonomics.
;; Copyright © 2013-2015, by Xah Lee
;; Author: Xah Lee ( http://xahlee.org/ )
;; Version: 2.1.8
;; Created: 10 Sep 2013
;; Keywords: convenience, emulations, vim, ergoemacs
;; Homepage: http://ergoemacs.org/misc/ergoemacs_vi_mode.html
@mavbozo
mavbozo / jwp-sig.clj
Created October 6, 2015 12:13
generate jwplatform video signature
;; generate jwplatform video signature
;; using clj-time and pandect libraries
(require '[clj-time.core :as ct])
(require '[clj-time.coerce :as ctc])
(require '[pandect.algo.md5 :refer [md5]])
;; set expires to 1 hour / 3600 seconds
(def expires (+ (-> (ct/now) (ctc/to-epoch)) 3600))

Keybase proof

I hereby claim:

  • I am mavbozo on github.
  • I am mavbozo (https://keybase.io/mavbozo) on keybase.
  • I have a public key whose fingerprint is 9CC4 CBA3 4EFD EFF9 3822 70DE 0EE1 76D0 7D4B 07F8

To claim this, I am signing this object:

source: http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer/#comment-287120251
Rich Hickey on becoming a better developer
Avatar
Rich Hickey • 3 years ago
Sorry, I have to disagree with the entire premise here.
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.
@mavbozo
mavbozo / gist:1e295d6248f7578f835a
Created January 29, 2015 12:07
carmine uds benchmark
Benching (this can take some time)
----------------------------------
Lap 1/32...
{:wcar 87, :ping 342, :set 538, :get 555, :roundtrip 700, :ping-pipelined 5673}
Lap 2/32...
{:wcar 37, :ping 469, :set 546, :get 542, :roundtrip 687, :ping-pipelined 5604}
Lap 3/32...
@mavbozo
mavbozo / gist:c14f1939ee45e4553c69
Created January 29, 2015 12:06
carmine port benchmark
Benching (this can take some time)
----------------------------------
Lap 1/32...
{:wcar 411, :ping 560, :set 435, :get 576, :roundtrip 957, :ping-pipelined 6444}
Lap 2/32...
{:wcar 29, :ping 559, :set 583, :get 588, :roundtrip 692, :ping-pipelined 6203}
Lap 3/32...