Skip to content

Instantly share code, notes, and snippets.

Okay, second try at a comment.
I was disappointed by this video. I'm unaffiliated with any keyboard company and
generally appreciate distance from the displeasure of capitalism. I just like
keyboards. Building a genuine community brand requires more than just a quality
product. The human element is also your brand. And this includes respect for
those whose work you have built on top of (Kaleidoscope and Crysalis). I suspect
the Keyboard.io folk are too empathetic to participate in this competitive and
unfair teardown, which motivates me to author this response.
@shajra
shajra / shell.txt
Created June 15, 2020 01:17
NixOS cache miss...
$ nix-store -r /nix/store/savc6xd3rdg8y6rdmq333mfnpm76lfm8-ShellCheck-0.7.0
don't know ow to build these paths:
/nix/store/savc6xd3rdg8y6rdmq333mfnpm76lfm8-ShellCheck-0.7.0
error: build of '/nix/store/savc6xd3rdg8y6rdmq333mfnpm76lfm8-ShellCheck-0.7.0' failed
@shajra
shajra / default.nix
Created January 1, 2020 18:27
Is there a better way to override a library in Haskell.nix?
let
src = import ./sources.nix;
hnSrc = src."haskell.nix";
pinnedNixpkgsSrc = "${hnSrc}/nixpkgs";
hnArgsOrig = import hnSrc;
@shajra
shajra / maybe.nix
Created April 6, 2019 14:52
A OO-style encoding of sum types in Nix
let
build = match: rec {
inherit match;
map = f: match nothing (a: just(f a));
bind = f: match nothing (a: f a);
isJust = f: match false (a: true);
isNothing = f: match true (a: false);
show = match "Nothing" (a: "Just ${toString a}");
toList = match [] (a: [a]);
@shajra
shajra / nix_path_confuses.txt
Created October 31, 2018 15:39
Can someone explain how NIX_PATH works?
I understand how names are set explicitly on NIX_PATH:
$ NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos \
> nix eval nixpkgs.lib.version
"19.03pre155751.45a419ab5a2"
But this seems to indicate that raw paths can be put on NIX_PATH to override settings:
$ NIX_PATH=/home/tnks/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos \
> nix eval nixpkgs.lib.version
@shajra
shajra / Checker.hs
Last active October 8, 2018 23:51
A snapshot of thoughts on error handling
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
@shajra
shajra / nix.1.log
Created February 26, 2018 19:45
nix-env hangs, then I kill -9 it, then the same invocation works gain.
evaluating file '/nix/store/7bfc02z2ayj9h73qwyrbnnzy14xgrazn-nix-2.0pre5968_a6c0b773/share/nix/corepkgs/derivation.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/default.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/lib/minver.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/pkgs/top-level/impure.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/pkgs/top-level/default.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/pkgs/stdenv/booter.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/lib/default.nix'
evaluating file '/nix/store/gxx6yxpdclzw10m5a4879q065myarllp-nixpkgs-18.03pre129212.098c7f3d945/nixpkgs/lib/lists.nix'
evaluating file '/nix/store/gxx6yxpd
default-directory "/home/shajra/src/work/c12e-ml-imf/frontend/web/"
dante-command-line ("nix-shell" "--pure" "--run" "cabal new-repl --ghc-options=-ignore-dot-ghci" "/home/shajra/src/work/c12e-ml-imf//shell.nix")
dante-state running
dante-queue (#[128 "r\302\301!q\210\212\301b\210\303\300\"*\207" [#[514 "\305\300\203 \306\202
\307\310\311\312\313\314\301\302\303\304  &\315\"\316\317%\"\207" [nil #[514 "\303\304p!!\301\305\306\307\310\311\312\313\314\300
\"\315\"\316\317%\"\320\203I@\211\320H
>\2040\321\322\323D\"\210\211\324H\325=\204=\211B\262\210\211T\262A\262\202\266\211\237\262\"\210 \207" [haskell-dante #[128 "\301\302\300#\207" [[cl-struct-flycheck-syntax-check #<buffer Servant.hs> haskell-dante t "/home/shajra/src/work/c12e-ml-imf/frontend/web/app/C12E/ML/IMF/Frontend/"] apply flycheck-report-buffer-checker-status] 5 "
(fn &rest ARGS)"] cl-struct-flycheck-error-tags dante-local-name dante-temp-file-name finished nil mapcar make-byte-code 257 "\302\300p\301$\207" vconcat vect
@shajra
shajra / build.sbt
Created June 15, 2017 16:53
QUIZ: What is compile:foo?
val foo = settingKey[Int]("foo")
val bar = settingKey[Int]("bar")
val baz = settingKey[Int]("baz")
inConfig(Compile)(foo := bar.value)
bar := 1
bar in Compile := baz.value
baz := 2
baz in Compile := 3
@shajra
shajra / build.sbt
Created June 14, 2017 11:31 — forked from paulp/build.sbt
/** Your task is to reason your way to which compiler
* options which will be passed for each of
* 1) sbt root/compile
* 2) sbt p1/compile
*/
scalacOptions := Seq("-DSBT")
scalacOptions in ThisBuild += "-D0"
scalacOptions in Global += "-D1"