Skip to content

Instantly share code, notes, and snippets.

Jochen Bedersdorfer beders

Block or report user

Report or block beders

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
@sudodoki
sudodoki / flatten-maps.clj
Last active Feb 25, 2019
Flatten nested maps using clojure / clojurescript using compound keys
View flatten-maps.clj
(defn get-key
[prefix key]
(if (nil? prefix)
key
(str prefix "-" key)))
(defn flatten-map-kvs
([map] (flatten-map-kvs map nil))
([map prefix]
(reduce
(fn [memo [k v]]
@ravihara
ravihara / jjs-require.js
Created Jan 13, 2016
CommonJS require function implementation for Nashorn / Java8
View jjs-require.js
// Based on https://github.com/nodyn/jvm-npm
"use strict";
(function() {
var System = java.lang.System,
File = java.io.File,
FileInputStream = java.io.FileInputStream,
StringBuilder = java.lang.StringBuilder,
BufferedReader = java.io.BufferedReader,
InputStreamReader = java.io.InputStreamReader;
@hiredman
hiredman / boot.cljs
Created Mar 15, 2013
clojurescript drag and drop
View boot.cljs
(defn handle-file-select [evt]
(.stopPropagation evt)
(.preventDefault evt)
(let [files (.-files (.-dataTransfer evt))]
(dotimes [i (.-length files)]
(let [rdr (js/FileReader.)
the-file (aget files i)]
(set! (.-onload rdr)
(fn [e]
(let [file-content (.-result (.-target e))
You can’t perform that action at this time.