Skip to content

Instantly share code, notes, and snippets.

We wanted flying cars, instead we got GitHub status

Michael Klishin michaelklishin

We wanted flying cars, instead we got GitHub status
View GitHub Profile
prasincs / sha1-hash.clj
Created Feb 15, 2011
clojure sha1 hash
View sha1-hash.clj
(defn get-hash [type data]
(.digest ( type) (.getBytes data) ))
(defn sha1-hash [data]
(get-hash "sha1" data))
(defn get-hash-str [data-bytes]
(apply str
View gist:8135f58949e7a3144bf7
{deps, [
{eleveldb, {git, "", {branch, "master"}}}
[{override, eleveldb, [
{pre_hooks, [{compile, "c_src/ get-deps"},
{compile, "c_src/"}]},
{post_hooks, [{clean, "c_src/ clean"}]},
eliaslevy / gist:3042381
Created Jul 3, 2012
High level AMQP blocking publish method
View gist:3042381
# Helper method that publishes a message to an exchange and waits for a
# broker acknowledgement using RabbitMQ's publisher confirmation extension.
# Confirm mode must already be enabled in the channel. You can turn
# confirm mode on using channel.confirm_select. You must only do this
# once.
# It also raises an error if you use the mandatory and/or immediate
# options, and these constrains cannot be meet by the broker.
samuelclay / radix_trie.clj
Created Jan 22, 2013
A Radix Trie (aka PATRICIA trie) implemented in Clojure. For my JavaScript implementation, see this interactive JS fiddle:
View radix_trie.clj
(ns radix
(:require [clojure.string :as string]))
(use '
(use 'clojure.pprint)
(println "Loading names... ")
(time (def names
[rdr (reader
View gist:2851251
# Downloads and installs the startssl CA certs into the global java keystore
# Author: Klaus Reimer <>
# Check if JAVA_HOME is set
if [ "$JAVA_HOME" = "" ]
echo "ERROR: JAVA_HOME must be set."
cghsystems / copy_blobs.rb
Created Jan 8, 2014
This script will replace all soft linked Bosh blobs contained in $BOSH_RELEASE_DIR/blobs with hard links. This helps solve the issue of moving blobs from a created release to a new blobstore. After this script has run `bosh blobs` should show a set of blobs ready to be uploaded to a blobstore. Note: config/blobs will probably need removed.
View copy_blobs.rb
require 'fileutils'
require 'find'
def cp_symlink(f)
new_file = "#{f}.new"
old_file = File.readlink(f)
FileUtils.cp(old_file, new_file)
`rm -r #{f}`
File.rename(new_file, f)
puts "Processed #{f}"
geelen /
Created Sep 17, 2013
Real-world benchmarks
$ time ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
real 0m0.074s
user 0m0.006s
sys 0m0.012s
View 0.9.0pre8 jruby CPU
# run with "jruby --1.9 /path/to/this.rb" and wait 10 minutes
class Thing
def initialize
require 'cabin'
@logger =
sout =
@logger.level = :debug
jespada / haproxy.cfg
Created Mar 9, 2013
haproxy(1.5) + ssl + websockets (see comments on how to create a .pem file)
View haproxy.cfg
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
timeout connect 5s
timeout client 50s
timeout server 50s
FaKod / gist:1331556
Created Nov 1, 2011
The Neo4j Matrix Example with Neo4j-Scala
View gist:1331556
* The Matrix Example
case class Matrix(name: String, profession: String)
object TheMatrix extends App with Neo4jWrapper with EmbeddedGraphDatabaseServiceProvider {
ShutdownHookThread {
You can’t perform that action at this time.