Skip to content

Instantly share code, notes, and snippets.

View eerohele's full-sized avatar

Eero Helenius eerohele

View GitHub Profile
@malcolmsparks
malcolmsparks / thoughts-on-yada.adoc
Last active January 22, 2023 19:24
Thoughts on yada

Thoughts on yada

Frameworks

Let’s define a framework as any library that contains one or more functions that accept callbacks.

Web frameworks are great for beginner developers who need to get stuff done. But they ultimately force you into a corner. In most applications, experienced developers need to retain control. Libraries are better.

@peterwang
peterwang / my-macros.clj
Last active November 11, 2021 09:48
Clojure Macro-writing Macros step by step.
;;; Clojure Macro-writing Macros step by step.
(ns my.macros)
;; => nil
;;;;;;;; ns and vars
*ns*
;; => #namespace[my.macros]
(def x 3)
;; => #'my.macros/x
@athos
athos / deps.edn
Last active June 21, 2023 00:15
Try on your terminal `clojure -Sdeps '{:deps {hello-clojure/hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :git/sha "099bdf7d565b2c35c1df601abf58514cc5276237"}}}' -M -m hello-clojure`
{:paths ["."]
:deps {clansi/clansi {:mvn/version "1.0.0"}}}
@bhb
bhb / blockchain-w-spec.md
Last active July 1, 2022 11:24
Building a blockchain, assisted by Clojure spec

Building a blockchain, assisted by Clojure spec

In an effort to gain at least a superficial understanding of the technical implementation of cryptocurrencies, I recently worked my way through "Learn Blockchains by Building One" using Clojure.

This was a good chance to experiment with using spec in new ways. At work, we primarily use spec to validate our global re-frame state and to validate data at system boundaries. For this project, I experimented with using instrumentation much more pervasively than I had done elsewhere.

This is not a guide to spec (there are already many excellent resources for this). Rather, it's an experience report exploring what went well, what is still missing, and quite a few unanswered questions for future research. If you have solutions for any of the problems I've presented, please let me know!

You don't need to know or care about blockchains to understand the code be

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@reborg
reborg / rich-already-answered-that.md
Last active May 8, 2024 14:20
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

hiredman [6:39 PM]

I just don't understand why people use mount, I must be missing something, its model of each namespace as a component, with state as a global thing in a namespace(maybe I am mistunderstanding this), just seems bad, like sticking (def state (atom {})) in every namespace would be

[6:41] https://github.com/tolitius/mount/blob/master/src/mount/core.cljc#L10-L14

GitHub tolitius/mount mount - managing Clojure and ClojureScript app state since (reset)

@gamma235
gamma235 / joc-logic.clj
Last active July 30, 2021 06:37
Joy of Clojure, updated core.logic examples
(ns logic.core
(:require [clojure.core.logic.pldb :as pldb] ;; facts are now stored in a logic database which requires the pldb ns
[clojure.core.logic.fd :as fd] ;; for constraint programming, no need to include include in project.clj
[clojure.core.logic :refer :all :exclude [record?]])) ;; I left out ":as :logic" for aesthetics
(run* [answer]
(== answer 5))
(run* [val1 val2]
(== {:a val1, :b 2}