Skip to content

Instantly share code, notes, and snippets.

View GEverding's full-sized avatar

Garrett Everding GEverding

View GitHub Profile
@GEverding
GEverding / promenade.clj
Last active March 14, 2018 18:50
Experimenting with Promenade Library
(require '[promenade.core :as prom])
(defn a [x] (prom/fail (str x)))
(defn b [x] (inc x))
(defn handle-error [failure] {:error (str "OH SNAP! " failure)})
(defn one [x] (prom/either->> x a b a b))
(defn two [] (prom/either->> 1 one one [handle-error]))
(two)
;; -----------------
@GEverding
GEverding / cluster.cjl
Created December 27, 2017 17:23
Atomix Bootstrap Cluster
(ns com.geverding.hermes.cluster.core
(:require [mount.core :as mount]
[clojure.tools.logging :as log]
[com.rave.hermes.config :refer (config)])
(:import io.atomix.core.Atomix
io.atomix.cluster.Node
io.atomix.cluster.Node$Type
io.atomix.messaging.Endpoint
))
@GEverding
GEverding / .spacemacs
Created January 26, 2015 15:09
spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
;; Configuration Layers
;; --------------------
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
@GEverding
GEverding / segment.clj
Last active August 29, 2015 14:10
Segment.io HTTP Api implement in Clojure
(ns server.analytics.segment
(:require [clj-http.client :as client]
[taoensso.timbre :as timbre]
[io.aviso.exception :as aviso]
[clojure.core.async :as async :refer (chan put! <! sliding-buffer go)]
[cheshire.core :refer (encode)]))
(timbre/refer-timbre)
(defonce ^:private endpoint "https://api.segment.io/v1")
@GEverding
GEverding / .hgrc
Created November 12, 2014 21:09
hg config
[ui]
username = Garrett Everding
[extensions]
# enable color extension
color =
# enable extdiff extension (Extended Diff)
hgext.extdiff =
purge =
graphlog =
@GEverding
GEverding / d3-fun.cljs
Created July 13, 2014 04:34
d3.js + reactjs/om + clojurescript
(defn graph [app owner opts]
(reify
om/IInitState
(init-state [_]
(let [data (:data app)
width (:width opts)
height (:height opts)
x (-> d3 .-time (.scale) (.range [0 width]))
y (-> d3 .-scale (.linear) (.range [height 0])) ]
{:width width
@GEverding
GEverding / graph.cljs
Created July 6, 2014 02:01
om + clojurescript + d3 reusable components
(ns client.views.graph
(:require-macros [cljs.core.async.macros :refer [go]] )
(:require [strokes :refer [d3]]
[dommy.utils :as utils]
[dommy.core :as dommy]
[cljs-time.core :as t :refer [now plus minutes hours]]
[cljs-time.coerce :refer [to-long from-long]]
[cljs.core.async :as async :refer [<! >! chan]]
[om.dom :as dom :include-macros true]
[om.core :as om :include-macros true]
data Artist = Artist { name :: Text
, url :: Text
, description :: Text
, imaage :: Text
, socialMedia :: [SocialMedia]
} deriving (Show, Eq)
data SocialMedia a = SocialMedia { username :: Text
, meta :: Text
} deriving (Show)

Keybase proof

I hereby claim:

  • I am geverding on github.
  • I am geverding (https://keybase.io/geverding) on keybase.
  • I have a public key whose fingerprint is 1D62 EFB6 6EB7 6A5A AE34 3B21 8D6A 7647 EC00 4E00

To claim this, I am signing this object:

@GEverding
GEverding / example2.scala
Created February 18, 2014 14:45
Playing around with scala
trait TestClass
case class TestClassA(val id: Int) extends TestClass
case class TestClassB(val name: String) extends TestClass
case class TestClassC(val arg: Float)
trait TestClassConverter[A <: TestClass, B <: TestClass] {
def toTestClass(a: A): B
}
class Tester(val name: String) extends TestClassConverter[TestClassA, TestClassB] {