Skip to content

Instantly share code, notes, and snippets.

(def schema {:kb/parent {:db/type :db.type/ref}
:kb/children {:db/cardinality :db.cardinality/one}})
(def conn
(let [c (d/create-conn schema)
{:keys [tempids]}
(d/transact! c
[{:db/id -1
:title "Intermediate"
:tags #{:level}}
JetIssues
Loading*
loaded -> Ok
load error -> LoadError
Issues
Ok
WithError
WithLoader
loaded -> Ok
load error -> WithError
@prepor
prepor / keybase.md
Last active November 26, 2018 10:47

Keybase proof

I hereby claim:

  • I am prepor on github.
  • I am prepor (https://keybase.io/prepor) on keybase.
  • I have a public key ASCAbQNQu9q1W0a75dB2O1UARIqBG9XPE2PnDwnXmXZB5wo

To claim this, I am signing this object:

open Base
open With_return
type node = { value: int; left: node option; right: node option }
let is_bst tree=
with_return (fun r ->
let rec tick = function
| { value; left = None; right = None} -> (value, value)
| { value; left = Some l; right = None} ->
open Base
open With_return
type node = { value: int; left: node option; right: node option }
let is_bst tree=
with_return (fun r ->
let rec tick = function
| { value; left = None; right = None} -> value
| { value; left = Some l; right = None} ->
open Base
let max_population intervals =
let t = Hashtbl.create (module Int) in
List.iter intervals (fun (birth, dead) ->
Hashtbl.update t birth (function | None -> 1 | Some i -> i + 1);
Hashtbl.update t dead (function | None -> -1 | Some i -> i - 1));
let years = List.sort ~compare:Int.compare (Hashtbl.keys t) in
let max = ref 0 in
let current = ref 0 in
refer from core ((=))
def Ref(init) =
val v = `core.make-ref`(init)
def read() =
`core.deref`(v)
def write(x) =
`core.set`(v, x)
{. read = read, write = write .}
(defconst mine-packages
'(smartparens))
(defun mine/post-init-smartparens ()
(require 'smartparens-config)
(add-hook 'minibuffer-setup-hook 'turn-on-smartparens-strict-mode)
;;;;;;;;;;;;;;;;;;;;;;;;
(defun mine/post-init-smartparens ()
(require 'smartparens-config)
(add-hook 'minibuffer-setup-hook 'turn-on-smartparens-strict-mode)
;;;;;;;;;;;;;;;;;;;;;;;;
;; keybinding management
(define-key smartparens-mode-map (kbd "C-M-f") 'sp-forward-sexp)
(define-key smartparens-mode-map (kbd "C-M-b") 'sp-backward-sexp)
(defun mine/post-init-smartparens ()
(require 'smartparens-config)
(add-hook 'minibuffer-setup-hook 'turn-on-smartparens-strict-mode)
;;;;;;;;;;;;;;;;;;;;;;;;
;; keybinding management
(define-key smartparens-mode-map (kbd "C-M-f") 'sp-forward-sexp)
(define-key smartparens-mode-map (kbd "C-M-b") 'sp-backward-sexp)