Skip to content

Instantly share code, notes, and snippets.

View adamrunner's full-sized avatar

Adam Runner adamrunner

View GitHub Profile
@adamrunner
adamrunner / vim_cheatsheet.md
Created September 19, 2016 23:13 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@adamrunner
adamrunner / new_mac_setup.md
Last active March 8, 2016 16:30 — forked from saetia/gist:1623487
Some steps to take when setting up a new mac

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Script used to quickly get a glance of how many queries since a certain time period were longer than X seconds
# Customize these 2 parameters
STARTDATE="140303" # 2 Digit Year, 2 Digit Month, 2 Digit Day
QUERYTIME=3.0
# Runs the commands and prints out Query_time lines
FIRST=`grep -n -m 1 "# Time: $STARTDATE" slow.log | cut -d : -f 1`; TOTAL=`wc -l slow.log | cut -d ' ' -f 1`; tail -n `echo "$TOTAL-$FIRST" | bc` slow.log | grep Query_time | awk -v time="$QUERYTIME" '$3 > time {print; }'