Skip to content

Instantly share code, notes, and snippets.

View henriksommerfeld's full-sized avatar

Henrik Sommerfeld henriksommerfeld

View GitHub Profile
@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"
@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 / 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"
},
const sortObject = (obj: any) =>
Object.keys(obj)
.sort()
.reduce((res, key) => ((res[key] = obj[key]), res), {} as any)
@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": {
@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);
}
});
#!/bin/sh
while inotifywait file.txt -e close_write; do { echo "test"; }; done
# trigger with echo '' > file.txt
@henriksommerfeld
henriksommerfeld / surfingkeys-settings.js
Last active July 15, 2024 20:29
Surfingkeys Settings
api.removeSearchAlias('b');
api.removeSearchAlias('w');
api.removeSearchAlias('e');
api.addSearchAlias('w', 'wikipedia', 'https://en.wikipedia.org/wiki/', 's', 'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&namespace=0&limit=40&search=', function(response) {
return JSON.parse(response.text)[1];
});
api.addSearchAlias('k', 'kagi', 'https://kagi.com/search?q=', 's', 'https://kagi.com/autosuggest?q=', function(response) {
const res = JSON.parse(response.text);
return res.map(r => r.t);
});