Skip to content

Instantly share code, notes, and snippets.


Chris Thompson teaforthecat

  • Saint Paul, MN
View GitHub Profile
levand /
Last active Aug 9, 2020
Advice about data modeling in Clojure

Since it has come up a few times, I thought I’d write up some of the basic ideas around domain modeling in Clojure, and how they relate to keyword names and Specs. Firmly grasping these concepts will help us all write code that is simpler, cleaner, and easier to understand.

Clojure is a data-oriented language: we’re all familiar with maps, vectors, sets, keywords, etc. However, while data is good, not all data is equally good. It’s still possible to write “bad” data in Clojure.

“Good” data is well defined and easy to read; there is never any ambiguity about what a given data structure represents. Messy data has inconsistent structure, and overloaded keys that can mean different things in different contexts. Good data represents domain entities and a logical model; bad data represents whatever was convenient for the programmer at a given moment. Good data stands on its own, and can be reasoned about without any other knowledge of the codebase; bad data is deeply and tightly coupled to specific generating and

Deraen /
Last active Oct 1, 2019
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
mbbx6spp /
Last active Sep 29, 2019
Example usage of the dancer shell (dsh). Used as partial material for the DevOps Tech Talk Topic meetup on 8/8/2013.

Distributed or Dancer Shell

Similar to ansible command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)

What does it do?

Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.

Getting Started

nathanlippi / gist:5923326
Last active Apr 15, 2016
Emacs + Tmux integrated window movement
View gist:5923326
;; Many thanks to the author of and contributors to the following posts:
;; TODO: Make a script that generates tmux and emacs code without duplication
;; NOTE: My keybindings are not the default emacs ones, using windmove
;; Try to move direction, which is supplied as arg
;; If cannot move that direction, send a tmux command to do appropriate move
View gist:3600897
# development.pp
stage { 'req-install': before => Stage['rvm-install'] }
class misc {
package {
ensure => installed,
equivalent /
Created Jul 5, 2012
Simple Form custom input for "Datepicker for Twitter Bootstrap" running under Ruby on Rails with Ransack search
# install and make run basic bootstrap date-picker functionality described here
# app/assets/javascript/
$(document).on 'pageChanged', ->
# datepicker for simple_form & Ransack
$(".custom_datepicker_selector").datepicker().on 'changeDate', (en) ->
correct_format = + '-' + ('0' + ( + 1)).slice(-2) + '-' + ('0' + # date format yyyy-mm-dd
bitonic / francesco.el
Created Jun 22, 2012
My emacs config
View francesco.el
;;; ===========================================================================
;;; Francesco's emacs config, <>
;;; Packages needed: paredit-el, wl-beta, auto-complete-el, haskell-mode,
;;; erlang-mode, w3m-el, bbdb, slime, elib, cscope-el
;;; Non-debian packages: distel, undo-tree, highlight-parentheses, agda2,
;;; sicstus, ghc-mod
;;; Additional dirs
(add-to-list 'load-path "~/.emacs.d/site-lisp/distel")
(add-to-list 'load-path "~/.emacs.d/site-lisp/sicstus")
salex / jekyll_uv_highlight.rb
Created Jul 18, 2010
Jekyll Plugin for Ultraviolet
View jekyll_uv_highlight.rb
module Jekyll
class UltravioletTag < Liquid::Block
require "Uv"
# This defines an uvhighlight tag for code highlighting using Ultraviolet (must [sudo] gem install ultraviolet and dependancies)
# Syntax for tag is {% uvhighlight code [theme] ["linenumb|linenos"]%} which is similar to the pygments call
# code is required, theme and linenumb optional and in any order
def initialize(tag_name, arg, tokens)
copy_files? # copy css files if not in css directory
View gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
You can’t perform that action at this time.