Skip to content

Instantly share code, notes, and snippets.

View cjbarre's full-sized avatar
💪
o.o

Cameron Barre cjbarre

💪
o.o
  • Portland, OR
View GitHub Profile
(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 #"_" "-")
(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)
(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))
@cjbarre
cjbarre / twitter_signed_multi_part_post_request_example.clj
Last active December 14, 2019 13:49
Example: Send A Signed Multi-Part Media HTTP POST Request With Clojure | Clojure, Twitter API, media/upload, OAuth 1.0, multipart/form-data, Authorization, Signed Request
;; 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!