Skip to content

Instantly share code, notes, and snippets.

View anonimitoraf's full-sized avatar

Rafael Nicdao anonimitoraf

View GitHub Profile
@anonimitoraf
anonimitoraf / .vimrc
Created November 13, 2020 00:06
Minimal .vimrc for when I need to use vim in a barebones server
syntax on
filetype plugin indent on
" On pressing tab, insert 2 spaces
set expandtab
" show existing tab with 2 spaces width
set tabstop=2
set softtabstop=2
" when indenting with '>', use 2 spaces width
set shiftwidth=2
@anonimitoraf
anonimitoraf / init.el
Created November 2, 2020 17:52
Minimal emacs init.el
;; --- Package-management ---
;; Set up package.el to work with MELPA
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
;; --- Optimizations ---
@anonimitoraf
anonimitoraf / doom.txt
Last active June 21, 2020 08:51 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
-------------------------
Normal mode
-------------------------
--- Navigation ---
h Move cursor 1 char to the left
j Move cursor 1 char down
k Move cursor 1 char up
l Move cursor 1 char to the right
NOTE: When in Visual Char/Line/Block Mode, these navigation keys highlight stuff
w or e Sort of like "Ctrl ->" in typical text editors to move from word to word (I forgot the subtle diff between the 2)
@anonimitoraf
anonimitoraf / ns-cheatsheet.clj
Created April 12, 2020 13:04 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@anonimitoraf
anonimitoraf / promise-all.clj
Created March 10, 2020 12:36 — forked from abarnash/promise-all.clj
Clojure implementation of all(promises).then(...) pattern from JavaScript
(defn getPromiseFn
[aPromise]
(fn [num] (Thread/sleep 10000)
(deliver aPromise (str num " done"))))
(def proms [(promise) (promise) (promise)])
(def promFns (map getPromiseFn proms))
(future (map deref proms))
(future (map promFn (range 0 (count proms))))