Skip to content

Instantly share code, notes, and snippets.

View PEZ's full-sized avatar
🎯
Focusing

Peter Strömberg PEZ

🎯
Focusing
View GitHub Profile
@PEZ
PEZ / aoc2020-day-4.clj
Last active December 4, 2020 22:13
Day 4, step 2, of Advent of Code 2020, using Clojure and coljure.spec. Not refactored or tidied up 😀.
(ns pez.aoc2020.day-4
(:require [clojure.string]
[clojure.spec.alpha :as s]
[pez.aoc2020.util :as util]))
(defn parse [card]
(->> (clojure.string/replace card #"\s" " ")
(re-seq #"(\S+):(\S+)")
(map rest)
(reduce
error 09:59:45.583077+0100 tccd identifier=com.obsproject.obs-studio, pid=4507, auid=501, euid=501, binary_path=/Applications/OBS.app/Contents/MacOS/obs attempted to call TCCAccessRequest for kTCCServiceAccessibility without the recommended com.apple.private.tcc.manager.check-by-audit-token entitlement
default 09:59:45.583406+0100 tccd AUTHREQ_ATTRIBUTION: msgID=4507.4, attribution={accessing={identifier=com.crowdcafe.windowmagnet, pid=2122, auid=501, euid=501, binary_path=/Applications/Magnet.app/Contents/MacOS/Magnet}, requesting={identifier=com.obsproject.obs-studio, pid=4507, auid=501, euid=501, binary_path=/Applications/OBS.app/Contents/MacOS/obs}, },
default 09:59:45.605627+0100 runningboardd Acquiring assertion targeting [app<application.com.obsproject.obs-studio.36873184.36873740(501)>:4507] from originator [daemon<com.apple.coreservices.launchservicesd>:101] with description <RBSAssertionDescriptor| "frontmost:4507" ID:177-101-1605 target:4507 attributes:[
<RBSDomainAttribute| domain:"com.apple.laun
@PEZ
PEZ / rich4clojure_easy_problem_118.clj
Last active November 7, 2024 22:53
Re-implement Map – Rich 4Clojure Problem 118 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.easy.problem-118
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Re-implement Map =
;; By 4Clojure user: semisight
;; Difficulty: Easy
;; Tags: [core-seqs]
;;
;; Map is one of the core elements of a functional
;; programming language. Given a function f and an input
@PEZ
PEZ / rich4clojure_elementary_problem_001.clj
Last active October 12, 2024 21:25
Nothing but the Truth – Rich 4Clojure Problem 1 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-001
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Nothing but the Truth =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; Define `__` or replace the `__` in the `(tests ...)`
;; form with a value which will make the test pass.
;;
@PEZ
PEZ / rich4clojure_elementary_problem_002.clj
Last active September 6, 2021 16:42
Simple Math – Rich 4Clojure Problem 2 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-002
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Simple Math =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; If you are not familiar with polish (prefix) notation,
;; simple arithmetic might seem confusing.
;;
@PEZ
PEZ / rich4clojure_easy_problem_039.clj
Last active October 31, 2024 05:40
Interleave Two Seqs – Rich 4Clojure Problem 39 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.easy.problem-039
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Interleave Two Seqs =
;; By 4Clojure user: dbyrne
;; Difficulty: Easy
;; Tags: [seqs core-functions]
;;
;; Write a function which takes two sequences and returns
;; the first item from each, then the second item from
@PEZ
PEZ / rich4clojure_hard_problem_178.clj
Last active July 25, 2021 16:58
Best Hand – Rich 4Clojure Problem 178 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.hard.problem-178
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Best Hand =
;; By 4Clojure user: toolkit
;; Difficulty: Hard
;; Tags: [strings game]
;;
;; Following on from Recognize Playing Cards, determine
;; the best poker hand that can be made with five cards.
@PEZ
PEZ / rich4clojure_elementary_problem_003.clj
Last active September 6, 2021 16:44
Intro to Strings – Rich 4Clojure Problem 3 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-003
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Intro to Strings =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; Clojure strings are Java strings. This means that you
;; can use any of the Java string methods on Clojure
;; strings.
@PEZ
PEZ / rich4clojure_elementary_problem_004.clj
Last active September 7, 2021 03:45
Intro to Lists – Rich 4Clojure Problem 4 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-004
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Intro to Lists =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; Lists can be constructed with either a function or a
;; quoted form.
;;
@PEZ
PEZ / rich4clojure_elementary_problem_006.clj
Last active November 1, 2024 20:47
Intro to Vectors – Rich 4Clojure Problem 6 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-006
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Intro to Vectors =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; Vectors can be constructed several ways. You can
;; compare them with lists.
;;