Skip to content

Instantly share code, notes, and snippets.

View zhanghuabin's full-sized avatar

Huabin Zhang zhanghuabin

View GitHub Profile
;; Gaussian sum!
user=> (crit/with-progress-reporting (crit/quick-bench (/ (* (+ 1 99999) 99999) 2)))
Warming up for JIT optimisations 5000000000 ...
compilation occured before 333366 iterations
Estimating execution count ...
Sampling ...
Final GC...
Checking GC...
WARNING: Final GC required 8.548926352381509 % of runtime
Finding outliers ...
@zhanghuabin
zhanghuabin / gist:c37366145bef19856beccbe365648e48
Created July 11, 2016 18:10 — forked from halgari/gist:6309500
Load balancer using core.async
(ns async-examples.load-balancer
(:require [clojure.core.async :refer :all]))
;; Let's assume we have a DB, and it holds the following pairs of name/ages
(def db-store
{:john 42
:amy 33
:jill 3
apply plugin: 'java'
group = 'qa.webdriver'
subprojects {
apply plugin: 'java'
project.ext.sourceCompatibility = 1.6
repositories {
@zhanghuabin
zhanghuabin / curl.md
Created December 6, 2013 17:09 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin