This file contains hidden or 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
#!/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 = [] |
This file contains hidden or 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
(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 %))) |
This file contains hidden or 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
(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" |