Skip to content

Instantly share code, notes, and snippets.

View danielneal's full-sized avatar

Daniel Neal danielneal

View GitHub Profile
@danielneal
danielneal / cfire
Created June 28, 2019 14:42 — forked from msimpson/cfire
Curses based ASCII art fire animation.
#!/usr/bin/python
import curses, random
screen = curses.initscr()
width = screen.getmaxyx()[1]
height = screen.getmaxyx()[0]
size = width*height
char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"]
b = []
(rf/reg-fx
:POST
;; on-success is a reframe event vector [:foo/bar ...]
(fn [{:keys [url params on-success on-fail]}]
(take! (http/post url {:form-params params})
;; conj the results into it so the response gets put into the event
;; like this:
;; [:foo/bar <result>]
#(re-frame.core/dispatch (conj on-success %)))
@danielneal
danielneal / events.cljs
Last active September 7, 2017 11:47 — forked from qleguennec/events.cljs
(rf/reg-event-fx
:auth
(fn [{:keys [db]} _]
{:POST
{:url "https://api.intra.42.fr/oauth/token"
:on-success [:auth/response-received]
:on-fail :auth-nok
:params
{:grant_type "client_credentials"
:client_id "secret"