Skip to content

Instantly share code, notes, and snippets.

View neilmock's full-sized avatar

Neil Mock neilmock

View GitHub Profile
(ns plumbing.graph-async
(:require
[plumbing.fnk.pfnk :as pfnk]
[plumbing.fnk.schema :as schema]
[plumbing.core :as plumbing]
[plumbing.graph :as graph]))
;; async function has ^:async metadata, callback required key.
;; TODO: redo with just promises/futures once they have callback options
;; TODO: make nicer way to specify async fnks?
@avescodes
avescodes / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.
anonymous
anonymous / nn.clj
Created March 24, 2013 16:55
A neural network in Titan and Clojure implementing the xor function
(ns martha.core
(:require [clojurewerkz.titanium.graph :as g]
[clojurewerkz.titanium.vertices :as v]
[clojurewerkz.titanium.edges :as e]
[clojurewerkz.titanium.types :as t]
[ogre.core :as q]))
(def conf {:storage {:backend "embeddedcassandra"
:hostname "127.0.0.1"
:keyspace "martha"
@darkone23
darkone23 / net.cljs
Last active May 11, 2021 12:12
websocket as a cljs core.async channel
(ns example.net
(:require [goog.net.WebSocket]
[goog.events :refer (listen)]
[cljs.core.async :as async :refer (chan <! >! put! close)]
[cljs.core.async.impl.protocols :as proto])
(:require-macros [cljs.core.async.macros :refer (go)]))
(defn ws
"WebSocket as a core.async channel
returns a channel which delivers the ws chan then closes"
(ns react-cljs.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om]
[om.dom :as dom :include-macros true]
[cljs.core.async :refer [>! <! chan put! sliding-buffer]]))
(enable-console-print!)
(def app-state
(atom {:counters (into [] (map (fn [n] {:id n :count 0}) (range 10)))}))
@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@john2x
john2x / 00_destructuring.md
Last active May 29, 2024 00:25
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@nberger
nberger / reagent_infinite_scroll.cljs
Last active May 6, 2024 16:15
Reagent infinite scroll
(ns views.infinite-scroll
(:require
[reagent.core :as r]))
(defn- get-scroll-top []
(if (exists? (.-pageYOffset js/window))
(.-pageYOffset js/window)
(.-scrollTop (or (.-documentElement js/document)
(.-parentNode (.-body js/document))
(.-body js/document)))))
@jacobsalmela
jacobsalmela / ltsp.conf
Created April 21, 2016 16:36
dnsmasq config file for iPXE booting with an existing DHCP server
# Sample configuration for dnsmasq to function as a proxyDHCP server,
# enabling LTSP clients to boot when an external, unmodifiable DHCP
# server is present.
# The main dnsmasq configuration is in /etc/dnsmasq.conf;
# the contents of this script are added to the main configuration.
# You may modify the file to suit your needs.
# Don't function as a DNS server:
port=0