Skip to content

Instantly share code, notes, and snippets.

View qleguennec's full-sized avatar

Quentin Le Guennec qleguennec

  • France
View GitHub Profile
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)
(defn prime-slieve
[f acc [p & coll]]
(if (nil? p)
acc
(recur f (f acc p) (doall (remove (partial div? p) coll)))))
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;
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);
console.log(cache);
console.log(cache[0]);
console.log([[1], [2]]);
/* => []
=> 0: Array[30]
length: 1
__proto__: Array[0]
=> undefined
=> [Array[1], Array[1]]*/
;;; 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,
{
"parser": "babel-eslint",
"plugins": [ "react" ],
"env": {
"browser": true,
"es6": true,
"node": true
},
"rules": {
"consistent-return": [0],
(rf/reg-fx
:POST
(fn [{:keys [url params on-success on-fail]}]
(take! (http/post url {:form-params params})
on-success)))
(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"
;; 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]} _]