Skip to content

Instantly share code, notes, and snippets.

View henriksommerfeld's full-sized avatar

Henrik Sommerfeld henriksommerfeld

View GitHub Profile
#!/bin/sh
while inotifywait file.txt -e close_write; do { echo "test"; }; done
# trigger with echo '' > file.txt
@henriksommerfeld
henriksommerfeld / For duckduckgo.com
Last active January 12, 2021 20:07
Shortcut for putting focus on searchbox using cjs extension for chromium browsers
document.addEventListener('keydown', function (event) {
if (event.ctrlKey && event.key === 'f') {
const box = document.getElementById('search_form_input');
box.focus();
box.value = '';
window.scroll(0,0);
}
});
@henriksommerfeld
henriksommerfeld / karabiner.json
Created January 9, 2021 13:39
Karabiner settings
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
const sortObject = (obj: any) =>
Object.keys(obj)
.sort()
.reduce((res, key) => ((res[key] = obj[key]), res), {} as any)
@henriksommerfeld
henriksommerfeld / keybindings.json
Last active August 1, 2020 08:12
Toggling integrated terminal in VS Code with ⌘+ö
{
"key": "cmd+[Semicolon]",
"command": "workbench.action.terminal.focus",
"when": "!terminalFocus"
},
{
"key": "cmd+[Semicolon]",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
@henriksommerfeld
henriksommerfeld / DefaultKeyBinding.dict
Created February 25, 2020 11:17
Key bindings for Home and End keys on full size keyboard for macOS
{
"\UF729" = moveToBeginningOfLine:;
"\UF72B" = moveToEndOfLine:;
"$\UF729" = moveToBeginningOfLineAndModifySelection:;
"$\UF72B" = moveToEndOfLineAndModifySelection:;
}
@henriksommerfeld
henriksommerfeld / Brewfile
Last active April 10, 2021 15:17
Brewfile for my MacBook
tap "cjbassi/ytop"
tap "github/gh"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-drivers"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
tap "koekeishiya/formulae"