Skip to content

Instantly share code, notes, and snippets.

View robashton's full-sized avatar
🍻
drinking

His Excellence Sir Professional of Rob upon Ashtonburyshirester robashton

🍻
drinking
View GitHub Profile

Starter prep the day before

I want a young and fresh starter, so I get it out of storage the day before, so

  • Morning the day before: discard and feed 50g/50g water/flour
  • Evening the day before: discard and feed 50g/50g water flour

Prep on the day

@robashton
robashton / gist.markdown
Last active March 21, 2016 19:26
gist.m

On the recent rampant hypocrisy of self-righteous speakers speaking about speaking

There have been quite a few posts and videos made recently, written primarily as preachy lectures about conference behaviour both in and outside the conference.

  • Most of it is hypocritical in more ways than one
  • Nearly all of it is just to gain publicity for the people doing the speaking out
  • Nearly all of it is written in a way as so to be almost entirely unassailable because arguing against some of the points would mean bringing up dirt on all the people or conferences involved

On speaking at the conference

@robashton
robashton / entity.clj
Created November 10, 2013 17:50
polymorphism - am I doing it right?
(defmulti tick (fn [e] (if (:tick e) :custom :default)))
(defmethod tick :custom [entity] ((:tick entity) entity))
(defmethod tick :default [entity]
(-> entity
(update-in [:x] #(+ %1 (:velx entity)))
(update-in [:y] #(+ %1 (:vely entity)))))
(defmulti draw (fn [ctx e] (if (:draw e) :custom :default)))
(defmethod draw :custom [entity] ((:draw entity) ctx entity))
(defmethod draw :default [ctx {:keys [x y w h color]}]
(with-open [stream (db/stream-into "key")]
(binding [*out* (clojure.java.io/writer stream)]
(pr 2)
(pr "hello")
(pr { :hello "world"})
(.flush *out*)))
@robashton
robashton / blah.markdown
Last active December 26, 2015 18:29
Things I use on linux to make my life amazing
  • Xmonad
    • Can open a new terminal with alt-shift-return
    • Can change layout with alt-space
    • Can switch and resize windows using alt-HJKL
    • Can move windows around with shift-alt-JK
    • Alt-1-9 changes workspace
    • Alt-shift-1-9 moves windows to a workspace
  • The apple key
    • I have the Apple Key mapped to CTRL using XModmap
  • Chrome shortcuts are alll based on this - CTRL-W/T/TAB/R
(defn circle [x y r]
(->
(.append svg-container "circle")
(.attr "cx" x)
(.attr "cy" y)
(.attr "r" r)))
public class Dog
{
public string Id { get; set; }
public string Name { get; set; }
public string Breed { get; set; }
}
[Test]
public void BlindShardingDemo()
{
var shards = new Dictionary<string, IDocumentStore>
var http = require('http')
http.createServer(function(req, res) {
res.writeHead(200, {
'Content-Type': 'text/html',
'X-GeneratedBy': "NodeJS Bitches",
'X-MadeBy': 'An angry node developer',
'X-Extra': 'Seriously, Fuck rails. Fuck. Fuck. Fuck.'})
res.write([
'<html>',
@robashton
robashton / description.md
Last active December 18, 2015 14:09
Locality and Wasasbi

Fine, so we have the following code

    Routes.get("/customer',
           basicAuthentication
           {
               log.write("Inline logging dude")
               next()
           },
 {
json {
kv("name", "Rob Ashton")
kv("age", 5)
kv("address") {
kv("number", 444)
kv("line one", "never you mind")
}
kv("family", {
kv("name", "Gareth Ashton")
kv("relation", "brother")