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
#!/bin/sh | |
# Set cursor | |
xsetroot -cursor_name left_ptr & | |
# Set background | |
xsetroot -solid black & | |
feh --bg-center background.png & | |
# Enable a second monitor if present | |
xrandr --output eDP1 --auto --output HDMI2 --auto --right-of eDP1 & |
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
escape C-p | |
bind Escape abort | |
bind u undo | |
bind b exec firefox | |
bind c slack | |
bind m spotify | |
set border 0 | |
set barpadding 0 0 0 0 | |
set padding 0 0 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
INFO global: Vagrant version: 1.8.1 | |
INFO global: Ruby version: 2.2.3 | |
INFO global: RubyGems version: 2.4.5.1 | |
INFO global: VAGRANT_OLD_ENV_SSH_TTY="/dev/ttys000" | |
INFO global: VAGRANT_OLD_ENV_MAIL="/var/mail/vagrant" | |
INFO global: VAGRANT_OLD_ENV_PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded" | |
INFO global: VAGRANT_OLD_ENV_SSH_CONNECTION="192.168.2.1 60992 192.168.2.133 22" | |
INFO global: VAGRANT_OLD_ENV_SSH_CLIENT="192.168.2.1 60992 22" | |
INFO global: VAGRANT_OLD_ENV_OLDPWD="/Users/vagrant" |
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
# Remove trailing whitespace | |
find . -not \( -name .git -prune \) -type f -print0 | LC_ALL=C xargs -0 sed -i '' -E "s/[[:blank:]]+$//" | |
# Add newline @ eof if missing | |
find . -type f -print0 | LC_ALL=C xargs -0 sed -i -e '$a\' file | |
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
# When you want the original versions of files during a rebase | |
git status | awk '/(both added|both modified):/ { | |
sub(/(both added|both modified):/, ""); print $1 | |
}' | xargs -n1 git checkout $(git show | awk ' /commit/ { print $2 }') | |
# When you don't want files added during a rebase | |
git status | awk '/added by them:/ { | |
sub(/added by them:/, ""); print $1 | |
}' | xargs -n1 git rm |
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
import math | |
def update(partial, total): | |
measurement_heuristic = int(math.floor(math.log10(total)) - 1)/3 | |
unit, divisor = { | |
0: ('B', 1), | |
1: ('kB', 1000), | |
2: ('MB', 1e6), | |
3: ('GB', 1e9), | |
4: ('TB', 1e12) |
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
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
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
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.4.3 |
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
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include -I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install 3.4.3 |
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
# Show hidden files | |
defaults write -g AppleShowAllFiles -bool true | |
killall Finder | |
# Hide desktop | |
defaults write com.apple.finder CreateDesktop false | |
killall Finder |