Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am potetm on github.
  • I am potetm (https://keybase.io/potetm) on keybase.
  • I have a public key ASBAQI-AI3PZ2nbT2sqjzoEfrS-HElPwrxfPfnPGU0L-NQo

To claim this, I am signing this object:

Things that programmers don't know but should

(A book that I might eventually write!)

Gary Bernhardt

I imagine each of these chapters being about 2,000 words, making the whole book about the size of a small novel. For comparison, articles in large papers like the New York Times average about 1,200 words. Each topic gets whatever level of detail I can fit into that space. For simple topics, that's a lot of space: I can probably walk through a very basic, but working, implementation of the IP protocol.

@potetm
potetm / post-deploy.md
Last active August 29, 2015 14:23
Post batch datomic sqs deploy
  1. Fix the imports that were in flight when we deployed:
  • Get the job ids from the jobs table for incomplete jobs (these are the import ids that were in flight)
  • On a separate router, stop the router process, and start a repl with JVM_OPTS="-Xmx=25g -Xms=25g lein repl :headless :host 0.0.0.0 :port 1987
  • Make sure analytics-engine.maintenance.imports/get-incomplete-docs-for-import returns empty for each import id
    • If not:
    • Send the doc ids to analytics-engine.maintenance.import/requeue-documents-for-upload
    • Make sure analytics-engine.maintenance.imports/get-incomplete-docs-for-import returns empty
  • Since the import is fully uploaded, it is safe to: (analytics-engine.pipeline/handle-job-complete! {:job-id import-id, :job-type :document-uploader})
@potetm
potetm / jimfs_test.clj
Last active August 29, 2015 14:07
Create a file system from a data structure
(ns clojure-nio.jimfs-test
(:require [clojure.test :refer :all]
[clojure-nio.core :as nio]
[clojure-nio.jimfs :as jimfs]))
(defn existing-file? [path]
(and (nio/exists? path)
(nio/file? path)))
(defn existing-dir? [path]
@potetm
potetm / github-tweaks.css
Last active August 29, 2015 14:06
Tweak my Github with Stylish
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("github.com") {
.container {
width: 97% !important;
}
.pagehead {
margin-left: 40px !important;
}
.gh-header-back {
@potetm
potetm / om_datascript.cljs
Last active August 29, 2015 14:00
Playing with om and datascript
(ns om-datascript
(:require-macros [cljs.core.async.macros :refer [go alt!]])
(:require [cljs.core.async :refer [put! <! >! chan timeout]]
[om.core :as om :include-macros true]
[sablono.core :as html :refer-macros [html]]
[figwheel.client :as fw :include-macros true]
[datascript :as d]))
(enable-console-print!)
@potetm
potetm / gist:5396920
Last active December 16, 2015 07:09 — forked from pachet/gist:5396904
var
foo = 1,
bar = 2,
baz = 3
;