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
;;; How do I run a server effect on a DOM event? | |
;; button clicks, concurrent | |
(dom/button | |
(e/for [[e spend] (dom/OnAll "click")] | |
(spend (e/server (println "clicked"))))) | |
;; button clicks, serialized (backpressure the user, disable button) | |
(dom/button | |
(let [spend (e/Token (dom/On "click"))] |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<!-- 2023-03-24 Pi 16:05 --> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Println Driven Development, with a twist</title> | |
<meta name="author" content="Peter Nagy" /> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<!-- 2023-03-16 Št 08:40 --> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Why Electric Clojure is a big deal</title> | |
<meta name="author" content="Peter Nagy" /> |
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
#!/bin/zsh -f | |
set -uo pipefail | |
function pr { | |
print -- "!! $*" | |
$* | |
} | |
pr sudo pacman -S --needed pwgen docker docker-compose |
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 bb | |
(ns user | |
(:require | |
[clojure.edn :as edn] | |
[clojure.java.io :as io] | |
[clojure.string :as str] | |
[babashka.fs :as fs])) | |
(def wpms-kept 10) | |
(def drop-at-least 5) |
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
;; from https://github.com/codebrutale/harpoons | |
(ns harpoons.core | |
#?(:cljs (:require-macros harpoons.core))) | |
(defmacro non-nil | |
"Return the leftmost non-nil value. | |
The evaluation is short-circuiting and each form is evaluated at most once. |
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
Leiningen 2.8.1 on Java 1.8.0_181 OpenJDK 64-Bit Server VM | |
{:dependencies | |
([org.clojure/clojure "1.9.0"] [criterium/criterium "0.4.4"]), | |
:jvm-opts nil, | |
:eval-in nil} | |
Benchmark: get value in nested map | |
Mean(us) vs best Code |
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 factor-vm | |
USING: kernel io namespaces sequences io.launcher io.directories io.encodings.utf8 io.files io.files.info io.pathnames concurrency.messaging threads math tools.threads accessors calendar ; | |
IN: script | |
: git-clean? ( path -- t/f ) | |
[ "git status --untracked-files=no --porcelain" utf8 [ read1 not ] | |
with-process-reader* ] with-directory nip 0 = and ; | |
: git-pull ( path -- ) |
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
root@4e7f2ed9b46c:/tmp/hadoop-2.7.2# bin/hadoop checknative -a | |
16/05/12 12:51:03 WARN bzip2.Bzip2Factory: Failed to load/initialize native-bzip2 library system-native, will use pure-Java version | |
16/05/12 12:51:03 INFO zlib.ZlibFactory: Successfully loaded & initialized native-zlib library | |
Native library checking: | |
hadoop: true /tmp/hadoop-2.7.2/lib/native/libhadoop.so.1.0.0 | |
zlib: true /lib/x86_64-linux-gnu/libz.so.1 | |
snappy: true /usr/lib/libsnappy.so.1 | |
lz4: true revision:99 | |
bzip2: false | |
openssl: false Cannot load libcrypto.so (libcrypto.so: cannot open shared object file: No such file or directory)! |
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
/ # update-ca-certificates | |
/etc/ca-certificates/update.d/c_rehash: exec: line 2: /usr/bin/c_rehash: not found | |
run-parts: /etc/ca-certificates/update.d/c_rehash: exit status 2 |
NewerOlder