Skip to content

Instantly share code, notes, and snippets.

View fmnoise's full-sized avatar
🇺🇦

fmnoise

🇺🇦
View GitHub Profile
@mfikes
mfikes / README.md
Last active December 12, 2019 12:08
ClojureScript parameter type inference

This is a demo of experimental work into ClojureScript parameter type inference.

The work is in a branch, and if you'd like to try out any of this yourself, you can start up a REPL based on the experimental branch using the following command, and play along at home:

clj -Srepro -Sdeps '{:deps {github-mfikes/gist-1e2341b48b882587500547f6ba19279d {:git/url "https://gist.github.com/mfikes/1e2341b48b882587500547f6ba19279d" :sha "55d6c6e9a1c4fc9b58fec74aef1af4aba57bad2a"}}}' -m cljs.main -co @compile-opts.edn -re node -r

To date, all ClojureScript inference "flows" in a certain direction, essentially from primitive values or type-hinted locals to their use sites. For example, consider this expression:

@pesterhazy
pesterhazy / configuring-zprint.md
Last active January 15, 2019 02:14
Customizing zprint

The zprint auto-formatter for Clojure comes with built-in defaults, but it is also highly customizable. The docs can be a bit daunting, so in what follows I will explain how to set some configuration options that are commonly used.

defn

By default, zprint will move the arg vector of defn forms to a separate line:

@kachayev
kachayev / aleph-planning.md
Last active December 12, 2022 16:28
A few thoughts on Aleph development

Aleph, Async, HTTP, Clojure

I've been working with Aleph rougly for last 5 years, actively contributing to the library for last 2 (or so). I also put some effort into spreading the word about it, including educational tech talks, like "Deep HTTP Dive Throught Aleph & Netty". But the more I talk to people the more confusion I find, mostly about how Aleph works and what can you expect when adding it to your stack. Clojurists Together has recently announced Aleph to get Q1 funding, I think it's a good time to share my priorities and thoughts on development plans that were mentioned in the blog post. Hope the community would find it interesting and helpful.

Aleph describes itself as "asynchronous communication for Clojure" library. And you should probably pay a good portion of your attention to the first word: "asynchronous".

@malcolmsparks
malcolmsparks / charset.clj
Created March 29, 2020 18:01
Parsing the RFC 7231 Accept-Charset header with reap
;; Accept-Charset = *( "," OWS ) ( ( charset / "*" ) [ weight ] ) *( OWS
;; "," [ OWS ( ( charset / "*" ) [ weight ] ) ] )
(let [parser
(let [charset-with-weight
(p/sequence-group
(p/alternatives
(p/pattern-parser
(re-pattern charset))
(p/pattern-parser
(re-pattern (re/re-str \*))))