Skip to content

Instantly share code, notes, and snippets.

View lenaschoenburg's full-sized avatar

Lena Schönburg lenaschoenburg

View GitHub Profile
@bendlas
bendlas / user.clj
Last active March 10, 2016 14:47
block scoping for generating ids in edn
(require '[clojure.edn :as edn] '[clojure.zip :as zip] '[clojure.pprint :as pp])
(defrecord Kwid [kw])
(defrecord Dbid [part id])
(defn empty [o] ;; overwrite clojure's builtin, see http://dev.clojure.org/jira/browse/CLJ-1893
(if (instance? clojure.lang.MapEntry o)
[] (clojure.core/empty o)))
(def coll-zipper (partial zip/zipper coll? seq #(into (empty %1) %2)))
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
(defui Artist
static IQuery
(query [cl _]
[:db/id :artist/name])
Object
(render [{:keys [props]}]
(dom/div nil (:artist/name props))))
(defui ArtistList
static IQuery
(require 'cljs.repl)
(require 'cljs.closure)
(require 'cljs.repl.browser)
(require 'cljs.repl.node)
(defonce target (first *command-line-args*))
(defonce action (second *command-line-args*))
(defonce build (if (= action "watch")
cljs.closure/watch
@steveklabnik
steveklabnik / wc.rs
Created March 23, 2015 21:50
a little wc-like in rust
#![feature(collections)]
use std::io::prelude::*;
use std::fs::File;
use std::io::BufReader;
fn main() {
let args: Vec<String> = std::env::args().collect();
let filename = args[1].clone();
@StephenWakely
StephenWakely / selecttags.cljs
Created October 9, 2014 22:22
Select Tags Om component
(ns acme.selecttags
(:require-macros [cljs.core.async.macros :refer [go alt!]])
(:require [cljs.core.async :refer [put! <! >! chan timeout]]
[om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[acme.shared-controls :as shared]
[cljs-http.client :as http]
[acme.server :as server]
[clojure.string :as str]))
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@swannodette
swannodette / om_data.cljs
Last active January 9, 2021 16:09
Om + DataScript
(ns om-data.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[datascript :as d]))
(enable-console-print!)
(def schema {})
(def conn (d/create-conn schema))