Skip to content

Instantly share code, notes, and snippets.

View MichaelDrogalis's full-sized avatar

Michael Drogalis MichaelDrogalis

  • Confluent
  • Seattle, WA
View GitHub Profile
@lucastex
lucastex / Handler.java
Created April 13, 2011 17:38
Reading files from Amazon S3 directly in a java.net.URL object.
package sun.net.www.protocol.s3;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
import org.jets3t.service.ServiceException;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@stuarthalloway
stuarthalloway / gist:2645453
Created May 9, 2012 15:22
Datomic queries against Clojure collections
;; Datomic example code
(use '[datomic.api :only (db q) :as d])
;; ?answer binds a scalar
(q '[:find ?answer :in ?answer]
42)
;; of course you can bind more than one of anything
(q '[:find ?last ?first :in ?last ?first]
"Doe" "John")
@emaxerrno
emaxerrno / Installing zookeper and monitoring it
Created August 20, 2012 19:52
Zookeeper on ubuntu and monitoring
#!/bin/sh
echo "assumes java 7 is instlaled openjdk versio"
#pre dependencies
sudo apt-get install git-core pkg-config libtool automake make g++ connect-proxy unzip python
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
#install zeromq
git clone git clone git://github.com/zeromq/libzmq.git
@whoahbot
whoahbot / clojure-west.org
Last active October 13, 2016 07:41
Clojure west notes

Clojure West

Domain driven design with Clojure

  • Organizing larger applications
  • Domain logic shouldn’t include handlers for bad/unclean data.
    • validateur, bouncer, clj-schema for checking data going into the pipeline.
    • domain-specific, semantic checks
    • TODO: Any better ways for doing this conditional validation.
    • Need to factor out common data cleaning utils into shared library.
@willurd
willurd / web-servers.md
Last active July 22, 2024 15:25
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
(def c (chan))
(defn drain [c]
(go
(loop [col []]
(if-let [v (<! c)]
(recur (conj col v))
col))))
@bodil
bodil / webbit.clj
Created September 26, 2013 17:21
Basic Webbit adapter for Ring.
(ns ring.adapter.webbit
(:require [clojure.string :as s]
[clojure.java.io :as io])
(:import [org.webbitserver WebServer WebServers HttpHandler]
[java.io File InputStream]))
(defn- transform-headers [headers]
(apply hash-map (mapcat (fn [e] [(s/lower-case (.getKey e))
(.getValue e)]) headers)))
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell