Lately, I’ve been training some people outside of my day job in Clojure. This
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Create a Serverless stack with CloudFormation using Serverless Application Model | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
CSharpHelloWorld: | |
Type: AWS::Serverless::Function | |
Description: Use a lambda function to print Hello World | |
Properties: | |
Handler: csharplambda::CSharpFunction.HelloWorld::Handler | |
Runtime: dotnetcore1.0 |
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 boids | |
(:use [enchilada :only [canvas ctx value-of canvas-size]] | |
[jayq.core :only [show]] | |
[monet.core :only [animation-frame]] | |
[monet.canvas :only [save restore | |
begin-path move-to line-to close-path | |
stroke stroke-style fill fill-rect fill-style | |
rotate translate]] | |
[boids.rules :only [step make-boid]]) | |
(:require [boids.vector :refer [heading]])) |
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
; rewritten in Clojurescript from javascript (originally by Piotr Stosur: http://js1k.com/2013-spring/demo/1431) | |
(ns psychedelic-animation.demo | |
(:use [enchilada :only [canvas svg ctx]] | |
[jayq.core :only [show hide]] | |
[monet.core :only [animation-frame]] | |
[monet.canvas :only [fill-style fill-rect draw-image rotate translate]])) | |
(show canvas) | |
(hide svg) |
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
INFO global: Vagrant version: 1.6.2 | |
INFO global: Ruby version: 2.0.0 | |
INFO global: RubyGems version: 2.0.14 | |
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.2/bin/vagrant" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded" | |
INFO global: VAGRANT_INSTALLER_VERSION="2" | |
INFO global: VAGRANT_DETECTED_OS="Darwin" | |
INFO global: VAGRANT_INSTALLER_ENV="1" | |
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1" | |
INFO global: VAGRANT_LOG="debug" |
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 slow-seq [s ms] | |
(let [c (async/chan)] | |
(async/go | |
(loop [remain s] | |
(if (empty? remain) | |
(async/close! c) | |
(do | |
(async/<! (async/timeout ms)) | |
(async/>! c (take 10 remain)) | |
(recur (drop 10 remain)))))) |
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 string-calculator | |
"My implementation of http://osherove.com/tdd-kata-1/" | |
(:use [clojure.test :only (is)]) | |
(:require [clojure.tools.reader.edn :as edn] | |
[clojure.string :as string :refer [join split]])) | |
; CODE | |
(defn parse-numbers [x] | |
(map edn/read-string |
It's been incredibly difficult to get Windows boxes up on http://vagrantbox.es. Between licensing and trial keys, offering a windows box has been a challenge. Not anymore! With the Windows Vagrant Box Maker, a fully functional box is generated daily and can be downloaded whenever you need it!
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
public Thread getBarchartStream(Observer observer, String symbol, int interval, String intervalType, String startDate) { | |
Request request = new RequestBuilder("GET") | |
.setUrl(BASEURL + String.format("stream/barchart/%s/%s/%s/%s", | |
symbol, interval, intervalType, startDate)) | |
.addHeader("Content-Type", "application/x-www-form-urlencoded") | |
.addHeader("Authorization", "Bearer " + this.token.getAccess_token()) | |
.build(); | |
// create an event source | |
final StreamSource streamSource = new StreamSource<IntradayBar>(request, IntradayBar.class); |
NewerOlder