Skip to content

Instantly share code, notes, and snippets.

View hkjels's full-sized avatar

Henrik Kjerringvåg hkjels

View GitHub Profile
@hkjels
hkjels / sync-mail.el
Created September 25, 2022 15:07
Use mbsync periodically from within Emacs
(defun elan-sync-mail ()
"Synchronize mail-accounts using mbsync."
(interactive)
(if (get-buffer "*mbsync*")
(user-error "There is already a sync in progress")
(let* ((output-buffer (get-buffer-create "*mbsync*"))
(proc (progn
(async-shell-command "mbsync -q -a" output-buffer "*mbsync-error*")
(get-buffer-process output-buffer))))
(when (process-live-p proc)
const config = require('./metro.config.js');
const fs = require('fs');
const path = require('path');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const rnPath = fs.realpathSync(
path.resolve(require.resolve('react-native/package.json'), '..'),
);
const assetRegistryPath = fs.realpathSync(
@hkjels
hkjels / color-picker.el
Last active March 21, 2022 09:28 — forked from a3ammar/color-picker
Use OS X Color Picker in Emacs
(defun custom-color--choose-action (widget &optional _event) ; this function is only needed if you want to use color-picker in Easy Customization
"customize `widget-color--chose-action' to not split the screen"
(list-colors-display
nil nil
`(lambda (color)
(when (buffer-live-p ,(current-buffer))
(widget-value-set ',(widget-get widget :parent) color)
(pop-to-buffer ,(current-buffer))))))
(defun nscolor2hex (color)
@hkjels
hkjels / slack.md
Created November 20, 2020 15:01
Slack - Clojurians theme

Copy and paste these values to your Slack settings Sidebar Theme section: #5A80D9,#076570,#62B234,#FFFFFF,#93B3FD,#FFFFFF,#62B234,#F15340,#475FA1,#FFFFFF

elemental — intuitive defaults

;; Author: Henrik Kjerringvåg
;; Url: https://github.com/hkjels/elemental
;; Version: 0.0.1
;;; Commentary:
;; Elemental changes a lot of default configurations of Emacs to
;; be more intuitive and to improve performance.
;;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDC0WMiBfU+PRCHt429MjnCtCt/Ds+TRz9xBLxtJyDkdQbp+d9MQBVNwzp2kCIkgPBw4GKmQadbkejk5GcQ4rvwx/BBZxD3gQMuCat4WDPyptDSSevB2zQmSzEGLQh3RQdMnVu55/WGMVruOb0UzhtXp5+dffGY15XDKTI/gtLVSXqcr8yfOEH40kcpmYgSGzrJugyJrYKV8gWUQvw7DdRkKtYG8gkDv6DEQv4FqDCkLRmi0NlwC62kuXlDMCkuJdfkVdGgexrTUQicziKULzSwNOZwrPfXbgY8kdgmJs8u9kL0X4mwi1Chfb6ewrqHn9++kKJ++nTYSH9KLpappcsMp+773RiQ4NRPCnde2H9UY9LDA01nm1NwoEOwThoyOteL06TjhcCMjB8RBSLbSwioNmh8iYdCr0myXuTH/8EEtzd9K8GrE+Uh2pIee29PaNGA2sgbDbTm6nketj2HoRTYaPmi7OAc8it6Rg17dOcocXC2R34kUwBWIBnbgxEvIeWAM5iWKCQaeLr4Zm356F56rgyfrJEGJjdtz+oYne+qJRWveD9qCUroQxOHbN0EVrfamkSuwBXV6ahqPBFX6L2yn0kXu2Y4CFEl3axGygPMO1J151WGBbB9uXegauu4+2dK2gm7z/GjnPLDGjXbtyMZb7fp8fZFDaq9UymKbVXZww== henrik.kjerringvaag@telenordigital.com
@hkjels
hkjels / SketchSystems.spec
Created October 14, 2019 19:37
# Adding a name, implicitly groups the cluster(s)
# Adding a name, implicitly groups the cluster(s)
Name
Write name
Choose existing
# Determine order based user preference first and on quality second
People*
Click person -> Person
People edit mode
People add name -> Name
@hkjels
hkjels / SketchSystems.spec
Last active October 15, 2019 07:30
# Adding a name, implicitly groups the cluster(s)
# Adding a name, implicitly groups the cluster(s)
# You will also be able to choose an existing person to merge with
Name
Submit from search -> Search
Submit from person -> Person edit mode
# Determine order based user preference first and on quality second
People
Click person -> Person
People edit mode
@hkjels
hkjels / transpile.el
Last active January 21, 2019 13:27
Hook is run, code is executed, but the tangled files have the original content
(defun svg2code/transpileES5 ()
"Transpiles the current javascript-mode buffer from ES2015 to ES5"
(when (and (string-match ".js$" (buffer-file-name))
(not (string-match "exports.*" (buffer-file-name))))
(shell-command-on-region
(point-min) (point-max)
"babel --no-babelrc --compact false --presets env"
(current-buffer)
t
"*Babel Error Buffer*"
@hkjels
hkjels / SketchSystems.spec
Last active September 7, 2018 07:38
Nebula Reactive Flow
Nebula Reactive Flow
Data going in
SomeService
dispatch SomeAction -> StateStore
StateStore
portion of state -> Reducers
Reducers
modify state for next-tick -> Data going out