Skip to content

Instantly share code, notes, and snippets.

@dadair-ca
dadair-ca / mock-ring-request.clj
Last active August 29, 2015 14:25
Ring-mock BufferedInputStream coersion
(testing "Access should be granted on valid credentials."
(is (= (app (mock/header (mock/request :get "/api/echo" {:m "hi"})
"authorization" "Basic Zm9vOmJhcg=="))
{:status 200 :body "hi"}))))
(comment
I'm trying to build a very simple clojurescript app using re-frame (& reagent, secretary),
and I am getting the following error in the console, that I can't seem to debug:
Error: No protocol method IDeref.-deref defined for type cljs.core/PersistentArrayMap: {:name "Black Temple", :snippet "25-man raid"}
)
(ns raid-commander.core
(:require [reagent.core :as reagent :refer [atom]]
[reagent.session :as session]
@dadair-ca
dadair-ca / gist:f490e9a63d1d771b5eeb
Last active March 22, 2020 13:00
Eco Public API Reverse Engineering
;; Hourly from yesterday morning up to current hour
http://www.eco-public.com/api/h7q239dd/data/periode/101017181/?begin=20150509&end=20150510&step=3
;; Totals from yesterday and (so far?) today
http://www.eco-public.com/api/h7q239dd/data/periode/101017181/?begin=20150509&end=20150510&step=4
;; Hourly for yesterday
http://www.eco-public.com/api/h7q239dd/data/periode/101017181/?begin=20150509&end=20150509&step=3
;; Hourly for today
@dadair-ca
dadair-ca / SDL-CMakeLists.txt
Created November 25, 2012 03:14
Minimal SDL CMakeLists.txt
project (PROJECT_NAME)
find_package (SDL REQUIRED)
set (SRC file1.cpp file2.cpp)
add_executable (EXECUTABLE_NAME ${SRC})
target_link_libraries(EXECUTABLE_NAME ${SDL_LIBRARY})
@dadair-ca
dadair-ca / gist:1491661
Created December 17, 2011 22:42
Current User Task
tasks_controller#index
had: @tasks = Task.all
should be: @tasks = current_user.tasks
so when I was displaying @tasks in the view, it had the entire table >.<