Skip to content

Instantly share code, notes, and snippets.

View emjayoh's full-sized avatar

Matt Ogram emjayoh

View GitHub Profile

Change Apple OS X Dock size from Apple Terminal

defaults write com.apple.dock tilesize -int 32; killall Dock

32 is icon size

@emjayoh
emjayoh / osx-setup.sh
Created February 27, 2020 05:07 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
sudo find / -name ".DS_Store" -exec rm {} \;
# Remove all stored views for Finder
@emjayoh
emjayoh / caskfontinstall.sh
Last active April 19, 2021 06:55
[install all cask fonts] #fonts
/bin/zsh -c 'print -l "$(brew --repo caskroom/fonts)"/Casks/*(:t:r) | xargs brew cask install'
  • download VS Code as a .tar.gz from https://code.visualstudio.com/insiders/#linux
  • rename $HOME/.config/Code-Insiders/ (if you have it) to something else so we get a fresh start
  • unpack in a folder somewhere, be sure to have all permissions set to the current user and not root or anything like that
  • go to where you have unpacked vscode-insiders and look for the resources/app/extensions folder and rename it to extensions1 and create a new extensions folder - this should make it that vs-code runs without any 3rd party and without any built-in extensions
-='cd -'
..='cd ..'
...='cd ../..'
....=../../..
.....=../../../..
......=../../../../..
1='cd -'
2='cd -2'
3='cd -3'
4='cd -4'
@emjayoh
emjayoh / global-lolcommits-enable.sh
Last active March 5, 2020 18:19
Update lolcommits to work with all repos
# create a template dir for hooks (if you don't already have one)
mkdir -p ~/.git_template/hooks
# tell git to use this template dir (globally)
git config --global init.templatedir '~/.git_template'
# copy the post-commit hook from any existing lolcommits enabled repo
cp [path/to/lolcommit-enabled-repo]/.git/hooks/post-commit ~/.git_template/hooks/
# navigate to all existing local repos on your machine and run
@emjayoh
emjayoh / git-rm-whitespace.sh
Last active April 19, 2021 06:57
[git trailing whitespace] find all files with trailing whitepspace #git #whitespace #automation
#!/bin/sh
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Find files with trailing whitespace
for FILE in `exec git diff-index --check --cached $against -- | sed '/^[+-]/d' | sed -r 's/:[0-9]+:.*//' | uniq` ; do
@emjayoh
emjayoh / top-brew-packages.txt
Created May 7, 2020 13:27 — forked from pmkay/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
python: Interpreted, interactive, object-oriented programming language
mysql: Open source relational database management system
coreutils: GNU File, Shell, and Text utilities
openssl: SSL/TLS cryptography library
postgresql: Object-relational database system
@emjayoh
emjayoh / init.lua
Created May 8, 2020 01:02
Hammerspoon - kitty terminal + dropdown visor (Guake)
hs.hotkey.bind({}, "F15", function()
local app = hs.application.get("kitty")
if app then
if not app:mainWindow() then
app:selectMenuItem({"kitty", "New OS window"})
elseif app:isFrontmost() then
app:hide()
else
app:activate()