Skip to content

Instantly share code, notes, and snippets.

View spoon16's full-sized avatar
:shipit:

Eric Schoonover spoon16

:shipit:
  • Snohomish WA, Alexandria VA, and Costa Mesa CA
  • 13:05 (UTC -04:00)
View GitHub Profile
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path('$'))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
@spoon16
spoon16 / gist:3689043
Created September 10, 2012 05:27 — forked from Chouser/gist:3687532
Lazy seq as event subscription mechanism
;; Here is a spike of a lightweight in-process pubsub mechanism that allows pure ;; functional consumers, both blocking and asynchronous.
;; This defines the event stream, in this case just a series of numbers,
;; a new one produced each second
(defn timer []
(lazy-seq
(do
(Thread/sleep 1000)
(cons (System/nanoTime) (timer)))))
@spoon16
spoon16 / ReverseHW C#
Created October 22, 2011 21:03 — forked from blaineh/ReverseHW C#
Reverse Hello world C#
//namespace names this object.
namespace blaine
{
class helloworld
{
//Every program starts with a Main method.
//Static indicates that you can access this method without having an object of your class available.
//void indicates to the compiler that your method will not return a value to the calling method.
static void Main()
{