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 airPods(deviceName) | |
| local s = [[ | |
| activate application "SystemUIServer" | |
| tell application "System Events" | |
| tell process "SystemUIServer" | |
| set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth") | |
| tell btMenu | |
| click | |
| ]] | |
| .. |
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
| video-to-gif() { | |
| FPS="${FPS:-10}" | |
| SCALE="${SCALE:-640}" | |
| ffmpeg -i "$@" -vf fps=$FPS,scale=$SCALE:-1:flags=lanczos,palettegen palette.png | |
| ffmpeg -i "$@" -i palette.png -filter_complex "fps=10,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" recording.gif | |
| rm palette.png | |
| } |
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
| config_path = os.getenv("HOME") .. "/.hammerspoon/" | |
| hs.pathwatcher.new(config_path, function(paths, flagTables) | |
| paths = hs.fnutils.ifilter(paths, function(path) | |
| return not path:ends('.git/index.lock') | |
| end) | |
| if #paths > 0 then | |
| hs.reload() | |
| end | |
| end):start() |
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
| local filter = hs.window.filter.new():setDefaultFilter{} | |
| filter:subscribe(hs.window.filter.windowCreated, function(window) | |
| local windowFrame = window:frame() | |
| local screenFrame = window:screen():frame() | |
| windowFrame.x = screenFrame.x | |
| windowFrame.y = screenFrame.y | |
| windowFrame.w = screenFrame.w | |
| windowFrame.h = screenFrame.h | |
| window:setFrame(windowFrame) | |
| end) |
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
| let g:ctrlp_map = '' | |
| function! CtrlP() | |
| if (getcwd() == $HOME) | |
| echo "Won't run in ~" | |
| return | |
| endif | |
| if (getcwd() == '/') | |
| echo "Won't run in /" | |
| return |
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
| let g:ctrlp_map = '' | |
| function! CtrlP() | |
| if (getcwd() == $HOME) | |
| echo "Won't run in ~" | |
| return | |
| endif | |
| if (getcwd() == '/') | |
| echo "Won't run in /" | |
| return |
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
| let g:ctrlp_user_command = { | |
| \ 'types': { | |
| \ 1: ['.git', 'cd %s && git ls-files -oc --exclude-standard'], | |
| \ 2: ['.hg', 'hg --cwd %s locate -I .'], | |
| \ }, | |
| \ 'fallback': 'find %s -type f -o -type l' | |
| \ } |
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
| hs.window.filter.new():setDefaultFilter{}:subscribe(hs.window.filter.windowCreated, function(window) | |
| local windowFrame = window:frame() | |
| local screenFrame = window:screen():frame() | |
| windowFrame.x = screenFrame.x | |
| windowFrame.y = screenFrame.y | |
| windowFrame.w = screenFrame.w | |
| windowFrame.h = screenFrame.h | |
| window:setFrame(windowFrame) | |
| end) |
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
| diff --git a/backend/package.json b/backend/package.json | |
| index 21a1462..166172c 100644 | |
| --- a/backend/package.json | |
| +++ b/backend/package.json | |
| @@ -9,6 +9,7 @@ | |
| "prettier": "^1.14.3" | |
| }, | |
| "dependencies": { | |
| + "@koa/cors": "^2.2.3", | |
| "bcrypt": "^3.0.0", |
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
| ! ~ python | |
| Python 2.7.16 (default, Mar 4 2019, 09:01:38) | |
| [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> 'f' in 'foo' | |
| True | |
| >>> keywords = ['foo', 'bar'] | |
| >>> text = 'lala foo' | |
| >>> [keyword for keyword in keywords if keyword in text] | |
| ['foo'] |