Skip to content

Instantly share code, notes, and snippets.

@minimal
minimal / error.el
Created October 31, 2015 20:47
ligature hack breaks in minibuffer
Error during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p nil)
read-from-minibuffer: Attempt to shape unibyte textError during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p ni\
l) [52 times]
read-from-minibuffer: Attempt to shape unibyte text
Error during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p nil)
read-from-minibuffer: Attempt to shape unibyte textError during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p ni\
l) [64 times]
read-from-minibuffer: Attempt to shape unibyte text

Keybase proof

I hereby claim:

  • I am minimal on github.
  • I am chrismcdevitt (https://keybase.io/chrismcdevitt) on keybase.
  • I have a public key whose fingerprint is 9FF4 31C9 6AF3 1739 5300 2F71 03E4 4C93 6251 7D7B

To claim this, I am signing this object:

property tests

how to choose properties

different paths, same destination

  • commutativity
  • associativity
  • map
  • monad & functor laws

there and back again

  • serialization/deserialization
┌─────────────────┬─────────────────────┐ ┌─────────────────┐
│*****************│*********************│ │*****************│
│*****************│**************
def strategy(*args, **kwargs):
return ss.StrategyTable().strategy(*args, **kwargs)
PagesTuple = namedtuple("PagesTuple", ("url", "url_hash", "description",
"title", "classified"))
def make_pages(tuples):
pages = pages_pb2.Pages()
for tup in tuples:
@minimal
minimal / post.md
Last active May 26, 2023 08:52
Event monitoring post

At Skimlinks up until about 20 months ago our service monitoring consisted mostly of Icinga/Nagios checks that only ran about every 5 minutes. The Icinga dashboard was displayed on our monitor wall. While readying the release of a new version of SkimWords we thought we needed some monitoring closer to real-time. Since the API was CPU bound and latency sensitive we needed more insight into the state of the system, especially during new releases and traffic spikes.

As Clojure fans, we had recently come across

(ns transducers-exp.core
(:require [criterium.core :as cr])
(:gen-class))
(def xform (comp (map inc)
(filter even?)
(dedupe)
(mapcat range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
nfuncs thread transducers
17 28000 548
6 3700 199
2 21 50
transducers-exp.core> (cr/with-progress-reporting (cr/bench (sequence xform-small data)))
Warming up for JIT optimisations 10000000000 ...
compilation occured before 934629 iterations
Estimating execution count ...
Sampling ...
Final GC...
Checking GC...
Finding outliers ...
Bootstrapping ...
Checking outlier significance
transducers-exp.core> (cr/bench (sequence xform data))
WARNING: Final GC required 3.920999473301486 % of runtime
Evaluation count : 119337840 in 60 samples of 1988964 calls.
Execution time mean : 548.637437 ns
Execution time std-deviation : 85.741031 ns
Execution time lower quantile : 474.085845 ns ( 2.5%)
Execution time upper quantile : 732.818167 ns (97.5%)
Overhead used : 2.067067 ns
Found 5 outliers in 60 samples (8.3333 %)