Skip to content

Instantly share code, notes, and snippets.

View matfournier's full-sized avatar

matfournier matfournier

View GitHub Profile
@matfournier
matfournier / .doom.d
Created October 31, 2019 16:29
doom-emacs
;;; .doom.d/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here
(setq doom-font (font-spec :family "Hasklig" :size 14))
(when (version<= "26.0.50" emacs-version )
(global-display-line-numbers-mode))
;;
@matfournier
matfournier / traverse.scala
Last active September 18, 2019 06:45
traversing all the things examples
package mf.examples
import scala.concurrent.Future
import scala.concurrent.ExecutionContext
import scala.util.Try
import cats._
import cats.data._
import cats.implicits._
case class Request(value: String)
@matfournier
matfournier / refinedDecoder.scala
Created September 16, 2019 05:31
refinedDecoder
package mf.refined
import eu.timepit.refined.auto._
import eu.timepit.refined._
import eu.timepit.refined.api.{Refined, RefType}
import eu.timepit.refined.collection._
import eu.timepit.refined.numeric._
import io.circe._, io.circe.generic.semiauto._
import io.circe.syntax._
import cats.implicits._
@matfournier
matfournier / typeclasses.md
Created September 8, 2019 18:37
typeclasses-draft

title: Getting Func-ey author: Mathew Fournier patat: theme: syntaxHighlighting: decVal: [bold] images: backend: auto ...

@matfournier
matfournier / books.md
Last active December 10, 2019 17:04
cookbooks

I cook tons. I have ~100 cookbooks, a 1HP meat grinder, a deep fryer, a 75,000 BTU outdoor wok, a mangal, many fermenting vessels, hell a fermenting chamber for koji, and way too many knives. Someone at work asked about cookbook recommendations by country so here it is. There are many omissions to this list. It aims to be "if I wanted to get into X cuisine, what is the first cookbook I should buy to get started'.

Cookbooks

General italian - Zuni cafe cookbook is a standout. Everyone says to get a copy of Marcella Hazen's Essential Italian but meh, I reach to zuni cafe way more often. Hightly recommended. Maybe Molto Mario or Babbo for a second or third italian book, but get zuni cafe first.

just pasta: flour + water

thai: the first pok pok cookbook is great (not the drinking food of thailand, not pok pok noodles) and super easy to get into. If that hooks you, Thai Food by Thompson is the bible, but muc harder to approach. Night+Market is also a good second book. (edited)

@matfournier
matfournier / effects.md
Last active July 15, 2019 04:59
programming with effects addendum

Programming with EFfects Addendum

  • one consistent example showing a bunch of effects
  • some of these effects short circuit
    • give us back exceptions (option, either)
  • some represent something happening async elsewhere (possible on another thread)
    • e.g. waiting for something on a network
    • e.g. Future/Task
    • note: these also have some idea of short circuiting with failures
  • some have nothing at all to do with failures and have no short circuiting
@matfournier
matfournier / ten.md
Last active July 2, 2019 18:35
scala advice

TLDR; scala practices

Lean on what you know

  • much of what you already know about programming is useful in scala
    • favour composition over inheritance
    • single responsibility principle
    • DRY when it makes sense
    • don't leak abstractions
  • program to an interface
// edit : haskell must also have this problem but how does it solve it?
sealed trait Blah
// the names aren't important, just that Thing1-3 are all types of Blah and contain dif info (A/C/Z/etc)
case class Thing1(piece: A, otherPiece: C) extends Blah
case class Thing2(hierarchy: Z) extends Blah
case class Thing3(thinger: F) extends Blah
case cbject DefaultThing extends Blah
module Chapter8.GetURLTwo where
import Chapter8.MFGetURL
import Control.Concurrent
import qualified Data.ByteString as B
data Async a = Async (MVar a)
async' :: IO a -> IO (Async a)
async' action = do
@matfournier
matfournier / angular-counter.js
Last active February 4, 2019 21:31
Examples of counters in various languages/frameworks for js
angular.module('counterApp', []);
angular.module('counterApp')
.controller('counterCtrl', function() {
var limit = 10;
this.reset = function() {
this.count = 0;
};