Skip to content

Instantly share code, notes, and snippets.

Avatar

Eero Helenius eerohele

View GitHub Profile
View keys.pub
BEGIN MESSAGE.
ZlGCeaVIOme2sCc k7aM5azZDf8EwrX 4dUaIaKru5MOfW7 xDTolSOzxKTDA2f
q36EErpEcULTthd 1khuiM9BjaUTCKq 6Xr2MZHgg6smaIL BpjOvAsq7EbxijZ
fSj5kuHbySVTnuH YIWUnXY5GoHnZlS aqDRMsNR9btNJlP pzv7I0aNlDoMQsU
Z1imMSmbnfS2TgB avyYaeJjLH8GrrZ jTEzl0Qz5Z.
END MESSAGE.
View core.clj
(require '[clojure.main :as m])
(m/repl
:init #(apply require m/repl-requires)
:eval (fn [form]
(do
(require '[clojure.pprint :refer [pp pprint]])
(require '[hashp.core])
(eval form))))
@eerohele
eerohele / learnxinyminutes-clojure.markdown
Last active Nov 21, 2019
A Markdown version of the Clojure variant of learnxinyminutes https://learnxinyminutes.com/docs/clojure
View learnxinyminutes-clojure.markdown

This is a version of learnxinyminutes for Clojure adapted for use with Useless.

All I've done is lifted most of the comments out of the code blocks, removed the ; => bits, and some minor copy editing.


Clojure is a Lisp family language developed for the Java Virtual Machine. It has a much stronger emphasis on pure functional programming than Common Lisp, but includes several STM utilities to handle state as it comes up.

This combination allows it to handle concurrent processing very simply, and often automatically.

View core.async-walkthrough.markdown

core.async walkthrough

This is a Markdown version of the core.async walkthrough.clj.


This walkthrough introduces the core concepts of core.async.

The clojure.core.async namespace contains the public API.

@eerohele
eerohele / README.md
Last active Nov 18, 2019
A minimal, annotated example of using Clojure prepl with core.async
View README.md
  1. Acknowledge that you might actually want to use Propel instead of relying on this Gist.

  2. Clone this Gist:

    git clone https://gist.github.com/eerohele/e06551b115c6a31d1280a115c4c2abb2 prepl
  3. Open the project in your favorite editor/IDE.

  4. Start evaluating the forms in prepl.clj one by one.

View sudoku_compact.markdown

Sudoku

(ns sudoku
  (:refer-clojure :exclude [==])
  (:use clojure.core.logic))

(defn get-square [rows x y]
  (for [x (range x (+ x 3))
        y (range y (+ y 3))]
@eerohele
eerohele / possible-solutions.markdown
Last active Sep 4, 2019
shadow-cljs: shadow-cljs server shuts down with `RejectedExecutionException` when running `npx shadow-cljs watch app` (macOS)
View possible-solutions.markdown
  1. In your project.clj, try setting your maximum JVM heap size:

    :jvm-opts ["-Xmx2G"]
@eerohele
eerohele / cert.md
Last active Jan 11, 2019
shadow-cljs & mkcert
View cert.md

Using mkcert to generate a trusted certificate for ClojureScript development with shadow-cljs

NOTE: These instructions are a work in progress. Don't trust them yet.

Prerequisites

View error.txt
;; evaluating the hello-world namespace yields:
CompilerException clojure.lang.ExceptionInfo: Call to #'clojure.set/map-invert did not conform to spec:
db.clj:2708
-- Spec failed --------------------
Function arguments
({})
You can’t perform that action at this time.