Skip to content

Instantly share code, notes, and snippets.

View christianblunden's full-sized avatar
👋
hello

Christian Blunden christianblunden

👋
hello
View GitHub Profile
@christianblunden
christianblunden / MerjSawt.clj
Created March 20, 2012 17:51
TCO optimised Clojure implementation of Merge Sort
(ns merge_sort.core
(:use [clojure.java.io :only (reader)])
(:gen-class :main true))
(defn merj [left right]
(loop [[lhead & ltail :as left] left
[rhead & rtail :as right] right
result []]
(cond (nil? left) (concat result right)
(nil? right) (concat result left)
(ns tron.xianralph
(:require [tron.core :as tron]))
(defn move [[x y] [dx dy]] [(+ x dx) (+ y dy)])
(defn up [point] (move point [0 1]))
(defn down [point] (move point [0 -1]))
(defn right [point] (move point [1 0]))
(defn left [point] (move point [-1 0]))
(def directions #{up down right left})
@christianblunden
christianblunden / redshift-maintenance
Last active July 29, 2016 03:08
Redshift Maintenance scripts
-- Table Sizes & Rows
select
trim(pgdb.datname) as Database,
trim(pgn.nspname) as Schema,
trim(a.name) as Table,
b.mbytes,
a.rows
from (
select db_id, id, name, sum(rows) as rows
from stv_tbl_perm a
@christianblunden
christianblunden / clojurebridge-shapes.cljs
Created February 20, 2020 16:54 — forked from londonclojurians/clojurebridge-shapes.cljs
ClojureBridge learning path using Maria.cloud - fork me and explore Clojure using shapes, colours and animation
;; # Colours and Shapes in Clojure
;; This web page allows you to ask your computer to do tasks for you, specifically draw one or more shapes and change the colour of those shapes. We ask the computer to do these tasks in a programming language called Clojure.
;; Clojure is a functional programming language. The behaviour of your code is expressed by calling one or more functions.
;; Each function has a particular thing it does when you call it. We will discover functions that:
;; * draw particular shapes