Skip to content

Instantly share code, notes, and snippets.

@philandstuff
philandstuff / euroclojure2014.org
Last active February 19, 2024 05:12
Euroclojure 2014

EuroClojure 2014, Krakow

Fergal Byrne, Clortex: Machine Intelligence based on Jeff Hawkins’ HTM Theory

  • @fergbyrne
  • HTM = Hierarchical Temporal Memory
  • Slides

big data

  • big data is like teenage sex
    • noone knows how to do it
    • everyone thinks everyone else is doing it
@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))
@jlongster
jlongster / app.js
Last active August 29, 2015 13:57
var dom = React.DOM;
var App = React.createClass({
getInitialState: function() {
return { todos: [] };
},
addTodo: function() {
this.setState(update(this.state) {
todos.push({ value: 'hello' });
@igorw
igorw / turel.clj
Last active August 29, 2015 13:57
(ns turel.core
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn not-membero
[x l]
(conde [(emptyo l)]
[(fresh [head tail]
(conso head tail l)
(!= head x)
@ghadishayban
ghadishayban / gist:7002262
Last active December 25, 2015 15:59
Regex split as Clojure reducer. Faster than java's Pattern.split(string)
;; Reimplementation of Java's (.split Pattern) to be zero-allocation, similar
;; to JDK 8 splitAsStream
;; Discards trailing ""
;; respects `clojure.core.reduced`
(defn split-string
[^CharSequence s ^java.util.regex.Pattern re]
(reify clojure.core.protocols/CollReduce
(coll-reduce [_ f init]
(let [m (re-matcher re s)
@jbenet
jbenet / simple-git-branching-model.md
Last active May 3, 2025 18:07
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@halgari
halgari / gist:6309500
Created August 22, 2013 16:24
Load balancer using core.async
(ns async-examples.load-balancer
(:require [clojure.core.async :refer :all]))
;; Let's assume we have a DB, and it holds the following pairs of name/ages
(def db-store
{:john 42
:amy 33
:jill 3
@bkirkbri
bkirkbri / core-async-helpers.clj
Last active December 21, 2015 12:59
Interfacing synchronous systems with core.async
(require [clojure.core.async
:refer [chan dropping-buffer thread <!! >!! >!]])
(defmacro try! [ch & body]
`(let [ch# ~ch]
(try ~@body (catch Throwable t#
(when ch# (>! ch# t#))))))
(defmacro try!! [ch & body]
`(let [ch# ~ch]
(defn take-until
([pred-sentinel in] (take-until pred-sentinel in (chan)))
([pred-sentinel in out]
(go (loop []
(if-let [v (<! in)]
(do
(>! out v)
(if-not (pred-sentinel v)
(recur)
(close! out)))
@jackrusher
jackrusher / OO.md
Created July 29, 2013 12:53
Gist blogging? Yet another exposition on the nature of OO programming.

Object-orientation

There are many articles and discussion threads on the web regarding the nature of Object-oriented (OO) programming. Most of them come at the question from a Programming Language Theory (PLT) perspective, attempting to assert a formal definition of OO programming and objects. I'm not going to do that here. Instead, I'm going to write about objects from an implementation perspective, approaching the subject first from below and then from above.