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
| 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
| 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
| 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
| 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
| 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
| nnoremap <expr> h col('.') == match(getline('.'), '\S') + 1 ? 'k$' : 'h' | |
| nnoremap <expr> l col('.') == strlen(getline('.')) ? 'j^' : '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
| snippet if | |
| if (${1}) { | |
| } | |
| endsnippet | |
| snippet sw | |
| switch (${1}) { | |
| case '': | |
| break | |
| default: |
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
| const postgres = require('../index') | |
| const getMessagesQuery = (serverId, channelName, connectionId) => | |
| postgres('ircMessages') | |
| .where({ serverId, to: channelName }) | |
| .where(function() { | |
| this.where({ isPublic: true }) | |
| if (connectionId) { | |
| this.orWhere({ connectionId }) | |
| } |