Skip to content

Instantly share code, notes, and snippets.

View szalai1's full-sized avatar
👣

Peter Szalai szalai1

👣
View GitHub Profile
@borkdude
borkdude / shell.nix
Created December 26, 2021 13:07
Mix and match older tools from nixpkgs
{ pkgs ? import <nixpkgs> {} }:
let
graalvm21_2_0 = import (builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "graalvm-21.2.0";
url = "https://github.com/NixOS/nixpkgs";
ref = "refs/heads/nixpkgs-unstable";
rev = "e4dda76e6397fb1e30b907abeaf6a72bb055a1e6";
}) {};
@borkdude
borkdude / aoc21_01.clj
Last active December 22, 2021 02:32
Advent of Code 2021 - in Clojure / babashka 0.6.8
(ns aoc21-01
(:require [clojure.string :as str]))
(def input (map parse-long (str/split-lines (slurp "input.txt"))))
(defn answer-01 [input]
(count (filter true? (map < input (rest input)))))
(def three-sliding-window
(map + input (next input) (nnext input)))