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
(require '[clojure.spec.alpha :as s]) | |
(defn hyphenize-keys | |
"Given a map, hyphenize the first level of keys." | |
[m] | |
(reduce #(assoc %1 | |
(-> (key %2) | |
name | |
str | |
(clojure.string/replace #"_" "-") |
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
(def name :capitalize-subscriber-name) | |
(def description | |
"Capitalize the subscriber name to increase the wow-factor.") | |
(def input (a/chan)) | |
(def output (a/chan)) | |
(def handler capitalize-subscriber-name) |
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 pipeline.articles.one | |
(:require [clojure.spec.alpha :as s] | |
[clojure.core.async :as a] | |
[clojure.string :as st])) | |
(defn capitalize-subscriber-name | |
[{subscriber :data :as message}] | |
(update subscriber | |
:name | |
st/upper-case)) |
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
;; Example: Send A Signed Multi-Part Media HTTP POST Request With Clojure | |
;; | |
;; Keywords: Clojure, Twitter API, media/upload, OAuth 1.0, multipart/form-data, Authorization, Signed Request | |
;; | |
;; Dependencies: [clj-http "2.2.0"] [clj-oauth "1.5.5"] | |
;; | |
;; Description: | |
;; The code is meant to read well as an example, not be idiomatic or efficiently organized. | |
;; | |
;; I am leaving the raw materials here, put it together how you'd like it! |