Skip to content

Instantly share code, notes, and snippets.

View bradlucas's full-sized avatar

Brad Lucas bradlucas

View GitHub Profile
@bradlucas
bradlucas / clojure-spec-notes.org
Last active June 13, 2016 21:07
Clojure Spec Notes
@bradlucas
bradlucas / install-redis.sh
Created June 16, 2016 23:57 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@bradlucas
bradlucas / routes.clj
Created June 18, 2016 13:23 — forked from owainlewis/routes.clj
Testing Compojure applications in the REPL.
(defroutes app
(GET "/" [] "<h1>Index route</h1>")
(route/not-found "<h1>Page not found</h1>"))
(defn fake-request [routes uri method & params]
(let [localhost "127.0.0.1"]
(routes {:server-port 80
:server-name localhost
:remote-addr localhost
:uri uri
@bradlucas
bradlucas / rename-file-extensions-git.txt
Last active August 15, 2016 22:48
Rename file extensions in Git
To rename a group of file's extensions in Git
Build the GLOB before hand and verify with ls
for i in $(find . -iname "GLOB"); do
git mv "$i" "$(echo $i | rev | cut -d '.' -f 2- | rev).org";
done
@bradlucas
bradlucas / ax-meterstick-dev.org
Last active September 15, 2016 20:08 — forked from dpick/copy
Clojure postgres copy table

Testing Meterstick with ax-meterstick-dev

@bradlucas
bradlucas / install-redis.sh
Created September 17, 2016 12:22 — forked from dstroot/install-redis.sh
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@bradlucas
bradlucas / ns-cheatsheet.clj
Created September 17, 2016 17:00 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@bradlucas
bradlucas / show-running-postgres-queries.org
Last active September 24, 2016 12:18
show-running-postgres-queries.org
@bradlucas
bradlucas / etcd.md
Created December 8, 2016 17:08 — forked from diegopacheco/etcd.md
How to Build and Install Etcd on Amazon Linux / CentOS?

Install Go and git, Download Etcd from github and build

sudo yum install -y golang git
go version
sudo git clone https://github.com/coreos/etcd
cd etcd
sudo ./build
#!/bin/bash
# Startup script for etcd
#
# chkconfig: 2345 20 80
# description: Starts and stops etcd
. /etc/init.d/functions
prog="etcd"
ETCD_BIN=$(which etcd 2> /dev/null)