Skip to content

Instantly share code, notes, and snippets.

🍕
I like pizza

Adam Moore minikomi

🍕
I like pizza
Block or report user

Report or block minikomi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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)
View 353.k
/ Daily Programmer #353
/ inputs
i1:("ATCAATATCAA";"ATTAAATAACT";"AATCCTTAAAC";"CTACTTTCTTT";"TCCCATCCTTT";"ACTTCAATATA")
i2:";"\"AACACCCTATA;CTTCATCCACA;TTTCAATTTTC;ACAATCAAACC;ATTCTACAACT;ATTCCTTATTC;ACTTCTCTATT;TAAAACTCACC;CTTTTCCCACC;ACCTTTTCTCA;TACCACTACTT"
i3:";"\"ACAAAATCCTATCAAAAACTACCATACCAAT;ACTATACTTCTAATATCATTCATTACACTTT;TTAACTCCCATTATATATTATTAATTTACCC;CCAACATACTAAACTTATTTTTTAACTACCA;TTCTAAACATTACTCCTACACCTACATACCT;ATCATCAATTACCTAATAATTCCCAATTTAT;TCCCTAATCATACCATTTTACACTCAAAAAC;AATTCAAACTTTACACACCCCTCTCATCATC;CTCCATCTTATCATATAATAAACCAAATTTA;AAAAATCCATCATTTTTTAATTCCATTCCTT;CCACTCCAAACACAAAATTATTACAATAACA;ATATTTACTCACACAAACAATTACCATCACA;TTCAAATACAAATCTCAAAATCACCTTATTT;TCCTTTAACAACTTCCCTTATCTATCTATTC;CATCCATCCCAAAACTCTCACACATAACAAC;ATTACTTATACAAAATAACTACTCCCCAATA;TATATTTTAACCACTTACCAAAATCTCTACT;TCTTTTATATCCATAAATCCAACAACTCCTA;CTCTCAAACATATATTTCTATAACTCTTATC;ACAAATAATAAAACATCCATTTCATTCATAA;CACCACCAAACCTTATAATCCCCAACCACAC"
View emacs.el
; macros
(defmacro eval-after-load-all (features form)
"Arrange that if, and only if, all `FEATURES' are loaded, `FORM' is evaluated."
(declare (indent defun))
(if (null (cdr features))
`(eval-after-load ,(car features) ,form)
`(eval-after-load ,(car features) (eval-after-load-all ,(cdr features) ,form))))
(defmacro after (features &rest body)
@minikomi
minikomi / lazy.cljs
Last active Jul 14, 2018
Lazy loading image for reagent
View lazy.cljs
(ns frontend.lazy
(:require [reagent.core :as r]
[goog.dom :as gdom]
[goog.events.EventType :as event-type]
[goog.events :as events])
(:import goog.async.Throttle))
(defonce initialized-lazy-load (atom false))
(defonce lazy-els (atom {}))
(defonce lazy-loaded (r/atom #{}))
@minikomi
minikomi / spacemacs.org
Last active Jan 22, 2018
spacemacs.org
View spacemacs.org

Version pinning

(push '("melpa-stable" . "stable.melpa.org/packages/") configuration-layer--elpa-archives)
(push '(clj-refactor . "melpa-stable") package-pinned-packages)
(push '(ac-cider . "melpa-stable") package-pinned-packages)
(push '(cljr-helm . "melpa-stable") package-pinned-packages)
(push '(cider . "melpa-stable") package-pinned-packages)
View write-image.clj
(defn write-image!
([ext buffered-image output-file]
(write-image! ext buffered-image output-file {:quality 1.0}))
([ext buffered-image output-file options]
(let [writer (.next (ImageIO/getImageWritersByFormatName ext))
write-param (.getDefaultWriteParam writer)
iioimage (IIOImage. buffered-image nil nil)
ios (ImageIO/createImageOutputStream output-file)]
(doto write-param
(.setCompressionMode ImageWriteParam/MODE_EXPLICIT)
You can’t perform that action at this time.