Skip to content

Instantly share code, notes, and snippets.

@ah45
ah45 / .profile
Last active August 29, 2015 14:01 — forked from blowmage/.profile
ohmygems
# configure the Ruby Gems environment
export RUBYOPT=rubygems
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"
export PATH="$HOME/.gem/bin:$PATH"
source ~/bin/ohmygems
@ah45
ah45 / user-data
Created September 26, 2014 14:45
CoreOS user-data file for a cluster running Progrium's service discovery tools (consul, registrator, and ambassadord)
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
# WARNING: replace each time you 'vagrant destroy'
discovery: https://discovery.etcd.io/new
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
fleet:
@ah45
ah45 / gist:59051b1a1fa5d1de74f1
Created October 9, 2014 11:47
ActiveDirectory objectGUID decoding
(ns active-directory.guid.util
(:require [clojure.string :as str]
[clojure.data.codec.base64 :as b64]))
(defn decode
"Decodes a Base64 encoded string into a sequence of bytes"
[b64s]
(b64/decode (.getBytes b64s)))
(defn byte->hex
@ah45
ah45 / defmethods.clj
Created March 18, 2015 15:48
defmethods macro
(defmacro defmethods
"A convenience over writing lots of short `defmethod` statements that
use the same arguments:
(defmulti mm (fn [o x y] o))
(defmethods mm [_ x y]
'+ (+ x y)
'- (- x y)
'* (* x y)
'/ (/ x y))
@ah45
ah45 / transit-xhr.cljs
Created April 17, 2015 14:14
Clojurescript Transit XHR Handler
(ns thoth.transit-xhr
(:require [cljs-time.format :as tf]
[cognitect.transit :as tr]
[com.cognitect.transit.types :as trt]
[goog.events :as events])
(:import [goog.net XhrIo]))
(def http-methods
"The HTTP request codes we support Transit payloads in."
{:get "GET"
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim p As Integer
For i = 1 To Worksheets.Count
If (Worksheets(i).Name <> "Data") Then
For p = 1 To Worksheets(i).PivotTables.Count
Worksheets(i).PivotTables(p).PivotCache.Refresh
Next p
End If
@ah45
ah45 / nested_map_zipper.clj
Created March 6, 2015 13:04
Editing Nested Maps from the bottom up with Clojure Zippers
(ns nested-map-zipper
(:require [clojure.zip :as zip]
[clojure.data :refer [diff]]))
(defmacro recur-if
([expr]
`(recur-if ~expr nil))
([expr else]
`(let [temp# ~expr]
(if temp# (recur temp#) ~else))))

F# SPA Live Development

Pieces of the puzzle:

  • F#
  • Fable
  • Webpack
  • Suave / Freya / the .NET web framework of your choice

Keybase proof

I hereby claim:

  • I am ah45 on github.
  • I am ah45 (https://keybase.io/ah45) on keybase.
  • I have a public key whose fingerprint is B072 177B 3D8C 46B3 7E95 2785 38BB DA97 7152 B5F2

To claim this, I am signing this object:

@ah45
ah45 / profiles.clj
Last active April 18, 2019 12:31
profiles.clj
{:test-refresh {:plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]]
:test-refresh {:notify-command ["terminal-notifier" "-title" "Tests" "-message"]
:quiet true
:changes-only true}}
:dev {:dependencies [[criterium "0.4.4"]]}
:cider-nrepl {:plugins [[cider/cider-nrepl "0.21.1"]
[refactor-nrepl "2.4.0"]]}
:eftest {:plugins [[lein-eftest "0.5.7"]]
:eftest {:multithread? :vars
:thread-count 4}}