Skip to content

Instantly share code, notes, and snippets.

View matfournier's full-sized avatar

matfournier matfournier

View GitHub Profile
@matfournier
matfournier / crawl.rc
Created February 5, 2023 22:43
DCSS crawl rc
##### Crawl Init file ###############################################
# For descriptions of all options, as well as some more in-depth information
# on setting them, consult the file
# options_guide.txt
# in your /docs directory. If you can't find it, the file is also available
# online at:
# https://github.com/crawl/crawl/blob/master/crawl-ref/docs/options_guide.txt
#
# Crawl uses the first file of the following list as its option file:
# * init.txt in the -rcdir directory (if specified)
@matfournier
matfournier / blah.scala
Last active April 8, 2022 04:03
json parsing tutorial scala setup
import cats.effect.{IO, IOApp}
import derevo.circe.{decoder, encoder}
import derevo.derive
import io.circe.syntax._
import io.circe.parser._
import cats.effect.implicits._
import cats.implicits._
import io.circe.Json
import io.circe.Json.JNumber
import io.circe.optics.JsonPath._
@matfournier
matfournier / interface.nim
Last active July 1, 2021 22:03
Nim interface example
import
# map,
# entity,
strformat
type
Terminal* = ref TerminalObj
TerminalObj* = object of RootObj
layer*: proc (i: int)
EchoTerminal* = ref EchoTerminalObj # version that echos to console
@matfournier
matfournier / gadthelp.scala
Last active February 6, 2021 01:01
gadthelp
sealed trait Scenario[A, B]
object Scenario {
// later pattern matching let's me do GADT stuff in pattern matches fine
case object A extends Scenario[AA, AA1]
case object B extends Scenario[BB, BB1]
// but how to get into this domain from the outside is the problem...(this doesn't compile obviously)
def from[A, B](s: String): Scenario[A, B] = s match {
case "a" => A
case "b" => B
}
@matfournier
matfournier / RepeatEval.scala
Last active October 6, 2022 08:36
forever repeating an action cats-effect question
/** An effect for infinitely repeating an action, use with care
* as there is no way to kill the process w/o shutting down the
* server in this implementation */
trait RepeatEval[F[_]] {
def repeat[A](fa: F[A], duration: FiniteDuration): F[Unit]
}
object RepeatEval {
def apply[F[_]](implicit ev: RepeatEval[F]): RepeatEval[F] = ev
package word
import cats.implicits._
trait Scenario
object Scenario {
case class Unsolvable(reason: String) extends Scenario
case class NoA(length: Int) extends Scenario
@matfournier
matfournier / stack.scala
Created July 30, 2020 05:32
a stack language as an ADT with compile time checking
package stack
import cats.Monoid
import scala.util.Try
import cats.implicits._
import scala.reflect.macros.blackbox
import scala.language.experimental.macros
@matfournier
matfournier / 1_summary.md
Last active July 12, 2020 22:10
SW combat curves

INTRO

The goals of this quick analyses:

  • Create a conversion tool between OSR monsters and Suldokars wake
  • Create a few combat curves for Suldokar's wake to help with creature design
  • Explore player/boss survivability with endrolls

COMBAT SIMULATORS

Two combat simulators were written quick and dirty in R

@matfournier
matfournier / BlahTest.scala
Created May 29, 2020 05:17
kleisli.combineK
package com.hootsuite.service.channelauthaudit.services.forensics.models
import org.scalatest.{FlatSpec, Matchers}
import cats._
import cats.data._
import cats.implicits._
class BlahTest extends FlatSpec with Matchers {
import KleisliOps._
@matfournier
matfournier / notes.md
Last active April 5, 2020 22:56
scaladoc in doom emacs

First pull latest develop and do a bin/doom update

I did this wrong the first time, but the doom-emacs author is here to help. See his solution below but also add this one line

(setq-hook! 'scala-mode-hook +lsp-company-backend 'company-capf)

how to use