Skip to content

Instantly share code, notes, and snippets.

@stuarthalloway
stuarthalloway / gist:5199642
Created March 19, 2013 20:11
Draw a pedestal dataflow with dorothy + Graphviz
;; from leiningen, use [dorothy/dorothy "0.0.3"]
(require '[dorothy.core :as dot])
;; dataflow copied from chat
;; https://github.com/pedestal/samples/blob/master/chat/chat-client/app/src/chat_client/behavior.clj
(def dataflow '{:transform
{:outbound {:init {} :fn outbound-transform}
:inbound {:init {} :fn inbound-transform}
:nickname {:init nil :fn nickname-transform}}
:effect {:outbound send-message-to-server}
@a2ndrade
a2ndrade / gist:5234370
Last active March 15, 2019 22:21
Datomic Pro Setup: MySQL
# download
wget http://downloads.datomic.com/0.8.3848/datomic-pro-0.8.3848.zip
unzip datomic-pro-X.X.zip & cd datomic-pro-X.X
# install as a maven artifact
./bin/maven-install
# configure transactor.properties
cp config/samples/sql-transactor-template.properties transactor.properties
# protocol=sql
@kartikshah
kartikshah / tail-color.sh
Created February 17, 2012 22:44
Color output of linux tail command
$tail -100f /var/log/applications/application.log | awk '
/INFO/ {print "\033[32m" $0 "\033[39m"}
/Exception/ {print "\033[31m" $0 "\033[39m"}
'
@stijlist
stijlist / gist:bb932fb93e22fe6260b2
Last active July 12, 2020 06:43
rich-hickey-mastery
Rich Hickey on becoming a better developer
Avatar
Rich Hickey • 3 years ago
Sorry, I have to disagree with the entire premise here.
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.
Mastery comes from a combination of at least several of the following:
@jordanorelli
jordanorelli / twopass.go
Created June 4, 2012 19:00
multi-stage json decoding in Go
package main
import (
"encoding/json"
"fmt"
"strings"
)
var (
stream = `
@film42
film42 / xv6-setup-yosemite.sh
Last active September 28, 2020 12:10
Get xv6 running with QEMU on OSX Yosemite
#! /usr/bin/env bash
# Get xv6 working with OSX Yosemite
# Most things were here: https://doesnotscale.com/compiling-xv6-on-os-x-10-9/
# You need homebrew installed to make this thing work
brew tap homebrew/versions && brew install gcc48
brew deps qemu | xargs brew install
export PATH=/usr/local/bin:$PATH
export CC=/usr/local/bin/gcc-4.8
brew install wget
@teropa
teropa / life.cljs
Created November 3, 2015 09:57
Conway's Life in ClojureScript
;; Credits:
;;
;; * ClojureScript
;; * Reagent https://reagent-project.github.io/
;; * Figwheel https://github.com/bhauman/lein-figwheel
;; * core.async https://clojure.github.io/core.async/
;; * Christophe Grand's Life implementation http://clj-me.cgrand.net/2011/08/19/conways-game-of-life/
(ns life.core
(:require [reagent.core :as r]
@Integralist
Integralist / remote-git.md
Created February 21, 2012 09:51
Basic set-up of remote git repository on a standard server

Set-up remote git repository on a standard server

The first thing to do is to install Git on the remote server.

Once you do that the rest of the process is split into three sections:

  1. Server set-up
  2. Local set-up (push commits)
  3. Server (pull commits)
@luanshiliuxng
luanshiliuxng / dns-subdomain-gandi-mailgun.txt
Created October 16, 2015 11:44 — forked from Dweez/dns-subdomain-gandi-mailgun.txt
Gandi subdomain DNS configuration for Mailgun validation
# Gandi subdomain DNS configuration for Mailgun validation
# - Add the SPF record as TXT and SPF
# - Suffix the DKIM record and `email` CNAME with the subdomain
# ex: `mg.domain.com`
mg 10800 IN CNAME mailgun.org.
@ 10800 IN SPF "v=spf1 include:mailgun.org ~all"
@ 10800 IN TXT "v=spf1 include:mailgun.org ~all"
mailo._domainkey.mg 10800 IN TXT "k=rsa; p=MIG...QAB"
email.mg 10800 IN CNAME mailgun.org.
@ 10800 IN MX 10 mxa.mailgun.org.
@ptaoussanis
ptaoussanis / free-port.clj
Created December 14, 2012 06:28
A little utility to allow simple redeployment of Clojure web servers with zero downtime, and without the need for a proxy or load balancer. Just wrap any port-binding calls, and the utility will auto kill pre-existing servers as necessary. *nix only. Based on the blog post by Feng Shen, http://shenfeng.me/fast-restart-clojure-webapp.html
;; (require '[clojure.string :as str] '[clojure.java.shell :as shell] '[taoensso.timbre :as timbre])
(defn with-free-port!
"Attempts to kill any current port-binding process, then repeatedly executes
nullary `bind-port!-fn` (which must return logical true on successful
binding). Returns the function's result when successful, else throws an
exception. *nix only.
This idea courtesy of Feng Shen, Ref. http://goo.gl/kEolu."
[port bind-port!-fn & {:keys [max-attempts sleep-ms]