Skip to content

Instantly share code, notes, and snippets.

View ramirez7's full-sized avatar
๐Ÿ’—
Grey hairs are visible / I'm kinda of miserable, too

Armando Ramirez ramirez7

๐Ÿ’—
Grey hairs are visible / I'm kinda of miserable, too
View GitHub Profile

I'm tired of the FUD about ASDI-down and boxx. As a decade-long GCC claw player before switching to boxx for accessibility (CMC arthritis in the left thumb), I don't feel like there is an appreciable difference between the two for this tech.

I'll use ASDI-down Peach subfloat since that seems to be the current FUD example people throw around:

  • Cstick ASDI down with claw vs boxx both use two fingers. Index+thumb on claw and middle+thumb on boxx.
  • Cstick ASDI down is not an especially analog input, so the analog-ness of the Cstick doesn't really matter.
  • Cstick ASDI down with claw and an analog Cstick puts less strain on my right hand than on boxx.
    • Because 1) it's less of a reach (my gram slim is like 2x the distance between Cdown and jump than a gcc) and 2) you don't have to "press" with the thumb perpendicular to your grip but can instead use a more natural thumb motion parallel to your grip.
  • I actually
@ramirez7
ramirez7 / handwavy.md
Created September 6, 2024 20:06 — forked from k0001/handwavy.md
k0001's handwavy guide to high quality software

k0001's handwavy guide to high quality software

This is a work in progress where I try to convey what high quality software means to me, and how to build it. Be warned: This is a very opinionated and handwavy guide.

Copyright Renzo Carbonara, 2016. This work is licensed under a Creative Commons Attribution 4.0 International License.

with import <nixpkgs> {};
let
src = fetchzip {
url = "https://github.com/project-slippi/Ishiiruka-Playback/releases/download/v3.4.0/playback-3.4.0-Linux.zip";
sha256 = "sha256-fYDXDC+pdz33hEden7e5lSwY+KluysviOBFw17OOhUQ=";
stripRoot = false;
};
ldlibpath = lib.makeLibraryPath [
gmp
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DataKinds #-}
import GHC.TypeLits
newtype SqlT m a = SqlT (m a)
deriving stock (Functor)
deriving newtype (Applicative, Monad)
runSqlT :: CanRunSqlT m => SqlT m a -> m a

I often see effects called "fancy," but in 2024 I fail to see how that is the case. If anything, their types are more clear than mtl in 2024.

I've been using extensible effects (via cleff [1]) in my gamedev code since 2021 (starting with Ludum Dare 49). I originally used mtl, but it was almost immediately a pain. I saw cleff and switched to it within a day (for both library code + my previous game). I can confidently say I'll never use mtl again if I have any choice. It's archaic and brings no benefit besides somehow being considered less fancy.

I say "somehow" because I don't really understand why mtl is considered less fancy than cleff. Maybe it's because it's fancier to implement? But the whole point of Haskell is that you shouldn't need to care about the implementation if

{-# LANGUAGE AllowAmbiguousTypes #-}
import Data.Coerce
import Data.Foldable
foldMapVia
:: forall b f r a
. Coercible r b
=> Monoid b
=> Foldable f
-- Similar to this old gist https://gist.github.com/ramirez7/11167d5f1c2a1153c3fb20643f4cb2d4
--
-- Scala is a bit more general though thanks to its path-dependent types
module SetBy
( SetBy
) where
import Data.Map (Map)
import qualified Data.Map as Map
import GHC.TypeLits
@ramirez7
ramirez7 / spew-error.hs
Created May 6, 2024 19:36
Make an arbitrarily large Haskell error message (and make your computer very warm)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -freduction-depth-0 #-}
import GHC.TypeLits
data N = Z | S N
@ramirez7
ramirez7 / time-ghci
Last active March 13, 2024 14:57
Get the _real_ time of stuff in ghci
:{
let ghciTime cmd = do
let mkVar n u = "ghciTime_" ++ n ++ "_" ++ show (Data.Unique.hashUnique u)
startVar <- mkVar "start" <$> Data.Unique.newUnique
resVar <- mkVar "res" <$> Data.Unique.newUnique
endVar <- mkVar "end" <$> Data.Unique.newUnique
pure $ unlines
[ startVar ++ " <- Data.Time.getCurrentTime"
, resVar ++ "<- " ++ cmd
, endVar ++ " <- Data.Time.getCurrentTime"