Skip to content

Instantly share code, notes, and snippets.

🐢
Just discovered the user status feature on GitHub!

Susan Potter mbbx6spp

View GitHub Profile
@mbbx6spp
mbbx6spp / functors.hs
Last active Mar 11, 2019
Intuitions on functors.
View functors.hs
fmap :: Functor f => (a -> b) -> f a -> f b
contramap :: Contravariant f => (a <- b) -> f a -> f b
invmap :: Invariant f => (a <-> b) -> f a <-> f b -- NOT VALID syntax but to give an intuition.
bimap :: Bifunctor p => (a -> b)
-> (c -> d)
-> p a c
-> p b d
@mbbx6spp
mbbx6spp / alternative.hs
Last active Mar 2, 2019
Example demonstrating Alternative
View alternative.hs
{-# 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 Feb 28, 2019
Answer to common question: how do I find the SHA256 for a fetchGitHub in Nix without getting it from the error message?
View README.md

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 Feb 4, 2019
Exercises to show how to abstract over Functors in our data types via type constructor.
View FunctorExercises.hs
{-# 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, (+))
View webdev.org

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 Dec 26, 2018
OpenKeychain Linked Identity
View openpgp.txt
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 Apr 15, 2019
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.
View category-theory-study-materials.org

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 Nov 29, 2018
Basic intro to NixOS project's Hydra
View nixos-hydra.org

Hydra On-boarding

Hydra: What is it?

@mbbx6spp
mbbx6spp / nix-yarn2nix-bundix-packaging.org
Created Nov 15, 2018
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.
View nix-yarn2nix-bundix-packaging.org

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 Oct 30, 2018
Doodle to help explain Profunctors and Yoneda embedding application.
View Profunctors.hs
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Profunctors where
You can’t perform that action at this time.