Skip to content

Instantly share code, notes, and snippets.

@funkotron
funkotron / github-lang-count.clj
Created November 14, 2013 20:13
GitHub API Language Count
(ns crash-course-clojure.github
(:require [clj-http.client :as http]
[cheshire.core :refer [parse-string]]
[clojure.pprint :refer [pprint]]))
(defn query-github
"Run an arbitrary query agains Github's API."
[query]
(parse-string (:body (http/get "https://api.github.com/users/funkotron/repos"
@funkotron
funkotron / gist:7473547
Created November 14, 2013 20:12
Query Git for a list of repos - change the URL username
(ns crash-course-clojure.github
(:require [clj-http.client :as http]
[cheshire.core :refer [parse-string]]
[clojure.pprint :refer [pprint]]))
(defn query-github
"Run an arbitrary query agains Github's API."
[query]
(parse-string (:body (http/get "https://api.github.com/users/funkotron/repos"
@funkotron
funkotron / init
Last active December 20, 2015 00:39
Modified init script to keep existing password if arg given and keep existing /data dir if non empty for persistence of database
#!/bin/sh
set -e
mkdir -p /usr/share/zoneinfo /data
chown default /data
if [ $# -eq 1 ]
then
echo $1 > /pwfile
else
head -c 16 /dev/urandom | sha1sum | cut -c1-10 > /pwfile
fi
@funkotron
funkotron / docker_create_treeio.sh
Last active December 18, 2019 17:56
Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance.
#!/bin/bash
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance
# Also requires postgresql client tools http://www.postgresql.org/download/linux/ubuntu/
# Run chmod +x to make this file executable then run it: ./docker_create_treeio.sh
# Author: Adam Awan
# Email: adam@tree.io
# Set the port to forward for Tree.io
TREEIO_PORT="80"