Skip to content

Instantly share code, notes, and snippets.

View jasongilman's full-sized avatar

Jason Gilman jasongilman

  • Element 84
View GitHub Profile
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]
@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 / atom_clojure_setup.md
Last active May 11, 2024 02:25
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.

# Note (clue): Exact queue size triggering the problem will depend on your available RAM
# Clean, compile, run C program:
rm a.out; cc -O3 -Wpedantic gc.c; time ./a.out 100000
# Clean, compile, run Java program:
rm *.class; javac GC.java; time java GC 100000
# Clean, compile, run Java program with verbose GC:
rm *.class; javac GC.java; time java -verbose:gc -XX:+PrintGCDetails GC 100000
@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.
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 / 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)))