Skip to content

Instantly share code, notes, and snippets.

View jasongilman's full-sized avatar

Jason Gilman jasongilman

  • Element 84
View GitHub Profile
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

graph TD
  A[Satellite Data Source] -->|Raw Data| B[Storage Bucket]
  B -->|SNS Messages| C[Queue]
  C -->|Trigger| D[Lambda Function]
  D -->|Process and Manipulate| E[Final Storage Bucket]
require 'uri'
# There's a bug in jboss or torquebox where encoded backslashes in URLs are incorrectly converted into forward slashes.
# This is rack middleware that detects when the original request included a backslash and will correct the env variable
# before forwarding it to the other middleware
# See https://issues.jboss.org/browse/TORQUE-955
class TorqueboxBackslashFixMiddleware
ENCODED_BACKSLASH = "%5C"
@jasongilman
jasongilman / transparent_functions.clj
Last active January 16, 2017 22:40
Transparent Functions
;; Transparent Functions
;; I was experimenting with transducers and wanted a way to understand how they worked. Transducer
;; code uses many nested functions in various locations with other nested functions defined as local
;; variables in scope. Typically after an anonymous Clojure function is defined you have no visibility
;; into the locals that were in scope when the function was defined, where the function came from,
;; or the code in the function. I defined a macro, tfn, that creates a transparent function. It's
;; a normal Clojure function with additional metadata including the function code and local
;; variable names and values.
@jasongilman
jasongilman / atom_canvas_block_decoration.js
Created June 7, 2016 00:24
Atom Canvas Block Decoration
// Paste this into the inspector in Atom.
var element = document.createElement('div')
var canvas = document.createElement("canvas")
element.appendChild(canvas)
element.style.setProperty("width", "100%")
element.style.setProperty("height", "150px")
canvas.style.setProperty("width", "100%")
canvas.style.setProperty("height", "100%")
canvas.style.setProperty("background-color", "white")
@jasongilman
jasongilman / multiplier.clj
Created September 9, 2012 23:56
high order function example
(defn multiplier [n]
(fn [x] (* x n)))
(def doubler (multiplier 2))
(doubler 7)
14
@jasongilman
jasongilman / incanter_example.clj
Created September 9, 2012 14:52
incanter from jruby
(ns clojure_helpers.incanter_helper
(:use (incanter core stats charts)))
(defn view-histogram [values]
(view (histogram values)))
@jasongilman
jasongilman / clojure_example.clj
Created September 8, 2012 01:24
Clojure example
(def users [{:first-name "William" :last-name "Hudson"}
{:first-name "Ellen" :last-name "Ripley"}
{:first-name "Dwayne" :last-name "Hicks"}
{:first-name "Carter" :last-name "Burke"}])
(def user {:first-name "William" :last-name "Hudson"})
(get :first-name user)
(:first-name user)