Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯

Susan Potter mbbx6spp

🎯
View GitHub Profile
View arrays.js
const fruits = [ 'apples', 'bananas', 'cantelopes', 'durians', false];
const chunked = _.chunk(fruits, 2); // chunks elements of an arrary
const compacted = _.compact(fruits); // removes falsey values
const filled = _.fill(fruits, 'bananas'); // fill with my favorite fuit
const flattened = _.flatten(chunked); // flatten nested arrays
@mbbx6spp
mbbx6spp / Types.purs
Last active Aug 11, 2020
Accompanying PureScript demonstration of native ADTs for the 'Algebraic Data Types in PureScript': https://susanpotter.net/software/algebraic-data-types-in-typescript/
View Types.purs
module Main (main) where
import Data.Unit (Unit)
import Data.Maybe (Maybe (..))
import Effect (Effect)
import Effect.Console (log)
main :: Effect Unit
main = log "hello world"
@mbbx6spp
mbbx6spp / git-tips-part-1.org
Last active Jun 25, 2020
Git tips and tricks for dev group presentation
View git-tips-part-1.org

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 May 31, 2020
Encrypted ZFS for NixOS
View encrypted-zfs-nixos.org

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
An M-word work rant of work Slack February 2020 edition.
View mword.md

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
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.
View Main.purs
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 Mar 12, 2020
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
View Models.Swagger.purs
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 Jan 16, 2020
Having fun with universal constructions for And and Or types and the correspondance of pairs (fanout, bimap) and (either, fanin) for each.
View CatTheory.UniversalConstructions.purs
-- Module to demonstrate simple applications of the concept of universal construtions
module CatTheory.UniversalConstructions
-- * Types
( And (..)
, Or (..)
-- * Introducers
, and
, left
, right
, fanin
View animal2.sql
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
List of short movies
View SHORTS.org

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

You can’t perform that action at this time.