Skip to content

Instantly share code, notes, and snippets.

View christianromney's full-sized avatar
🏠
Working from home

Christian Romney christianromney

🏠
Working from home
View GitHub Profile
@christianromney
christianromney / LDHkw.markdown
Created April 9, 2014 16:46
A Pen by Christian Romney.
@christianromney
christianromney / my-brews.txt
Created February 28, 2014 22:29
Tools I find useful
ack # search
ansible # config mgmt
apachetop # how's apache
apple-gcc42 # helps to build certain software
aria2 # faster downloads
asciidoc # documentation
aspell # for emacs/vim spell-checking
bazaar # every now and then I clone a repo hosted by ubuntu
brew-desc # get better descriptions of homebrew utils
casperjs # javascript testing and screenscraping
;; Geiser settings
(setq geiser-active-implementations '(racket))
(setq geiser-repl-startup-time 10000)
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
(setq geiser-repl-query-on-kill-p nil)
(setq geiser-implementations-alist
'(((regexp "\\.scm$") racket)
((regexp "\\.ss$") racket)
((regexp "\\.rkt$") racket)))
;; Geiser settings
(setq geiser-active-implementations '(racket))
(setq geiser-repl-startup-time 10000)
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
(setq geiser-repl-query-on-kill-p nil)
(setq geiser-implementations-alist
'(((regexp "\\.scm$") racket)
((regexp "\\.ss$") racket)
((regexp "\\.rkt$") racket)))
@christianromney
christianromney / abstraction.clj
Last active August 29, 2015 13:55
An example of how to define abstractions in Clojure
;; BinOp ::= [Symbol Operand Operand]
;; Operand ::= Number | BinaryOperation
(defprotocol Numerical
"A thing which has a numerical value"
(value [this]))
(defprotocol PrintableMathExpression
"A mathematical expression which can be printed
using infix or prefix notation"
(defn filter-col [a]
(filter (juxt #(< 30 %) odd?) a))
(defn report-results [col]
(println col)
col)
(-> (range 100)
filter-col
report-results)
@christianromney
christianromney / sum.rkt
Created December 24, 2013 18:39
Accompany mex.pdf
#lang racket
;; Non-tail
(define sum1
(λ (n)
(if (= n 0) n
(+ n (sum1 (- n 1))))))
(sum1 10)
/*
Hi, I'm Reservation.
I dont need an interface because I am a carrier of data.
Like a good carrier, I can be instantiated in any layer and used
in any other layer.
If you need to do stuff with me you should know to instantiate the correct
service and pass me to it.
Makes sense too since I you might need other classes to instantiate service
@christianromney
christianromney / core.clj
Last active December 20, 2015 01:09
Without comments to test Adrian
(ns async.core
(:require [clojure.core.async :as async :refer :all]
[clojure.data.generators :as gen])
(:gen-class))
(defrecord SyncMessage [text wake])
(defmacro forever [& body]
`(while true
~@body))
(ns async.core
(:require [clojure.core.async :as async :refer :all]
[clojure.core.async.lab :as lab]
[clojure.data.generators :as gen])
(:gen-class))
;; A Message carries some text to be communicated
;; and a wake channel which notifies the originator
;; that it may transmit again.
(defrecord Message [text wake])