Skip to content

Instantly share code, notes, and snippets.


coyotespike coyotespike

View GitHub Profile
View .spacemacs.el
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
;; Base distribution to use. This is a layer contained in the directory

Keybase proof

I hereby claim:

  • I am coyotespike on github.
  • I am coyotespike ( on keybase.
  • I have a public key ASC-bCxESFMNIqNoKUSDyoSkdDKZjPMaQaAsC-mOibUzjAo

To claim this, I am signing this object:

coyotespike / CSRF
Created Jul 21, 2015
Getting a CSRF token from Clojure to ClojureScript
;;; Here is my hackity approach. Start with Clojure:
(ns yourapp.handler
[yourapp.homepage :refer [home-page]]
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]))
(defroutes routes
(GET "/" [] (home-page *anti-forgery-token*)))
coyotespike / cljs-CSRF
Created Jun 25, 2015
CSRF in Clojure/ClojureScript
View cljs-CSRF
;; There are three parts to the problem:
;; (1) putting the token on the page on the server-side,
;; (2) getting it off on the client-side,
;; (3) and then POST-ing it with the request.
;;;; One could also GET and then POST using a route, but that makes the CSRF token useless.
; 1. Putting the token on the page.
; handler.clj