Skip to content

Instantly share code, notes, and snippets.

View whostolebenfrog's full-sized avatar

Ben Griffiths whostolebenfrog

View GitHub Profile
;; Clojure 1.5.1
=> 1
1
=> (require '[clojure.core.reducers :as r])
nil
=> (use 'clojure.repl)
nil
=> (doc r/fold)
-------------------------
clojure.core.reducers/fold
@whostolebenfrog
whostolebenfrog / bots.clj
Last active December 19, 2015 00:19 — forked from cgrand/bots.clj
;; the backup bot where my real one failed
;; function name is ben
(ns tron.bots
(:require [tron.core :as tron]))
(defn up [[x y]]
[x (dec y)])
(defn down [[x y]]
(ns tron.bots
(:require [tron.core :as tron]))
(defn up [[x y]]
[x (dec y)])
(defn down [[x y]]
[x (inc y)])
(defn left [[x y]]
@whostolebenfrog
whostolebenfrog / pres.md
Created March 7, 2013 10:20
Notes on: Instantly better presentations - Damian Conway

Instantly better presentations - Damian Conway

It probably just makes more sense to just view his version online at:

http://damian.conway.org/IBP.pdf

But making notes is useful anyway.

7 tips are

@whostolebenfrog
whostolebenfrog / performance_java.md
Created March 6, 2013 17:22
Notes on: Performance testing Java applications - Martin Thompson

Performance testing java applications - Martin Thompson

What is testing

Fast is generic, breaks down to: -- throughput -- bandwidth

-- latency -- response time

@whostolebenfrog
whostolebenfrog / neo_notes.md
Last active December 14, 2015 14:18
Notes on Becoming polyglot - putting neo4j into production. Toby O'Rourke

Neo4j - Becoming polyglot, Putting neo4j into production and what happened next

Bite the bullet - try something novel, they found that getting the tech in allows you to find new usecases and understand what and where it can be used.

Neo technology were the big player, OrientDB and Dex are new players with seemingly successful use. Graph space is becoming bigger. www.orientdb.org sparsity-technologies.com/dex

tinkerpop, Blueprints -> like jdbc for graphs? You don't have to program to the vendors APIs. This means you can compare between the various vendors without having to reimplement for each one. www.tinkerpop.com

@whostolebenfrog
whostolebenfrog / gcnotes
Created March 6, 2013 13:27
Notes from - Martjin Verburg - Garbage collection, the useful parts
Know more - Gil Tene
GC is about tracking live objects, not dead objects.
Poor GC -> OOM, high pauses, long pause times
Hotspot -> C/C++/Assembly
Heap is broken into several generations pools. [all this is tuneable]
-- Eden
(defroutes clean-routes
(GET "/1.x/status" [] (status-method-elsewhere))
(GET "/1.x/users/:userid/foo" [] (no-foo-here))
(GET "/1.x/users/:userid/bar" [] (keeps-routes-clean)))
(defroutes context-routes
(context "/1.x/users/:userid" req
(GET "/info" {params :params} (get-user-info params))
(POST "/info" [] (update-user-info! req))))
(ns secret-santa.core
(require [clojure.set :refer [difference]]))
;; note: only works if each person is in a single constraint
(def people #{:carole :ben :andrew :hillary :tom :dick :harry :barry})
(def constraints '([:carole :ben] [:andrew :hillary]))
(defn split