Skip to content

Instantly share code, notes, and snippets.

@greneholt
greneholt / QWERTY no option.keylayout
Created June 30, 2023 19:17
Mac QWERTY keyboard layout without bindings for the option key. This disables the annoying default behavior of key combinations like option+i that enters diacritic mode and prevents using such shortcuts in VS Code.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<keyboard group="0" id="5000" name="QWERTY no option" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="48" mapSet="312" />
</layouts>
<modifierMap id="48" defaultIndex="0">
<keyMapSelect mapIndex="0">
<modifier keys="" />
</keyMapSelect>
-- HANDLE SCROLLING
-- positive multiplier (== natural scrolling) makes mouse work like traditional scrollwheel
local scrollmult = -4
-- mouselog = hs.eventtap.new({'all'}, function(e)
-- print("event " .. e:getType())
-- end)
-- mouselog:start()
-- The were all events logged, when using `{"all"}`
@greneholt
greneholt / DefaultKeyBinding.dict
Last active January 8, 2024 20:15
Keybindings to make home and end move to the beginning and end of the line. Place in ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfLine:; // home
"\UF72B" = moveToEndOfLine:; // end
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
}
@greneholt
greneholt / karabiner.json
Last active January 5, 2024 23:03
Keyboard remapping with semicolon arrowkeys
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
#!/bin/bash
while getopts "c" opt; do
case "$opt" in
c)
color=1
;;
?)
exit 1
esac
@greneholt
greneholt / Dark Pastels Bold.colorscheme
Last active November 23, 2019 19:20
Dark pastels colorscheme for Konsole
[Background]
Color=44,44,44
Transparency=false
[BackgroundIntense]
Bold=true
Color=44,44,44
Transparency=false
[Color0]
@greneholt
greneholt / dark_pastels_bold.reg
Last active May 8, 2017 18:47
Dark pastels colorscheme for putty. Intended to be used with bold fonts.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"Colour0"="220,220,205"
"Colour1"="220,220,205"
"Colour2"="44,44,44"
"Colour3"="44,44,44"
"Colour4"="44,44,44"
"Colour5"="220,220,205"
"Colour6"="112,144,128"
@greneholt
greneholt / .profile
Created December 4, 2013 17:31
Semicolon arrow keys
if [ "$DISPLAY" ]
then
xmodmap - <<-EOF
! semicolon held movement commands:
! j = left
! k = down
! l = right
! i = up
! u = home
@greneholt
greneholt / threader.rb
Last active June 3, 2020 19:20
Ruby threaded task manager
class Threader
def initialize(max_threads = 50)
@max_threads = max_threads
@wait_queue = Queue.new
@tasks = []
@running_tasks = Set.new
@done_tasks = Set.new
end
# Add a task.
@greneholt
greneholt / .bash_common
Created May 24, 2013 03:57
Useful bash configuration
#if [ -f ~/.bash_common ]; then
# . ~/.bash_common
#fi
export CLICOLOR=1
export PS1="\[\e[7;32m\]\u\[\e[0m\] \[\e[7;36m\]\w\[\e[27;32m\]\$ \[\e[0m\]"
export EDITOR=vim
alias ll="ls -lh"