This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.IllegalStateException: Current state not XML_START_ELEMENT (1) but 6 | |
at com.fasterxml.jackson.dataformat.xml.deser.XmlTokenStream.repeatStartElement(XmlTokenStream.java:228) | |
at com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser.addVirtualWrapping(FromXmlParser.java:280) | |
at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer._configureParser(WrapperHandlingDeserializer.java:140) | |
at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:108) | |
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:230) | |
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:207) | |
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:23) | |
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:464) | |
at com.fa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Anything you type in here will be executed | |
;; immediately with the results shown on the | |
;; right. | |
;; Anything you type in here will be executed | |
;; immediately with the results shown on the | |
;; right. | |
(defn- flatten-item | |
([item] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn slice | |
([] | |
(slice "hello world")) | |
([v] | |
(-slice v))) | |
(defprotocol Pizza | |
(-slice [this])) | |
(extend-type String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns myns | |
(:use [noir.core :only [defpage]] | |
[hiccup.form])) | |
(defpage "/my-form" | |
[] | |
(form-to [:post "/group-exporter/group.zip"] | |
(label "fristname" "First Name: ") | |
(text-field "firstname") | |
(submit-button "Submit"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
poon16@desk ~/src$ gem install knife-ec2 | |
Fetching: knife-ec2-0.5.14.gem (100%) | |
Successfully installed knife-ec2-0.5.14 | |
1 gem installed | |
Installing ri documentation for knife-ec2-0.5.14... | |
Installing RDoc documentation for knife-ec2-0.5.14... | |
spoon16@desk ~/src$ knife ec2 | |
FATAL: Cannot find sub command for: 'ec2' | |
The ec2 commands were moved to plugins in Chef 0.10 | |
You can install the plugin with `(sudo) gem install knife-ec2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lein repl | |
Deleting files generated by lein-cljsbuild. | |
Copying 1 file to /src/test/lib | |
Compiling ClojureScript. | |
Compiling "resources/public/js/test.js" from "src-cljs"... | |
Successfully compiled "resources/public/js/test.js" in 3.193873 seconds. | |
REPL started; server listening on localhost port 53484 | |
user=> (require '[cljs.repl :as repl]) | |
FileNotFoundException Could not locate cljs/repl__init.class or cljs/repl.clj on classpath: clojure.lang.RT.load (RT.java:430) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(into {} (filter second {"DelaySeconds" DelaySeconds | |
"MessageRetentionPeriod" MessageRetentionPeriod | |
"MaximumMessageSize" MaximumMessageSize | |
"VisibilityTimeout" VisibilityTimeout | |
"Policy" Policy})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol PCountryId | |
(country-id [c])) | |
(extend-protocol PCountryId | |
String (country-id [c] (country-id (NFCountry/findInstance c))) | |
clojure.lang.Keyword (country-id [c] (country-id (name c))) | |
NFCountry (country-id [c] (.getId c))) |
NewerOlder