This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data ValidatedCommand = RegularMove Char Char String Char | |
| WinningMove Char Char | |
| InvalidCommand | |
deriving (Show, Eq) | |
validateCommand :: Command -> ValidatedCommand | |
validateCommand (row:col:',':rot) | |
| length rot >= 2 && | |
row `elem` "abcdef" && | |
col `elem` "123456" && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(library | |
(queue) | |
(export new queue? enqueue! serve! peek full? empty?) | |
(import (rnrs base) | |
(srfi :9) | |
(rnrs mutable-pairs)) | |
(define default-size 5) | |
(define-record-type queue | |
(make s h r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !bin/sh | |
# groups words by most common occurence and highlights colon emojis e.g. :slighty_smiling_face: | |
# useful in combination with e.g. a message scraper for Slack | |
# macOS? brew install gnu-sed to swap casing | |
# change all seds to gsed or add it to your PATH | |
# ps coreutils is bloatware | |
echo 'some random random text :stuckouttongue:' \ | |
| tr '[:upper:]' '[:lower:]' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const calcStringSum = string => { | |
if (!string) // trivial case | |
return 0; | |
if (string.indexOf('//') === 0) { // custom delimeter | |
const delimeter = string.split('\n')[0].replace('//', ''); | |
return reduceByDelimeter(delimeter, string.split('\n')[1]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
lg = !"git lg1" | |
lg1 = !"git lg1s --all" | |
lg2 = !"git lg2s --all" | |
lg3 = !"git lg3s --all" | |
lg4 = !"git lg4s --all" | |
lg1s = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' | |
lg3s = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)' | |
lg2s = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' |