Skip to content

Instantly share code, notes, and snippets.

View arifian's full-sized avatar

Arifian Rahardianda arifian

View GitHub Profile
;; instant ergoemacs, emacs 28.1 script for MacOS
(require 'package)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
@arifian
arifian / init.el
Created November 18, 2019 10:06
init el js v1
(require 'package)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; c setup
(defn group-by-red [f coll]
(r/fold 2048
(partial merge-with into)
(fn [groups a]
(let [k (f a)]
(assoc groups k (conj (get groups k []) a))))
coll))
@arifian
arifian / pedestalnotes.clj
Last active July 9, 2018 10:18
pedestal - component basic building block
(ns app.pedestal.component
"Connection between the Component framework and the Pedestal web application server.
inspired by: https://github.com/stuartsierra/component.pedestal/commit/9ee90960b86f84c02ec59848c6f34bd977c5e8d0"
(:require [com.stuartsierra.component :as component]
[io.pedestal.http :as http]
[io.pedestal.http.cors :as cors]
[io.pedestal.http.impl.servlet-interceptor :as servlet-interceptor]
[io.pedestal.interceptor :refer [interceptor interceptor-name]]))
@arifian
arifian / init.el
Last active November 18, 2019 10:10
Fresh emacs25 with ergoemacs + base16 + cider + which-key + neotree, init.el for clojure development. Auto install.
(require 'package)
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(unless (package-installed-p 'ergoemacs-mode)
@arifian
arifian / oauth_google.clj
Last active June 25, 2018 13:03
Clojure - Pedestal - Oauth2 - Google sign-in example. inspired by: https://blog.knoldus.com/2014/04/05/google-sign-in-using-clojure/
(ns oauth-google
(:require
[io.pedestal.interceptor :refer [interceptor]]
[io.pedestal.interceptor.chain :refer [terminate]]
[io.pedestal.http :as http]
[io.pedestal.log :as log]
[cheshire.core :as cheshire]
[clj-http.client :as client-clj]
[ring.util.response :as ring-resp]
[ring.util.codec :as codec]))