Skip to content

Instantly share code, notes, and snippets.

Avatar
🍕
I like pizza

Adam Moore minikomi

🍕
I like pizza
View GitHub Profile
View letstop.clj
(defmacro let-stop [bindings & body]
(if (some #{'*stop*} bindings)
(let [stopped-bindings
(->> bindings
(take-while #(not= '*stop* %))
vec)
caught-symbols
(->> stopped-bindings
(partition 2)
(map #(vector (keyword (str (first %))) (first %)))
@minikomi
minikomi / lightbulbs.cljs
Created Oct 15, 2021
lightbulbs guessing
View lightbulbs.cljs
(ns lightbulbs.app.core
(:require [reagent.dom :as rdom]
[reagent.core :as r]))
(defn gen-default-state [n]
{:lightbulbs (mapv #(vector % false) (vec (shuffle (range n))))
:snapshots []})
(def state
(r/atom (gen-default-state 8)))
View Keybase.md

Keybase proof

I hereby claim:

  • I am minikomi on github.
  • I am minikomi (https://keybase.io/minikomi) on keybase.
  • I have a public key ASBtI1LN4RscD0BT18FGe1O1YsbfuV06nQUSsNvxMZ-Nbgo

To claim this, I am signing this object:

@minikomi
minikomi / clippings.py
Created Oct 17, 2019
parsing clippings from kindle into json
View clippings.py
quotes = [q.split("\n") for q in txt.split("==========\n")]
import re
from datetime import datetime
import json
re_page = re.compile("- Your Highlight on page ([\d\-]+)")
re_loc = re.compile(".*Location ([\d\-]+)")
re_date = re.compile("Added on (.*[AM|PM])")
View brogue_crash.txt
Process: Brogue [359]
Path: /Applications/Brogue.app/Contents/MacOS/Brogue
Identifier: com.Brogue
Version: 1.7.5 (0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Brogue [359]
User ID: 501
Date/Time: 2019-08-13 20:08:26.626 +0900
View ns-deps.clj
(defn get-dep-graph [src-paths]
(let [src-files
(apply set/union
(map (comp #(ns-find/find-clojure-sources-in-dir %)
io/file)
src-paths))
tracker (ns-file/add-files {} src-files)
dep-graph (tracker ::ns-track/deps)]
dep-graph))
@minikomi
minikomi / __init__.py
Last active Feb 7, 2019
art parties new python app
View __init__.py
#!/usr/bin/env python3
import requests
import pprint
import itertools
from xml.etree import ElementTree
from flask import Flask, render_template, Markup, escape
from jinja2 import evalcontextfilter
import re
import time
View getlife.clj
(ns getlife.core
(:gen-class)
(:require [crouton.html :as html]
[com.rpl.specter :as s]
[clojure.string :as str]
[clojure.data.csv :as csv]
[clojure.java.io :as io]
))
(defn parse-page [n]
@minikomi
minikomi / processing.clj
Last active Jun 12, 2018
Async processing for plumatic.plumbing/graph
View processing.clj
;; This buffer is for Clojure experiments and evaluation.
;; Press C-j to evaluate the last expression.
(set-env! :dependencies #(into % '[[prismatic/plumbing "0.5.5"]]))
(require '[clojure.core.async :as async :refer [>!! alts! chan close! go-loop timeout]])
(require '[plumbing.core :as p])
(require '[plumbing.graph :as g])
(require '[plumbing.fnk.pfnk :as pfnk])
View smooth_scroll.cljs
;; smooth scroll
(def SCROLL_DURATION 550)
(def HEADER_HEIGHT 85)
(defn quad-out [p] (- (* p (- p 2))))
(defonce SMOOTH_SCROLL_ACTIVE (atom false))
(defn cancel-scroll-animation []
(reset! SMOOTH_SCROLL_ACTIVE false)
(goog.events/unlisten js/window event-type/WHEEL cancel-scroll-animation)