Skip to content

Instantly share code, notes, and snippets.

View imrekoszo's full-sized avatar
🏠
Working from home

Imre Kószó imrekoszo

🏠
Working from home
View GitHub Profile
@imrekoszo
imrekoszo / letletfn.clj
Last active May 4, 2021 18:44
let% provides a mixed let + letfn macro. No mutual recursion tho
;; largely @emccue's implementation in https://clojurians-log.clojureverse.org/clojure on 2021-05-04
;; with a few fixes and adjustments
(defmacro let% [clauses & body]
(loop [clauses clauses
bindings []]
(if (empty? clauses)
`(let ~bindings ~@body)
(let [[fc & rcs] clauses]
(if (list? fc)
@imrekoszo
imrekoszo / problematic.clj
Last active March 13, 2020 22:10
Playing around with compiling clojure namespaces
(require '[clojure.set :as set]
'[clojure.string :as str]
'[clojure.tools.namespace.dir :as dir]
'[clojure.tools.namespace.find :as find]
'[clojure.tools.namespace.track :as track])
(defn create-tracker []
(->> {:platform find/clj
:add-all? true}
(dir/scan-dirs {} repl/refresh-dirs)))
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://fb.me/react-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.1/redux.js"></script>
</head>
@imrekoszo
imrekoszo / powershellboilerplate
Last active August 29, 2015 14:22
A simple powershell boilerplate for runnable scripts via http://joshua.poehls.me/powershell-script-boilerplate/
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
try
{
# do stuff here
}
finally
{