Skip to content

Instantly share code, notes, and snippets.

@steenhansen
steenhansen / init.el
Last active September 1, 2019 05:47
emacs-init
;;;;
;; Packages
;;;;
;; Define package repositories
(require 'package)
(add-to-list 'package-archives
'("tromey" . "http://tromey.com/elpa/") t)
(add-to-list 'package-archives
@steenhansen
steenhansen / emacs-key-strokes.txt
Last active July 10, 2019 18:26
emacs-key-strokes
CHANGE-BUFFER Cx b CREATE_NEW_FILE Cx Cf /other_dir
[-------frame----------] NEW_FRAME Cx 5 2 DELETE_FRAME Cx 5 0
| window | window | WINDOW_V_SPLIT Cx 2 WINDOW_DELETE Cx 0
[----------------------] GROW Cx ^ WINDOW_H_SPLIT Cx 3
DIRED_COMMANDS
START_DIRED Cx d CREATE_DIR + OPEN_FILE_OR_DIR return
MARK_FILE m u U t DELETE_MARKED x SEARCH_MARKED A some_text
REPLACE_MARKED Q from_text to_text y/n/return
SELECT_TEXT
START_TEXT Cspace TEXT_END_CUT Cw UNDO C/
@steenhansen
steenhansen / grep-for-windows.txt
Last active July 13, 2019 06:04
Grep for Emacs in Windows
Get Gnu Grep installer
http://gnuwin32.sourceforge.net/packages/grep.htm
Run
grep-2.5.4-src-setup.exe
Install in
C:\Program Files (x86)\GnuWin32
To System.Path add
@steenhansen
steenhansen / clj.formatter
Created July 13, 2019 06:11
clojure formatter
lein cljfmt fix
:plugins [[lein-cljfmt "0.6.4"]]
@steenhansen
steenhansen / conemu.txt
Last active February 26, 2022 20:29
ConEmu start directory
ConEmu set start directory:
1 Settings | Startup
[x] Specified named tasck
{Shells::PowerShell (Admin)}
2 Settings | Startup | Tasks
6 {Shells::PowerShell (Admin)}
Task parameters Example:
/dir "D:\my-dir\my-subdir"
@steenhansen
steenhansen / .emacs.d-customizations
Created August 20, 2019 06:31
.emacs.d-customizations
delsel.el
editing.el
elisp-editing.el
frame-cmds.el
frame-fns.el
highlight-symbol.el
kmb.el
kmb-for-windows.el
misc.el
msb.el
let myConsole = (function(){
let the_log_buffer=[[]], the_count=0, the_single_line=false;
const THE_CONSOLE=console, LINE_DIVIDER=' ~ ', ONE_LINE='ONE_LINE',
PARAMETER_SEPARATOR= ', ', NEW_LINE = Symbol();
const start = (line_type='NOT_ONE_LINE') => {
the_log_buffer=[[]];
the_count=0;
the_single_line = line_type == ONE_LINE;
console = myConsole;
{
const Tuple = function(_expected_types) {
const expected_types = [...arguments];
const isNull = a_value => (a_value === undefined || a_value === null);
const anyNull = (found_null, the_value) => (found_null || isNull(the_value));
const showNulls = the_value => isNull(the_value) ? 'NULL' : the_value.toString();
const constructorName = a_value => Object.getPrototypeOf(a_value).constructor.name;
const scalarType = a_value => a_value.charAt(0).toUpperCase() + a_value.slice(1);
const tupleType = a_value => typeof a_value == 'object' ? objectType(a_value) : scalarType(typeof a_value);
/**
* ES6 versions of Either monad used in FP in JS
* Author: Luis Atencio
* https://github.com/luijar/functional-programming-js/blob/master/src/model/monad/Either.js
*/
// Run the below examples in the console
class Base_Either {
constructor(value) { this._value = value; }
/**
* Custom Maybe Monad used in FP in JS book written in ES6
* Author: Luis Atencio
* https://github.com/luijar/functional-programming-js/blob/master/src/model/monad/Maybe.js
*/
class Maybe {
static just(a) { return new Just(a); }
static nothing() { return new Nothing(); }
static fromNullable(a) { return (a !== null && a !== undefined) ? Maybe.just(a) : Maybe.nothing(); }
static of(a) { return Maybe.just(a); }