Skip to content

Instantly share code, notes, and snippets.

@ul
ul / KloudGen.scd
Created July 2, 2022 00:33 — forked from madskjeldgaard/KloudGen.scd
Sketch for a supercollider based cloud generator

/*

Sketch for a cloud generator

By Mads Kjeldgaard, 2020

*/ ( ~numChannels = 2; s.options.numOutputBusChannels_(~numChannels);

@ul
ul / hey_notmuch!
Created May 16, 2021 04:33 — forked from vedang/hey_notmuch!
Notmuch configuration for Hey.com Style workflows.
- Specific Notmuch filters (and saved-searches) for:
+ The Feed (newsletters, blogs)
+ The Paper trail (receipts, ledger)
+ Screened Inbox (mail from folks you actually want to read)
+ Previously Seen (important mail that you've already read)
+ Unscreened Inbox (potential spam / stuff you don't want)
- Elisp Functions to move / categorize emails from a particular sender.
+ Adds tags needed by filters defined above to all email sent by a particular sender
+ Creates an entry in a DB file, which is used by the Notmuch post-new script when indexing new email, to auto-add the relevant tags.
@ul
ul / coder.clj
Created February 23, 2020 21:37 — forked from mikeananev/coder.clj
Adaptive LZW compression on Clojure
(ns org.rssys.lzw.coder
(:require [clojure.java.io :as io])
(:import (java.io InputStream OutputStream)
(com.github.jinahya.bit.io StreamByteInput StreamByteOutput DefaultBitOutput DefaultBitInput)))
(def MAX-BITS-LENGTH 18)
(def EOF 256)
(defn lzw-encode-stream
[^InputStream in-stream ^OutputStream out-stream]
@ul
ul / what-forces-layout.md
Created July 19, 2017 00:05 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@ul
ul / README.md
Created June 29, 2017 00:09 — forked from yogthos/README.md

The project can be built using Lumo

npm install -g lumo-cljs
lumo build.cljs
@ul
ul / Multi.re
Created April 10, 2017 06:18 — forked from wyze/Multi.re
More than one React component in a Reason file (module).
module WrapperA = {
module A = {
include ReactRe.Component;
let name = "A";
type props = ();
let render _ => <div>(ReactRe.stringToElement "A")</div>;
};
@ul
ul / README.md
Created November 14, 2016 11:34 — forked from fasiha/README.md
Pitch (fundamental frequency) detection using (1) harmonic product spectrum, (2) Blackman-Tukey spectral estimator, and (3) Welch spectral estimator.

Experimenting with pitch detection and spectral estimators

See the question and discussion on StackOverflow: How to get the fundamental frequency using Harmonic Product Spectrum?.

We’re trying to estimate the fundamental frequency of a voiced A4 note (440 Hz). (See the question for link to audio clip.)

Harmonic product spectrum

Result: full data, 0 to 2 KHz

@ul
ul / README.md
Created March 29, 2016 03:05 — forked from olivergeorge/Nicer Assert README.md
Assert macro patch to show details about failed assertions.

This is an attempt to make assert more friendly by including more details in the assertion error.

  • show the result of the assertion expression
  • show local variable values used in assertion form

In other words, this should make assertion errors easier to reason about:

AssertionError Assert failed: Should be equal
@ul
ul / check.cljs
Created November 27, 2015 15:39 — forked from swannodette/check.cljs
(defn my-get
"@param {*} m
@param {*} k
@return {nil|Object}"
[m k]
(get m k))
(defn foo
"@param {!Object} x" ;; non-nullable
[x] x)