Skip to content

Instantly share code, notes, and snippets.

View mbbx6spp's full-sized avatar
🎯
Focusing

Susan Potter mbbx6spp

🎯
Focusing
View GitHub Profile
@mbbx6spp
mbbx6spp / alternative.hs
Last active March 2, 2019 13:17
Example demonstrating Alternative
{-# LANGUAGE NoImplicitPrelude #-}
module AlternativeExample where
import Control.Applicative
import Data.Maybe
import Data.Text hiding (empty)
import GHC.Show (Show)
type Login = Text
@mbbx6spp
mbbx6spp / README.md
Last active February 28, 2019 22:17
Answer to common question: how do I find the SHA256 for a fetchGitHub in Nix without getting it from the error message?

Question

I just got asked this question: How do I find the SHA256 for a fetchGitHub in Nix expressions without faking it and getting it from the error message?

Answer

Install nix-prefetch-github:

$ nix-env -i nix-prefetch-github
@mbbx6spp
mbbx6spp / FunctorExercises.hs
Last active February 4, 2019 20:45
Exercises to show how to abstract over Functors in our data types via type constructor.
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RankNTypes #-}
import Control.Monad (mapM_)
import Data.Function (($))
import Data.Functor (Functor (..))
import Data.List ((++))
import GHC.Num (Integer, (+))

Decisions/directions for web development projects

Goals for future websites or web applications builts in the next year include:

  • Accessibility: content on the web application should be accessible to people of different abilities using screenreaders by default
  • Footprint: assets and markup of web application should be as minimal as possible without forgoing any of these other goals
  • Mobile-first: design layouts and content dissemination should be optimized for mobile-first
  • Usable: most common tablet and desktop size renderings should work well
  • Performance: ensure each page load has first meaningful paint within 0.4s and ensure page fully interactive by 0.8s (without network latency)
@mbbx6spp
mbbx6spp / openpgp.txt
Created December 26, 2018 15:58
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:8e42c6f5300b802a2df2e7375ea6752798ade611]
@mbbx6spp
mbbx6spp / category-theory-study-materials.org
Last active July 23, 2023 23:48
List of books/lecture series/courses/conference talks and practices used to learn about category theory, functional programming, and dependent types by a software developer in industry who has limited time to do this stuff with some suggestions on how to consume the material.

Category Theory and Functional Programming Study Materials

Acronyms/Terms

  • CT: Category Theory
  • FP: Functional Programming (typically meaning more pure functional programming)
  • TFP: Total Functional Programming
  • TDD: Type Driven Development (e.g. via Idris or Agda)
  • TT: Type Theory
  • PLT: Programming Language Theory
@mbbx6spp
mbbx6spp / nixos-hydra.org
Created November 29, 2018 16:59
Basic intro to NixOS project's Hydra

Hydra On-boarding

Hydra: What is it?

@mbbx6spp
mbbx6spp / nix-yarn2nix-bundix-packaging.org
Created November 15, 2018 21:41
Quick notes on what worked to package a frontend yarn JS project and how to update gems in an existing Ruby project using bundix for Nix based configuration.

Random Nix Project Packaging (yarn2nix, bundix -l)

Setting up a nodejs project via yarn2nix in Nix for existing project

  • nix-shell -p yarn yarn2nix nodejs
  • copied the Nix skeleton files in place (./z/etc/lib/{version,nixpkgs}.nix ./z/etc/overlays/default.nix)
  • generated package.nix using yarn2nix
  • add these Nix expressions in the root
@mbbx6spp
mbbx6spp / Profunctors.hs
Last active May 12, 2019 18:55
Doodle to help explain Profunctors and Yoneda embedding application.
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Profunctors where
@mbbx6spp
mbbx6spp / .00readme.org
Last active August 22, 2023 02:42
A caching and persistent Nix shell with direnv

Cached and Persistent Nix shell with direnv integration

Problem being solved

  • the default direnv Nix integration from projects loads a Nix shell every new terminal or every time shell.nix and/or default.nix changes. On larger projects with a lot of Nix shell dependencies, that can cause the terminal to take more than 6 seconds to load, which significantly degrades the developer experience (DX).
  • when a developer garbage collects in their Nix store, often the Nix shell dependencies are deleted also which causes a slow start the next time the project’s Nix shell is requested, also degrading developer experience (DX).

Solution outline

  • on first Nix shell load, the Nix shell is evaluated fully such that direnv dumps the environment from the spawn Nix shell process