Skip to content

Instantly share code, notes, and snippets.

(ns org.niskin.micha.update-in-matching
(:require [clojure.core.match :as match]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; misc helpers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn- cartesian-product
"
Example:
(ns daggerml.app.dml.control
(:require
[daggerml.app.ui :refer [deftag]]
[daggerml.cells :refer [cell=]]
[daggerml.ui :as ui]))
(defn FORM
[& args]
(doto (apply ui/FORM args)
(ui/on! :submit #(.preventDefault %))))
(ns daggerml.main
(:require
[daggerml.ui :as u :refer [BODY BUTTON DIV H1 HR IMG P SHADOW-ROOT SLOT
SPAN STYLE deftag]]
[daggerml.cells :as c :refer [cell cell= watch=]]))
(deftag FLAT-BUTTON
[[] [^:default slot1] _]
(SHADOW-ROOT
(STYLE "@import 'css/main.css';:host{display:block;}")
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</layout>
</appender>
#!/usr/bin/env bash
prog=$0
warn() { [ $# -gt 0 ] && echo $prog: "$@" 1>&2; }
abort() { warn "$@"; exit 1; }
usage() {
warn "$@"
cat <<EOT
@micha
micha / lottery.md
Last active February 27, 2020 18:52

Lottery Selection

Overview

  • Broadly speaking a lottery is a game in which the players each receive a number of lottery balls with their name on them. Those balls are placed in a sack. A ball is selected from the sack at random. The winner is the player whose name is on the selected ball.
(ns adzerk.instant-counts-updater.api
(:require
[clj-statsd :as s]
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.string :as string]
[clojure.tools.logging :as log]
[amazonica.aws.s3 :as s3]
[amazonica.aws.sqs :as sqs]
[amazonica.aws.dynamodbv2 :as ddb]
@micha
micha / .vimrc
Created February 20, 2019 22:00
augroup micha
autocmd!
autocmd BufNewFile,BufRead *.cljs.hl,*.boot set filetype=clojure
autocmd BufNewFile,BufRead *.html.hl set filetype=html
autocmd BufNewFile,BufRead *.md set filetype=markdown
autocmd BufWritePost ~/.vimrc so ~/.vimrc
autocmd FileType clojure setlocal lispwords+=doto->>,doto-when,eval,eval-str,page,cell-let,this-as,add-watch,do-watch,elem,alter-var-root,vary-meta,alter-meta!,task-when,specify!,GET,POST,pdoseq,ns+,loop-tpl,for-tpl,if-tpl,cond-tpl,when-tpl,case-tpl,doiter,formula-of,formulet,fdef
autocmd FileType clojure let g:clojure_fuzzy_indent_patterns = ['^with', '^def', '^let', '^-[a-zA-Z]']
autocmd FileType html setlocal foldmethod=indent
augroup END
class BalanceNotification
# @property [Number] The id of the ad
adId: undefined
# @property [Date] The time of the balance the notification correspnds to
time: undefined
# @property [Number] the number of impressions projected to be available for the remainder of the ad
projectedImpressions: undefined
@micha
micha / fff.clj
Last active January 5, 2019 23:39
(let [fig (figure)
cap (figcaption)]
(fig (img :src "http://example.com")
(cap "hello world")))
;;;;;
(defelem fancy-list
[_ [& items]]