Skip to content

Instantly share code, notes, and snippets.

(use-package posframe)
(use-package mini-frame
:after posframe
:demand
:custom
(mini-frame-show-parameters
(lambda()
(let* ((width 1000)
(height 300)
(ns cauchy-clojure.core
(:require [clojure.core.match :as cm]
[clojure.math.numeric-tower :refer [abs]]))
(defn rat [x]
[:rat x])
(defn rat-val [x]
(second x))
(defun custom/toggle-notes ()
(interactive)
(if (string= "notes.org" (buffer-name (current-buffer)))
(spacemacs/alternate-buffer)
(find-file "~/Dropbox/notes/notes.org")))
(global-set-key [f12] #'custom/toggle-notes )
(ns puppetlabs.puppetdb.scf.storage
"Catalog persistence
Catalogs are persisted in a relational database. Roughly speaking,
the schema looks like this:
* resource_parameters are associated 0 to N catalog_resources (they are
deduped across catalogs). It's possible for a resource_param to exist in the
database, yet not be associated with a catalog. This is done as a
performance optimization.
2017-02-23 13:09:54,814 DEBUG [nREPL-worker-7] [p.t.internal] Initializing lifecycle worker loop.
2017-02-23 13:09:54,816 DEBUG [Hikari connection adder (pool PDBReadPool)] [c.z.h.p.HikariPool] PDBReadPool - Added connection org.postgresql.jdbc.PgConnection@38522fc0
2017-02-23 13:09:54,817 DEBUG [Hikari connection adder (pool PDBWritePool)] [c.z.h.p.HikariPool] PDBWritePool - Added connection org.postgresql.jdbc.PgConnection@aff599e
2017-02-23 13:09:54,821 DEBUG [Hikari connection adder (pool PDBWritePool)] [c.z.h.p.HikariPool] PDBWritePool - Added connection org.postgresql.jdbc.PgConnection@438a6b1
2017-02-23 13:09:54,822 DEBUG [Hikari connection adder (pool PDBReadPool)] [c.z.h.p.HikariPool] PDBReadPool - Added connection org.postgresql.jdbc.PgConnection@3695c6ba
2017-02-23 13:09:54,825 DEBUG [Hikari connection adder (pool PDBWritePool)] [c.z.h.p.HikariPool] PDBWritePool - Added connection org.postgresql.jdbc.PgConnection@732ee
2017-02-23 13:09:54,833 DEBUG [Hikari connection adder (pool PDBWritePool)] [c.z
@mullr
mullr / Vagrantfile
Last active February 21, 2017 19:32
basic pdb setup on oracle linux 7.3
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/ol73"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "4096"
end
(defn shovel [n to xf from type]
(assert (pos? n))
(let [join-chs (->> (range n)
(map (fn [n]
(case type
:blocking (async/thread
(loop []
(when-let [in-val (<!! from)]
(doseq [out-val (sequence xf [in-val])]
(defn ^:skip-wiki encoding-of-spec-impl
"Do not call this directly, use 'encoding-of'"
[inner-pred-form inner-pred
inner->outer-fn outer->inner-fn
gfn]
(let [inner-spec (delay (s/specize* inner-pred inner-pred-form))]
(reify
s/Specize
(specize* [s] s)
(specize* [s _] s)
@mullr
mullr / core_match.clj
Created August 4, 2015 15:33
simplifier-clojure
(ns clj-automated-reasoning.core-match
(:require [clojure.core.match :as cm]))
(defn simplify1 [e]
(cm/match [e]
[(['+ 0 x] :seq)] x
[(['+ x 0] :seq)] x
[(['* x 1] :seq)] x
[(['* 1 x] :seq)] x
[(['* x 0] :seq)] 0
@mullr
mullr / aceyducy.clj
Created January 14, 2015 12:50
The real clojure litmus test
(ns vintage-clojure.aceyducy)
(defn format-card [n]
(cond
(< n 11) (str n)
(= 11 n) "JACK"
(= 12 n) "QUEEN"
(= 13 n) "KING"
(= 14 n) "ACE"))