Skip to content

Instantly share code, notes, and snippets.

Eero Helenius eerohele

Block or report user

Report or block eerohele

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
({})
View patient-nurse-spec.clj
(def app-db
{:nurses {"Nurse ID A" "Name A"
"Nurse ID B" "Name B"}
:patients [{:patient-id "Patient ID A"}
{:patient-id "Patient ID B"}]
;; A map that shows which nurse is assigned to which patient.
:assignments {"Patient ID A" "Nurse ID A"
"Patient ID B" "Nurse ID B"}})
@eerohele
eerohele / build.gradle.kts
Last active Jun 5, 2018
A Gradle Script Kotlin buildscript for building Saxon-HE (http://saxonica.com)
View build.gradle.kts
// README:
//
// Save this file and settings.gradle into a directory. Then:
//
// $ gradle
// $ gradle jar
// $ java -cp build/libs/saxon9he.jar net.sf.saxon.Transform <options>
import org.gradle.api.tasks.Copy
@eerohele
eerohele / xslt.clj
Last active Apr 21, 2017
Write XSLT with Clojure
View xslt.clj
(ns clj-xslt
(:require [clojure.data.xml :as xml])
(:import (java.time LocalDateTime)
(java.time.format DateTimeFormatter)
(java.io StringBufferInputStream StringWriter StringReader)
(javax.xml.transform.stream StreamSource)
(net.sf.saxon.s9api XsltCompiler Processor)
(net.sf.saxon Configuration)))
(def processor
@eerohele
eerohele / pain.clj
Last active Apr 14, 2017
Example of a Clojure Schematron implementation
View pain.clj
(ns ^:no-doc clojutron.examples.pain-mdr
(:require [clojure.java.io :as io]
[clojure.data.zip.xml :refer [xml1-> attr text]]
[clojutron.schema :refer :all]
[clojure.edn :as edn])
(:refer-clojure :exclude [assert])
(:import (org.iban4j BicUtil IbanUtil)))
(def iso4217-currency-codes
"Read the set of valid ISO 4217 currency codes from an EDN file."
@eerohele
eerohele / pain03-to-html.css
Last active May 22, 2017
Create a HTML representation of a Payments Initiation message (pain.001.001.03)
View pain03-to-html.css
:root {
--baseline: 1.5rem;
--background-color: #090415;
--text-color-default: #F9EEF9;
--text-color-code: #F9EEF9;
--color-emphasis-dark: #1B0C40;
--font-sans-serif: "Fira Sans", Helvetica, sans-serif;
--font-monospace: "Fira Mono", monospace;
}
You can’t perform that action at this time.