Skip to content

Instantly share code, notes, and snippets.

View goertzenator's full-sized avatar

Daniel Goertzen goertzenator

View GitHub Profile
@goertzenator
goertzenator / QQ.hs
Created October 2, 2024 14:42
whitespace cleaning quasiquoter
-- This is a modification of raw-strings-qq with whitespace cleanup features.
{- | Raw string literals, implemented using Template Haskell's quasiquotation
feature.
-}
module Util.QQ (
w,
)
where
@goertzenator
goertzenator / gist:4ae4e3ba8460e191885d5b9fa9749ad6
Created May 31, 2022 16:45
journalctl output of plasma login failure
May 31 11:47:51 colossus sddm-greeter[35484]: Reading from "/nix/store/bf5cqg2i8r6c04lamx309h03hilnsss7-desktops/share/wayland-sessions/plasmawayland.desktop"
May 31 11:47:51 colossus sddm[35401]: Message received from greeter: Login
May 31 11:47:51 colossus sddm[35401]: Reading from "/nix/store/bf5cqg2i8r6c04lamx309h03hilnsss7-desktops/share/wayland-sessions/plasmawayland.desktop"
May 31 11:47:51 colossus sddm[35401]: Reading from "/nix/store/bf5cqg2i8r6c04lamx309h03hilnsss7-desktops/share/wayland-sessions/plasmawayland.desktop"
May 31 11:47:51 colossus sddm[35401]: Session "/nix/store/bf5cqg2i8r6c04lamx309h03hilnsss7-desktops/share/wayland-sessions/plasmawayland.desktop" selected, command: "/nix/store/h50j6flvc1fc9s0j8mzjl3xi3qg56iw7-plasma-workspace-5.24.5/libexec/plasma-dbus-run-session-if-needed /nix/store/h50j6flvc1fc9s0j8mzjl3xi3qg56iw7-plasma-workspace-5.24.5/bin/startplasma-wayland"
May 31 11:47:51 colossus sddm-helper[35610]: [PAM] Starting...
May 31 11:47:51 colossus sddm-helper[35610]: [PAM] Authe
@goertzenator
goertzenator / variance.rs
Created January 28, 2022 17:15
use case for simd horizontal traits
use conv::{ValueFrom, ValueInto};
use core_simd::*;
use std::iter::Sum;
use std::ops::{Div, Mul, Sub};
/// Trait wrapper for Simd horizontal_sum()
pub trait HorizontalSum {
type Output;
fn hsum(&self) -> Self::Output;
}
@goertzenator
goertzenator / polylens.hs
Last active June 18, 2020 19:09
Polysemy State and Lens
stateToStateViaLens :: Member (State bigSt) r
=> Lens' bigSt smallSt
-> Sem (State smallSt ': r) a
-> Sem r a
stateToStateViaLens lens = interpret $ \case
Put smallSt -> modify' (set lens smallSt)
Get -> gets (view lens)
trylensplay2 :: IO ()
trylensplay2 =
@goertzenator
goertzenator / Main.hs
Created April 29, 2019 13:32
Main.hs
module Main where
import Server
main :: IO ()
main = Server.main
-- main = putStrLn "Hello, Haskell!"
@goertzenator
goertzenator / Server.hs
Created April 29, 2019 13:31
Server.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
@goertzenator
goertzenator / backend.cabal
Created April 29, 2019 13:30
backend.cabal
-- Initial backend.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
-- The name of the package.
name: backend
-- The package version. See the Haskell package versioning policy (PVP)
-- for standards guiding when and how versions should be incremented.
-- https://wiki.haskell.org/Package_versioning_policy
-- PVP summary: +-+------- breaking API changes
home@i7desktop /cygdrive/c/Users/home/Desktop/mindustry-4.0-alpha-58
$ ./Mindustry.exe 2>&1 | tr ';' '\n'
java.lang.Error:
There is an incompatible JNA native library installed on this system
Expected: 5.1.0
Found: 4.0.0
C:\Users\home\Desktop\mindustry-4.0-alpha-58
C:\WINDOWS\Sun\Java\bin
C:\WINDOWS\system32
[goertzen@asusnixos:~/eco]$ touch Configs/hello
touch: cannot touch 'Configs/hello': Permission denied
[goertzen@asusnixos:~/eco]$ id
uid=1000(goertzen) gid=100(users) groups=100(users),1(wheel),17(audio),57(networkmanager)
[goertzen@asusnixos:~/eco]$ ls -aln
total 0
drwxr-xr-x 1 1000 100 54 May 21 14:04 .
drwx------ 1 1000 100 1294 May 21 14:09 ..
@goertzenator
goertzenator / gist:9f70d159c814298e7ea84d3b51690e74
Created May 22, 2017 01:38
Arma 3 dedicated linux segfault
19:37:46 Updating base class ->Car_F, by a3\soft_f\config.bin/CfgVehicles/Truck_F/ (original a3\soft_f\config.bin)
19:37:46 Updating base class ->BlendAnims, by a3\soft_f_kart\kart_01\config.bin/CfgMovesMaleSdr/BlendAnims/ (original (a3\anims_f\config\sdr\config.bin - no unload))
19:37:46 Updating base class RscText->ctrlStaticBackgroundDisable, by a3\3den\config.bin/RscDisplayOptionsAudio/ControlsBackground/BackgroundDisable/ (original a3\3den\config.bin)
19:37:46 Updating base class RscText->ctrlStaticBackgroundDisableTiles, by a3\3den\config.bin/RscDisplayOptionsAudio/ControlsBackground/BackgroundDisableTiles/ (original a3\3den\config.bin)
19:37:46 Updating base class RscText->ctrlStaticBackgroundDisable, by a3\3den\config.bin/RscDisplayConfigure/ControlsBackground/BackgroundDisable/ (original a3\3den\config.bin)
19:37:46 Updating base class RscText->ctrlStaticBackgroundDisableTiles, by a3\3den\config.bin/RscDisplayConfigure/ControlsBackground/BackgroundDisableTiles/ (original a3\3den\config.bin)
19:37:46