This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Mike Solomon @msol 2019 | |
| local log = hs.logger.new('main', 'info') | |
| DEVELOPING_THIS = false -- set to true to ease debugging | |
| HYPER = {'ctrl', 'shift', 'alt', 'cmd'} | |
| -- App bindings | |
| function setUpAppBindings() | |
| hyperFocusAll('w', 'React Native Debugger', 'Simulator', 'qemu-system-x86_64') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <item> | |
| <name>Tap shift to move over words</name> | |
| <appendix>Shift keys move the cursor one word forward or backward when pressed alone. When used with other keys they act as normal shifts.</appendix> | |
| <identifier>private.shifts_to_forward_backward_word</identifier> | |
| <autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L</autogen> | |
| <autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L</autogen> | |
| </item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <root> | |
| <item> | |
| <name>Tap shift to move wordwise</name> | |
| <appendix>Shifts move the cursor one word forward or backward when pressed alone. When used with other keys they act as normal shifts.</appendix> | |
| <identifier>private.shifts_to_forward_backward_word</identifier> | |
| <autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L</autogen> | |
| <autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L</autogen> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <item> | |
| <name>Use Programmer Dvorak - Qwerty Keyboard Layout</name> | |
| <appendix>(QWERTY to Programmer Dvorak)</appendix> | |
| <appendix>(+ Command,Control,Option+Keys to QWERTY)</appendix> | |
| <identifier>remap.qwerty2programmerdvorak_qwerty</identifier> | |
| <modifier_not> | |
| ModifierFlag::COMMAND_L, | |
| ModifierFlag::COMMAND_R, | |
| ModifierFlag::CONTROL_L, | |
| ModifierFlag::CONTROL_R, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <item> | |
| <name>Remap Caps Lock to Hyper with Escape on tap</name> | |
| <appendix>OS X doesn't have a Hyper. This maps caps lock (actually F19) to Control + Shift + Option + Command, unless you tap it. Then it sends Escape.</appendix> | |
| <identifier>caps_lock_to_hyper_or_escape</identifier> | |
| <autogen> | |
| --KeyOverlaidModifier-- | |
| KeyCode::F19, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Slate configuration file | |
| # Be sure to customize! See https://github.com/jigish/slate#configuring-slate | |
| ### Aliases | |
| ## Key aliases | |
| alias hyper ctrl;shift;alt;cmd | |
| ## Application aliases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function f() { find . -iname "*$1*" ${@:2} } | |
| function r() { grep "$1" ${@:2} -R . } | |
| # Better: use the silver searcher (brew install the_silver_searcher) | |
| alias f="ag -g" | |
| alias r=ag | |
| # Best: use ripgrep (brew install ripgrep) | |
| alias r=rg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <item> | |
| <name>Remap Caps Lock to Hyper</name> | |
| <appendix>OS X doesn't have a Hyper. This maps caps lock (actually F19) to Control + Shift + Option + Command.</appendix> | |
| <identifier>caps_lock_to_hyper</identifier> | |
| <autogen> | |
| --KeyToKey-- | |
| KeyCode::F19, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Mike Solomon | |
| class ScoreKeeper(object): | |
| def __init__(self): | |
| self.scores = [0] * 100 | |
| self.total = 0 # total scores inserted | |
| self.curr_median = None # current value of median | |
| self.curr_left_of = 0 # number of scores inserted < current median | |
| self.curr_right_of = 0 # number of scores inserted > current median | |
| def submit(self, score): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python -O | |
| # Mike Solomon | |
| # 2 Dec 2012 | |
| # MindSnacks engineering challenge 2 | |
| # usage: CirclePacker.py test_case_file | |
| import math, copy, sys | |
| class PackedCircle(object): |
NewerOlder