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 / git-tips-part-1.org
Last active April 29, 2023 02:17
Git tips and tricks for dev group presentation

Git Tips

Config

Git has different levels of configuration that apply to different /”scopes”/:

  • system (almost never needed; not covered here)
  • global (which is /”global for a user”/ scoped)
  • local (which is specific to one local clone)
  • worktree (which only applies to the current worktree; only relevant if you work with worktree s)
  • file (not covered here but you can set a git configuration option, when relevant at the file level, to one file)
@mbbx6spp
mbbx6spp / encrypted-zfs-nixos.org
Last active September 17, 2021 02:14
Encrypted ZFS for NixOS

Encrypted ZFS for NixOS

Assumptions

We will have add one partition to a zpool.

You have the following set to appropriate values:

  • disk: the path for your disk device, e.g. /dev/sdb or /dev/nvme0
  • efi: the path for the EFI boot partition’s device, e.g. /dev/sdb1
  • part: the path to the partition of your root filesystem, e.g. /dev/sdb2
@mbbx6spp
mbbx6spp / mword.md
Last active May 27, 2020 01:16
An M-word work rant of work Slack February 2020 edition.

Below is an excerpt from a Slack work rant from Feburary 4, 2020.

Over the last few weeks I have learned about some of the new additions to both ECMAScript 2019 and 2020 (for reasons!!!!) anyway, the following are relevant to an FP setting: flatMap flattens nested list structure then maps over the elements. Usage:

> let arr1 = ["Australia is", "on", "fire still"];
undefined
@mbbx6spp
mbbx6spp / Main.purs
Last active May 4, 2020 18:09
Fun with the state transformer with a coworker showing them functional programming constructs. Notice there are more lines of imports than there are lines of code.
module Main (main) where
import Control.Applicative (pure)
import Control.Bind (bind, discard)
import Control.Monad (void)
import Control.Monad.State (StateT, get, runStateT)
import Data.Array (range)
import Data.Eq ((==))
import Data.Function (($))
import Data.Functor (map)
@mbbx6spp
mbbx6spp / Models.Swagger.purs
Last active March 12, 2020 03:08
Outline of describing schema with algebraic data types for basic descriptions of data, in this case a Swagger "schema". Eventually we can evolve it in class to generating YAML/JSON Swagger from this data description and possible build swagger representations from Generic Reps
module Models.Swagger where
import Data.Map (Map)
import Data.Maybe (Maybe (..))
import Data.String.Regex (Regex)
import Data.Show (class Show, show)
data SwaggerFormatString
= DateFormat
| DateTimeFormat
@mbbx6spp
mbbx6spp / CatTheory.UniversalConstructions.purs
Last active January 16, 2020 15:21
Having fun with universal constructions for And and Or types and the correspondance of pairs (fanout, bimap) and (either, fanin) for each.
-- Module to demonstrate simple applications of the concept of universal construtions
module CatTheory.UniversalConstructions
-- * Types
( And (..)
, Or (..)
-- * Introducers
, and
, left
, right
, fanin
DROP DATABASE IF EXISTS animalsdb;
CREATE DATABASE animalsdb;
\c animalsdb;
-- We're modeling the following Haskell datatype:
--
-- data Animal = Cat Name Age | Dog Name OwnerId
--
-- We're going to factor the common 'Name' field into the animal table.
@mbbx6spp
mbbx6spp / SHORTS.org
Last active May 12, 2019 08:09
List of short movies

My absolute favorite format of film is the short film. Here are a list of short films I loved watching:

@mbbx6spp
mbbx6spp / 00README.org
Last active August 2, 2022 15:30
A gist of the commands, metadata file (.desktop), and script I wrote to delegate web URLs to the correct sandboxed web browser inside of the appropriate user profile in Linux. Should work in all distros.

Delegating web requests in Linux to correct browser profile

A few months ago I set this up and here is the write up on it since yesterday, while talking to a fellow Linux user, they found it intriguing.

My requirements

Any URL I click in Slack, Signal desktop app, or launch via terminal actions should launch into the correct sandboxed, user-profile web browser instance (in precedence order):

  • https://github.com/<workorg>.* should open in the work Firefox profile
@mbbx6spp
mbbx6spp / functors.hs
Last active March 11, 2019 16:52
Intuitions on functors.
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