Skip to content

Instantly share code, notes, and snippets.

View humpangle's full-sized avatar

Hump Angle humpangle

  • Baden Wuttemberg, Germany
View GitHub Profile
@humpangle
humpangle / apt-repo-playbook.yaml
Created January 17, 2024 22:42 — forked from roib20/apt-repo-playbook.yaml
Example usages of the new `deb822_repository` Ansible module
---
- hosts: localhost
connection: local
gather_facts: true
tasks:
- name: Add APT repositories
when: ansible_os_family == 'Debian'
become: true
block:
@humpangle
humpangle / Elixir_Supervision_Trees.md
Created May 23, 2022 05:27 — forked from gkaemmer/Elixir_Supervision_Trees.md
Quick guide to creating Elixir supervision trees from scratch

Elixir Supervision Trees Made Easy

I started with Elixir just a couple weeks after the switch from 1.4 to 1.5, so the bulk of online resources were out of date (or at least resulted in deprecation warnings). This guide is for defining Elixir 1.5 supervised modules.

It's not actually terribly complicated. It's just sometimes unclear from examples what's implemented by the language and what you actually have to implement yourself.

Say we want a supervision tree like this (where each atom is a process):

    :a

/ \

@humpangle
humpangle / better-netrw.vim
Created August 26, 2021 02:30 — forked from VonHeikemen/better-netrw.vim
Making a more intuitive netrw
" Open Netrw on the directory of the current file
nnoremap <leader>dd :Lexplore %:p:h<CR>
" Toggle the Netrw window
nnoremap <Leader>da :Lexplore<CR>
if &columns < 90
" If the screen is small, occupy half
let g:netrw_winsize = 50
else
@humpangle
humpangle / Dockerfile
Last active February 12, 2021 01:11
Dockerfile alternatives for heredoc multiline string
# https://gist.github.com/abn/a16e9d799312fb492861
RUN printf '%s\n' \
'#!/bin/bash' \
'' \
'set -xe' \
'' \
'INTERFACES="$(ip -o link | sed -ne "s/[[:digit:]]*: \\(eth[[:digit:]]*\\)[^$]*/\\1/p")"' \
'' \
'echo "${INTERFACES}"' \
#!/bin/bash
# https://www.reddit.com/r/neovim/comments/ldetyp/linux_script_to_install_neovim_nightly_with_a/
# Install Neovim Nightly on Linux and setup in as minimal way as possible to be like Visual Studio Code with TypeScript/Bash LSP support
# On first run it will give an error as the plugins are not installed yet, type :PlugInstall and then restart
# Typescript LSP needs a tsconfig.json in the project root directory to run, so use tsc --init
# Install Neovim
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
@humpangle
humpangle / more-about-pretty-and-usable-wsl-terminals.md
Created December 23, 2019 16:01 — forked from GregRos/more-about-pretty-and-usable-wsl-terminals.md
Some notes on "Configuring a pretty and usable terminal emulator for WSL"

These comments are based on a few years of experience working with WSL. It's based on this tutorial:

https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/

And are basically updates to make it more relevant.

Opening a shell

In the past, to make the WSL run a command from cmd or somewhere else, you had to run the bash.exe program from windows, which fired up bash (and always bash) in the WSL and made it execute a command.