This file contains 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
❯ ./twitter_wordle.py | |
#Wordle 215 3/6 | |
⬛⬛⬛⬛🟩 | |
🟨⬛⬛⬛🟩 | |
🟩🟩🟩🟩🟩 | |
Lucky third guess | |
Day 215: 2266 candidates left |
This file contains 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
#! /usr/bin/env nix-shell | |
#! nix-shell -i bash --pure -p diffoscope nix | |
# shellcheck shell=bash | |
set -eo pipefail | |
if [[ -z "$1" ]]; then | |
cat <<EOF | |
usage: | |
./r13y.sh -A some.attribute |
This file contains 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
~/hash-test | |
➜ curl -L https://github.com/dhall-lang/dhall-haskell/releases/download/1.35.0/dhall-1.35.0-x86_64-linux.tar.bz2 --output dhall-original.tar.bz2 2>/dev/null | |
~/hash-test took 12s706ms | |
➜ mkdir dhall # create a directory to unpack into | |
~/hash-test | |
➜ (cd dhall && tar xvjf ../dhall-original.tar.bz2) | |
./ | |
./bin/ |
This file contains 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
# Add your Python code here. E.g. | |
from microbit import * | |
import random | |
def create_dots(dots): | |
s = "" | |
for y in range(5): | |
for x in range(5): | |
if (x, y) in dots: |
This file contains 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
➜ ghc -ddump-simpl Test.hs | |
[1 of 1] Compiling Main ( Test.hs, Test.o ) | |
==================== Tidy Core ==================== | |
Result size of Tidy Core | |
= {terms: 23, types: 12, coercions: 0, joins: 0/0} | |
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} | |
$trModule1_r1Eb :: GHC.Prim.Addr# | |
[GblId, Caf=NoCafRefs] |
This file contains 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
import Data.List | |
conv :: [Int] -> [Int] | |
conv = concat . f | |
where f [] = [] | |
f (x:xs) = map (x+) xs : f xs | |
inverseConv :: [Int] -> [Int] | |
inverseConv xs | |
| d == fromIntegral (round d) = inverseF $ inverseConcat n xs |
This file contains 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
-- This program genereates all computation steps that the | |
-- imperative algorithm InserSort would take while sorting a list. | |
-- The output might be further used for vizualizations of the | |
-- alorithm behavior. | |
-- Example usage: | |
-- insertSortSteps [3,2,1] | |
-- Result: | |
-- [Step {i = 0, j = 1, xs = [3,2,1]}, |
This file contains 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
100 | |
99 | |
98 | |
97 | |
96 | |
95 | |
94 | |
93 | |
92 |
This file contains 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
-- stack exec -- ghc -O2 Main.hs | |
-- cat input1.txt | ./Main --sound | aplay | |
module Main where | |
import Control.Applicative | |
import Data.List | |
import Data.Maybe | |
import Data.WAVE | |
import Notes |