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 / 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 / maxims.md
Last active June 16, 2021 14:01
Maxims for Software Development

Basic Humanity

  • Everyone is safe, respected, and treated with empathy and dignity.
  • Pay is competitive, fair, and relatively transparent.
  • Capitalize on a culture of looking at other jobs in other companies.

Organization

  • Titled leaders deeply respect their implicit influence.
  • Managers of technical workers are always highly technically skilled.
@shajra
shajra / ContentNegotiate.scala
Last active January 30, 2021 20:35
Very unpolished (and likely to change) stab at content negotiation in HTTP4S
package shajra.extn.http4s.core
import org.http4s.
{ Charset, CharsetRange, ContentCoding, EntityEncoder, HasQValue, Header,
HeaderKey, Headers, LanguageTag, MediaRange, MediaType, QValue }
import org.http4s.headers.
{ Accept, `Accept-Encoding`, `Accept-Charset`, `Accept-Language`,
`Content-Encoding`, `Content-Type` }
import org.http4s.util.CaseInsensitiveString
@shajra
shajra / Task.scala
Created August 23, 2013 03:34
integration code between Scalaz and Scala standard concurrency libraries.
import concurrent.{ExecutionContext, Future => SFuture, Promise}
import util.Try
import _root_.scalaz.\/
import _root_.scalaz.concurrent.{Task => ZTask}
object Task {
def fromScala[A]
@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 / alacarte.scala
Last active May 6, 2019 20:53 — forked from runarorama/gist:a8fab38e473fafa0921d
"datatypes a la carte" pattern in Scala
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@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 #-}