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 System.Directory | |
main = do | |
let dirPath = "/home/exarkun/" | |
setCurrentDirectory dirPath | |
getCurrentDirectory >>= putStrLn | |
files <- getDirectoryContents dirPath | |
putStrLn $ show files |
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
forM_ | |
[ "CNAME" | |
, "favicon.ico" | |
, "robots.txt" | |
, "_config.yml" | |
, "images/*" | |
, "js/*" | |
, "fonts/*" | |
] | |
$ \f -> match f $ do |
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
distinctTTY = name: | |
let | |
# Does this systemd service have a TTY? | |
hasTTY = service: (service.serviceConfig.TTYPath or null) != null; | |
# Get only the systemd services that have a TTY. | |
ttyServices = self: services: lib.filterAttrs (name: value: name == self || hasTTY value) services; | |
# Get the names of some systemd services with a stable ordering. | |
serviceNames = services: builtins.sort (a: b: a < b) ( |
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
module Main where | |
import System.Environment (getArgs) | |
data A = A deriving Show | |
data B = B deriving Show | |
parseA :: String -> Maybe A | |
parseA "A" = Just A | |
parseA _ = Nothing |
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
from ..listeners import Listener | |
def _get_listeners() -> dict[str, Listener]: | |
return { | |
"tor": tor_provider, | |
"i2p": i2p_provider, | |
"foo": 123, | |
} | |
_LISTENERS: str = _get_listeners() |
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
└───x86_64-linux | |
├───default: package 'python3.8-tahoe-lafs-1.18.0.post1' | |
├───python310-tahoe-lafs: package 'python3.10-tahoe-lafs-1.18.0.post1' | |
├───python311-tahoe-lafs: package 'python3.11-tahoe-lafs-1.18.0.post1' | |
├───python38-tahoe-lafs: package 'python3.8-tahoe-lafs-1.18.0.post1' | |
├───python39-tahoe-lafs: package 'python3.9-tahoe-lafs-1.18.0.post1' | |
└───python73-tahoe-lafs: package 'pypy3.9-tahoe-lafs-1.18.0.post1' |
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
def canPlaceItems(templateBox: tuple[T], items: tuple[T], box: tuple[T]): | |
return templateBox[len(box):len(box)+len(items)] == items | |
def placeItem(items: tuple[T], boxes: tuple[tuple[T]]) -> tuple[tuple[T]]: | |
for n, box in enumerate(boxes): | |
if canPlaceItem(items, box): | |
# It fits here, place it. | |
return boxes[:n] + (box + items,) + boxes[n + 1:] | |
# It fits nowhere, create a new box. |
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
📦 Including license file "/build/pycddl-0.4.0/LICENSE" | |
🍹 Building a mixed python/rust project | |
🔗 Found pyo3 bindings | |
💥 maturin failed | |
Caused by: Invalid python interpreter version |
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
collatz :: Integer -> Maybe Integer | |
collatz n | |
| n < 1 = Nothing | |
| n == 1 = Just 0 | |
| even n = fmap (+ 1) $ collatz (n `div` 2) | |
| odd n = fmap (+ 1) $ collatz (3 * n + 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
[mypy] | |
ignore_missing_imports = True | |
no_implicit_optional = True | |
plugins = mypy_zope:plugin | |
pretty = True | |
show_column_numbers = True | |
show_error_codes = True | |
strict_equality = True | |
warn_redundant_casts = True | |
warn_unused_configs = True |
NewerOlder