Skip to content

Instantly share code, notes, and snippets.

View mryndzionek's full-sized avatar
👽
Focusing

mryndzionek

👽
Focusing
  • Gdańsk
View GitHub Profile
boats :: [Integer] -> Integer -> [[Integer]]
boats docksCapacities numberOfBoats = do
d <- mapM (\x -> [0..x]) docksCapacities
guard $ sum d == numberOfBoats
return d
solve :: [(Integer, [Integer])] -> [Integer] -> Integer
solve boatAreas docksCapacities = minimum $ do
a <- mapM (boats docksCapacities) boatSizes
guard $ foldr1 (zipWith (+)) a == docksCapacities
@mryndzionek
mryndzionek / stack.yaml
Created June 22, 2019 21:18 — forked from jkachmar/stack.yaml
GitHub Semantic w/ Stack
resolver: lts-13.23
packages:
- '.'
extra-deps:
- cmark-gfm-0.1.8
- haddocset-0.4.3
- http-client-0.6.4
- fastsum-0.1.1.0
- fused-effects-0.4.0.0
@mryndzionek
mryndzionek / diag.png
Last active January 7, 2020 01:53
Diag
diag.png
@mryndzionek
mryndzionek / adapter.png
Last active January 8, 2020 03:02
Switch adapter
adapter.png
@mryndzionek
mryndzionek / x12_sync.py
Last active February 29, 2020 10:23
Quick and dirty script for setting weather forecast and time on X12 smartband
#!/usr/bin/python3
import sys
import time
import datetime
import subprocess
import logging
import requests
icon_codes = {
@mryndzionek
mryndzionek / IMGP6815.JPG
Last active October 10, 2020 13:53
Atreus-like mechanical keyboard
IMGP6815.JPG
@mryndzionek
mryndzionek / HappyEyeballs.hs
Created January 10, 2021 11:02
Haskell implementation of the 'Happy Eyeballs' (also called 'Fast Fallback') algorithm - https://en.wikipedia.org/wiki/Happy_Eyeballs
#!/usr/bin/env stack
{- stack script
--compile
--copy-bins
--resolver lts-16.28
--install-ghc
--package "async random time monad-loops"
--ghc-options=-Wall
-}
@mryndzionek
mryndzionek / Cargo.toml
Last active October 20, 2021 03:35
Rust implementation of the 'Happy Eyeballs' (also called 'Fast Fallback') algorithm - https://en.wikipedia.org/wiki/Happy_Eyeballs
[package]
name = "happy_eyeballs"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = { version = "0.8" }
log = { version = "0.4" }
@mryndzionek
mryndzionek / cq_keyb_1.png
Last active February 6, 2022 20:08
Just an enclosure made in CadQuery 2
cq_keyb_1.png