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 talk | |
(:require [overtone.core :refer :all] | |
[clojure.java.io :as io] | |
[clj-http.client :as http] | |
[clojure.test :as test])) | |
(def talk | |
{:title "Sequencing dance music with Clojure" | |
:author "Piotr Jagielski" | |
:company {:name "TouK" :what "Software house" :from "Warsaw, Poland"} |
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
use_bpm 100 | |
ch1 = [73, 68, 61] | |
ch2 = [76, 68, 61] | |
ch3 = [73, 68, 61] | |
ch4 = [73, 69, 54] | |
ch5 = [76, 69, 54] | |
ch6 = [73, 69, 54] | |
ch7 = [73, 69, 57] | |
ch8 = [76, 69, 57] |
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 talk | |
(:require [overtone.core :refer :all] | |
[clojure.java.io :as io])) | |
;; Overtone by Sam Aaron & Jeff Rose | |
;; https://github.com/overtone/overtone | |
(definst da-funk [freq 440 dur 1.0 amp 1.0 cutoff 1700 boost 6 dist-level 0.015] | |
(let [env (env-gen (adsr 0.3 0.7 0.5 0.3) (line:kr 1.0 0.0 dur) :action FREE) | |
filter-env (+ (* freq 0.15) |
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
use_bpm 130 | |
samps = "path_to_breaks" ## download from http://www.junglebreaks.co.uk/breaks.html | |
ch1 = [61,68,78] | |
ch2 = [61,68,76] | |
ch3 = [64,71,76] | |
ch4 = [59,66,75] | |
ch5 = [59,66,76] | |
ch6 = [57,64,76] |
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
use_bpm 130 | |
ch1 = [62,65,69] | |
ch2 = [63,67,70] | |
ch3 = [65,69,72] | |
ch4 = [67,70,74] | |
live_loop :saws do | |
use_synth :supersaw | |
with_synth_defaults sustain_level: 0.75, release: 1.25, cutoff: 130, amp: 1.5 do |
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 jinkubator.endpoint.api | |
(:require [compojure.api.sweet :refer :all] | |
[ring.util.http-response :refer [ok]] | |
[schema.core :as s])) | |
(s/defschema Message | |
{:message s/Str}) | |
(s/defschema MessageList | |
[Message]) |
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
[org.clojure/clojurescript "1.7.48"] | |
[org.clojure/core.async "0.1.346.0-17112a-alpha"] | |
[cljs-http "0.1.37"] | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [cljs-http.client :as http] | |
[cljs.core.async :refer [<! >! chan]])) | |
(defn rest-call [] | |
(go |
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 new duct clojure-web-app +example | |
lein repl | |
(go) | |
[ring/ring-json "0.3.1"] | |
[cheshire "5.1.1"] | |
[ring.middleware.json :refer [wrap-json-body wrap-json-response]] | |
[wrap-json-body {:keywords? true}] |
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
(deftest file-validation | |
(s/defschema FileSchema | |
{:file (s/maybe (s/both js/File (s/pred (fn [f] (if f (< (.-size f) 1000000))) 'large-file)))}) | |
(s/defn validated-file | |
[file :- [FileSchema]] 1) | |
(s/with-fn-validation | |
(is (= 1 (validated-file {:file nil}))))) |
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
package pl.allegro.tech.hermes.common.di; | |
import org.glassfish.hk2.api.DynamicConfiguration; | |
import org.glassfish.hk2.api.Factory; | |
import org.glassfish.hk2.utilities.Binder; | |
import org.glassfish.hk2.utilities.binding.ServiceBindingBuilder; | |
import org.glassfish.jersey.internal.inject.Injections; | |
@SuppressWarnings("unchecked") | |
public class InstantFactoryBinder { |