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
Company: An error occurred in auto-begin | |
Symbol’s value as variable is void: company-frontends | |
Error running timer ‘company-idle-begin’: (void-variable company-frontends) |
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
(defn prime-slieve | |
[f acc [p & coll]] | |
(if (nil? p) | |
acc | |
(recur f (f acc p) (doall (remove (partial div? p) coll))))) |
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
import React from 'react' | |
import PropTypes from 'prop-types' | |
import _ from 'lodash' | |
import List from '../components/list' | |
import './userScreen.css' | |
const repos_per_page = 30; |
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
if (!_.has(this.cache, page)) { | |
const requestWithAttributes = | |
_.reduce( | |
_.toPairs(requestAttributes) | |
, (acc, [a, b]) => acc + a + "=" + b + "&" | |
, request(userInfo) + "?"); | |
fetch(requestWithAttributes) | |
.then((resp) => resp.json()) | |
.then((result) => this.cache[page] = result); |
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
console.log(cache); | |
console.log(cache[0]); | |
console.log([[1], [2]]); | |
/* => [] | |
=> 0: Array[30] | |
length: 1 | |
__proto__: Array[0] | |
=> undefined | |
=> [Array[1], Array[1]]*/ |
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
;;; spaceline-segments.el --- Segments for spaceline | |
;; This file is not part of GNU Emacs. | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or | |
;; (at your option) any later version. | |
;; This program is distributed in the hope that it will be useful, |
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
{ | |
"parser": "babel-eslint", | |
"plugins": [ "react" ], | |
"env": { | |
"browser": true, | |
"es6": true, | |
"node": true | |
}, | |
"rules": { | |
"consistent-return": [0], |
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 | |
(fn [{:keys [url params on-success on-fail]}] | |
(take! (http/post url {:form-params params}) | |
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 #(assoc db :token (:access_token %)) | |
:on-fail :auth-nok | |
:params | |
{:grant_type "client_credentials" | |
:client_id "secret" |
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
;; event-db | |
(rf/reg-event-db | |
:auth/ok | |
(fn [db [_ resp]] | |
(assoc db :token (:access_token resp)))) | |
;; event-fx | |
(rf/reg-event-fx | |
:auth | |
(fn [{:keys [db]} _] |