Skip to content

Instantly share code, notes, and snippets.

View chrisdone-artificial's full-sized avatar

Chris Done chrisdone-artificial

View GitHub Profile
@chrisdone-artificial
chrisdone-artificial / .ssh-config
Last active March 29, 2022 18:07
macOS send clipboard to Emacs
HostName 192.168.64.2
User chris
IdentityFile /Users/chris/.ssh/id_ed25519
# The below enables instantaneous connections instead of 200ms
ControlPath /tmp/linux-socket
ControlPersist yes
{-# language DeriveAnyClass #-}
{-# language DeriveGeneric #-}
{-# language DisambiguateRecordFields #-}
{-# language OverloadedStrings #-}
{-# language TypeApplications #-}
{-# options -Wwarn #-}
module Brossa.API.Internal.Rel8 where
import Data.Int
import Data.Text (Text)
calling magit-git-exit-code: ("update-index" "--refresh")
calling magit-git-string: ("symbolic-ref" "-q" "HEAD") [2 times]
calling magit-git-string: ("config" "branch.master.remote")
calling magit-git-string: ("config" "branch.master.merge")
magit-git-lines: ("config" "--get-all" "remote.origin.fetch")
calling magit-git-string: ("config" "--bool" "branch.master.rebase")
calling magit-git-string: ("config" "branch.master.remote")
calling magit-git-string: ("config" "remote.origin.url")
calling magit-git-string: ("rev-parse" "--verify" "HEAD")
calling magit-git-string: ("log" "-1" "--pretty=format:%h %s" "HEAD")
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 7 columns, instead of 6. in line 5.
Description , SaaS closed source , SaaS source visible , SaaS open core , SaaS open source , SaaS public domain , SaaS paid sub access to forge
Example , GitHub , Quake , GitLab , SourceHut , SQLite , ??????
Reduces OS maintain , ✅ , ✅ , ❌ , ❌ , ✅ , ✅ (pay for forge access)
Cloud can't bundle , ✅ , ✅ , ❌ , ❌ , ❌ , ✅
Competitors can't lift , ✅ , ❌ , ❌ , ❌ , ❌ , ❌
OS street cred , ❌ , ❌ , ✅ , ✅ , ✅
import System.Posix.Signals
main = do
mainId <- myThreadId
_ <-
installHandler
softwareTermination
(CatchOnce
(do putStrLn "Received SIGTERM. Killing main thread."
killThread mainId))
-- named & hashmap; O(log n) update/access
data Exp
= Lam Int Expr
| Var Int
| App Exp Exp
eval :: Map Int Expr -> Expr -> Expr
eval env = \case
App (Lam i b) e ->
let !e' = eval e
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# language MagicHash, LambdaCase, ViewPatterns, PatternSynonyms #-}
{-
Naive interpreter
75025
19,506,912 bytes allocated in the heap
104 bytes copied during GC
60,528 bytes maximum residency (2 sample(s))
@chrisdone-artificial
chrisdone-artificial / typescript is bad.md
Created August 31, 2022 15:42
typescript is bad.md

The tooling and libraries change constantly and require migrations and reworkings due to upstream decision making (React). The language can't even handle equality (and this causes bugs) or ordering properly. We have all this infrastructure for generating types from Haskell, but they aren't the same in TypeScript (as it doesn't even have sum types), so you have to think in two different representations. We waste time on the poor quality type system. We have to do twice the work in terms of ferrying information to and from the server and think about data access patterns not just on the server but also on the client, versus a classic web app that just serves up HTML. The compiler is slow as hell, so it's not even faster than compiling Haskell code. The error messages for standard stuff are about as bad as using GHC with some exotic libraries. None of our Haskell expertise is useful (IOW wasted), things that are a one-liner in Haskell are 5 lines in TypeScript. Our app doesn't do anything fancy that a classic HTM

FROM ubuntu:20.04
RUN apt-get update -y
RUN apt-get install -y python pip
COPY . /home/chris/Work/alphacephei/vosk-server
WORKDIR /home/chris/Work/alphacephei/vosk-server
RUN pip install -r requirements.txt && pip3 install sounddevice
RUN apt-get install -y libportaudio2