This file contains hidden or 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
(ns guestbook | |
(:require [cheshire.core :as cheshire] | |
[hiccup2.core :as hiccup] | |
[clojure.string :as str])) | |
(require '[babashka.pods :as pods]) | |
(pods/load-pod "./pod-babashka-postgresql") | |
(def db {:dbtype "postgresql" | |
:user "guestbook" |
This file contains hidden or 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
{ 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"; | |
}) {}; |
This file contains hidden or 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
$ bb nrepl-server | |
Started nREPL server at 127.0.0.1:1667 | |
For more info visit: https://book.babashka.org/#_nrepl | |
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x00007feb86c0ae00 ] ] | |
siginfo: si_signo: 11, si_code: 1, si_addr: 0x0000000000000039 | |
General purpose register values: | |
RAX 0x0000700003f2bf60 points into the stack for thread 0x00007feb86c0ae00 | |
RBX 0x0000000107d78120 points into the image heap (read-only huge) |
This file contains hidden or 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
(ns clojure.tools.build.util.zip | |
(:require | |
[clojure.java.io :as jio] | |
[clojure.string :as str]) | |
(:import | |
[java.io File BufferedInputStream FileInputStream FileOutputStream] | |
[java.nio.file Files LinkOption] | |
[java.nio.file.attribute BasicFileAttributes] | |
[java.util.zip ZipOutputStream ZipEntry])) |
This file contains hidden or 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
(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))) |
This file contains hidden or 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 bash | |
# temp file | |
t=/tmp/bipe.$$.txt | |
touch $t | |
# read from stdin | |
if [ ! -t 0 ]; then | |
cat > $t |
This file contains hidden or 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
(ns tools-namespace-lite | |
(:require [clojure.java.io :as io])) | |
(defn source? [f] | |
(re-matches #".*\.clj[cs]?$" (str f))) | |
(defn source-files [dir] | |
(filter source? (file-seq (io/file dir)))) | |
(defn find-namespaces-in-file [f] |
This file contains hidden or 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
;; deps.edn: | |
;; { | |
;; :deps { | |
;; clj-kondo/clj-kondo {:mvn/version "2021.10.19"} | |
;; org.clojars.quoll/asami {:mvn/version "2.2.3"} | |
;; } | |
;; } | |
This file contains hidden or 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
{:clojure.main/message | |
"Execution error (IOException) at java.lang.ProcessImpl/create (ProcessImpl.java:-2).\r\nCreateProcess error=206, The filename or extension is too long\r\n", | |
:clojure.main/triage | |
{:clojure.error/class java.io.IOException, | |
:clojure.error/line -2, | |
:clojure.error/cause | |
"CreateProcess error=206, The filename or extension is too long", | |
:clojure.error/symbol java.lang.ProcessImpl/create, | |
:clojure.error/source "ProcessImpl.java", | |
:clojure.error/phase :execution}, |
This file contains hidden or 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
(ns com.nextjournal.tests.browser.runner | |
(:require [clojure.string :as str] | |
[clojure.test :as t :refer [test-vars]] | |
[com.nextjournal.tests.browser.article-test-nbb :as article-test])) | |
(defmethod t/report [:cljs.test/default :begin-test-var] [m] | |
(println "===" (-> m :var meta :name)) | |
(println)) | |
(defn print-summary [] |