Skip to content

Instantly share code, notes, and snippets.

View shapr's full-sized avatar
🏃
VENTRE À TERRE

Shae Erisson shapr

🏃
VENTRE À TERRE
View GitHub Profile
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
module SkyLine where
import Data.List (groupBy, sort)
{-
input:
[left,right,height]
@shapr
shapr / Timer.hs
Created September 20, 2023 22:34
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Concurrent
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import Data.Void
kali (192.168.1.12) -> www.leastauthority.com (35.198.125.84) 2023-05-10T09:44:22-0500
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Drop Rcv Avg Gmean Jttr Javg Jmax Jint
1. _gateway 144 249 0.7 0.7 0.0 0.2 0.7 1.9
2. 100.92.152.2 265 128 71.0 29.5 6.8 60.5 3135 2529
76.29.230.19
3. po-315-321-rur201.huntsville.al.hunts.comcast.net 264 129 68.8 28.9 10.9 59.6 3034 2482
76.29.230.19
4. 68.85.19
{
config,
pkgs,
callPackage,
...
}: {
imports = [
<nixpkgs/nixos/modules/virtualisation/openstack-config.nix>
./gandicloud.nix
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.2.1
config_reader_min_version=3
fields=111 0 48 17 18 38 39 40 2 46 47 49 1
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=0
show_thread_names=0
show_program_path=1
@shapr
shapr / model100.ino
Created March 19, 2023 19:58
model 100 test code
// -*- mode: c++ -*-
// Copyright 2016-2022 Keyboardio, inc. <[email protected]>
// See "LICENSE" for license details
/**
* These #include directives pull in the Kaleidoscope firmware core,
* as well as the Kaleidoscope plugins we use in the Model 100's firmware
*/
// The Kaleidoscope core
-- day 9
day9 :: IO ()
day9 = do
dt <- getDayInput "9"
let exDirs = parseCleanDay9 dt
putStrLn $ "day 1 part 1 " <> (show $ evalDay9 exDirs (scanl' tailFollow (0,0)))
putStrLn $ "day 1 part 2 " <> (show $ evalDay9 exDirs (oneRope . oneRope . oneRope . oneRope . oneRope . oneRope . oneRope . oneRope . oneRope))
where oneRope = scanl1 tailFollow
parseCleanDay9 :: Text -> [Direction]
@shapr
shapr / Transcoder.hs
Created February 9, 2023 18:02
transcode all FLAC files to 16bit 44.1 kHz with sox
module Main where
import Core
import System.Directory
import System.FilePath
import System.Process
import Data.Maybe
import Data.List
main :: IO ()
module Main where
import System.Directory
import System.FilePath
import System.Process
import Data.Maybe
import Data.List
myMusicDirectory = "/home/shae/Music"
module Main where
import Data.Time.Clock
import Data.Time.Format
import Data.Time.Format.ISO8601
import System.Cmd
import System.Directory
main :: IO ()
main = do