Skip to content

Instantly share code, notes, and snippets.


Michael Floering hangtwenty

View GitHub Profile
hangtwenty / how to change the text editor for code and text files on
Last active Jan 10, 2021
how to change the text editor that iterm2 opens when you ⌘+click on a filename, etc
View how to change the text editor for code and text files on

Well, I decided to just change my Mac's default text editor. It was the path of least resistance. I use VS Code and JetBrains mostly, but I want to open MacVim when I cmd+click a filename in a stacktrace.

First install duti.

brew install duti

To change the default text editor to MacVim

hangtwenty / meteor yarn - how to use yarn instead of npm with
Last active Jan 8, 2021
meteor + yarn - how to use yarn instead of npm with meteor
View meteor yarn - how to use yarn instead of npm with
hangtwenty /
Last active Dec 26, 2020
HOWTO xmobar with all extensions in Arch Linux
# install cabal-install if necessary
sudo pacman -S cabal-install
# preparing to install xmobar with all extensions
sudo pacman -S alex
yaourt haskell-language-c-03
sudo cabal install --global c2hs
sudo cabal install --global alsa-mixer
hangtwenty /
Created Dec 7, 2020
bash/zsh script - how to get absolute path to itself
export HERE="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# example usage - source a script in same directory. but using absolute path,
# ... which you'd do so that a script can be called from wherever. (not dependent on working directory ($PWD))
. "${HERE}/"
# ... or of course you could export DIRNAME or whatever you want.
# In scripts I just find "$HERE/node_modules", "$HERE/src" etc to be pretty readable.
hangtwenty /
Created Dec 1, 2020
JetBrains toolbox: Where are the IDEs located on my hard drive?

The default locations depend on your operating system:

  ~/Library/Application Support/JetBrains/Toolbox/apps


why you may need to customize shortcode syntax

  • elder.js self closing shortcodes look like this: {{foo bar="true"/}}. Note the / at the end is for Elder.js to parse both self closing and content wrapping shortcodes.
  • this clashes with other shortcode systems, eg., which uses shortcodes that look like this: {% youtube abc123 %}
  • in elder.config.js you can customize the start and end shortcode: {%foo bar="true"/%}
  • however that / there is non negotiable.
  • this is why you need to customize the shortcode syntax

the strategy is, if you use remark to process the text, to write a custom remark plugin to replace specifically this %} ending code of the shortcode to what Elder.js expects

hangtwenty /
Last active Sep 24, 2020
recursively convert nested dicts to nested namedtuples, giving you something like immutable object literals
from UserDict import IterableUserDict
import collections
__author__ = ''
def tupperware(mapping):
""" Convert mappings to 'tupperwares' recursively.
hangtwenty /
Last active Aug 17, 2020
blog draft: continuous learning is the keystone habit of software development. oh, and the other part: you have to get over yourself!

I've self-educated as a developer; now almost 10 years into it, it's worked out for me. But why? What was the deciding factor?

Looking back, I think I can see the inflection point.

I had a mentor who helped me use interactive approaches, and test-driven development. This led to a test-driven mindset.

The core of this mindset is the empirical attitude: that you can know nothing without testing. I learned to iterate in a more directed way. And by always beginning with failing tests,

hangtwenty /
Created May 12, 2020 — forked from pascalpoitras/
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 2.8-dev

Enable mouse

/mouse enable
You can’t perform that action at this time.