Skip to content

Instantly share code, notes, and snippets.

@stew
stew / unison.svg
Last active October 4, 2025 01:07
unison.svg take 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="4" fill="#FF9BA3"/>
<g clip-path="url(#clip0_1117_9212)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.3008 10.6582C26.5534 10.91 26.5534 11.3242 26.3008 11.576C26.0482 11.8276 25.6326 11.8276 25.3801 11.576C25.2596 11.4545 25.192 11.2905 25.192 11.1197C25.192 10.7636 25.4861 10.4706 25.8434 10.4706C26.0147 10.4706 26.1792 10.5379 26.3011 10.6577L26.3008 10.6582ZM22.3161 8.58335C22.8035 8.68063 23.2803 8.82558 23.7395 9.01606C24.0601 9.14897 24.2148 9.52266 24.0823 9.84397C23.9847 10.0804 23.7534 10.2353 23.4981 10.2353C23.415 10.2353 23.3328 10.2189 23.256 10.187H23.2549C22.8774 10.0303 22.4858 9.91058 22.0853 9.82953C22.0746 9.82767 22.0642 9.82557 22.0535 9.82325C21.663 9.74642 21.2661 9.70673 20.8681 9.70471H20.8356C19.933 9.70466 19.0962 9.2207 18.6447 8.43756C18.642 8.43267 18.6389 8.42755 18.6364 8.42243C18.2222 7.70788 17.6727 7.08127 17.0187 6.57796C14.2477 4.44738
@stew
stew / unison.svg
Created October 3, 2025 19:29
unison.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stew
stew / guid.hs
Last active November 15, 2021 18:29
type 4 uuids
unique type Guid = Guid Nat Nat Nat Nat
Guid.data1 = cases
Guid data1 _ _ _ -> data1
Guid.data2 = cases
Guid _ data2 _ _ -> data2
Guid.data3 = cases
Guid _ _ data3 _ -> data3
@stew
stew / Cargo.toml
Last active July 19, 2020 03:31 — forked from johnynek/Cargo.toml
a toy example of CSV wordcount.
[package]
name = "hello"
version = "0.1.0"
authors = ["P. Oscar Boykin <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
csv = "1.1"
# unbind some default keybindings
unbind C-b
# set prefix key to ctrl-a
set -g prefix C-o
# lower command delay
set -sg escape-time 1
# start first window and pane at 1, not zero
@stew
stew / shell.nix
Created February 27, 2019 07:13
shell.nix for rust project
with import <nixpkgs> {
overlays = map import [ ./nix/rust-overlay.nix ];
};
stdenv.mkDerivation rec {
name = "hatchway";
buildInputs = [
rustChannels.stable.rust
# rustChannels.nightly.rust
openssl
pkgconfig
@stew
stew / make-scala-project.el
Last active June 30, 2017 04:53
make-scala-project
(defun stew-write-file (fn str)
(with-temp-buffer
(insert str)
(write-region (point-min) (point-max) fn t)))
(defun stew-make-build.properties (fn)
(let ((build.properties (concat "sbt.version=" sbt-version "\n")))
(stew-write-file fn build.properties)))
(defun stew-make-plugins.sbt (fn)
object BTree {
type Children[A] = (Option[A], Option[A])
// We can define a non-empty binary tree as being a Cofree using the
// above pattern, with each node labelled by both a value, and
// memoized height of the tree.
type BTree[A] = Cofree[Children, (A,Int)]
@inline def extract[A](x: BTree[A]) = x.head._1
@inline def height[A](x: BTree[A]): Int = x.head._2
@stew
stew / adjunction.scala
Created November 22, 2016 19:18
don't know if I can make line 89 work
package adjunction
import cats._
/**
* An Adjunction is a relationship between two functors:
* - `F`, the "left-adjoint"
* - `G`, the "right-adjoint"
*