Skip to content

Instantly share code, notes, and snippets.

View michaelbrawn's full-sized avatar
My format: Guardian

Michael Brawn michaelbrawn

My format: Guardian
View GitHub Profile
michaelbrawn / Auto Toggle Wifi on
Created April 15, 2015 13:14
Toggle Wifi On/Off when Ethernet changes

Taken from

How To Automatically Turn Off Airport When Ethernet is Plugged In Filed under: Technology — kendall @ 7:24 pm When I’m at work, I plug in my Ethernet cable and turn off my AirPort wireless network adapter. This is partly because the wifi in my office is a bit unreliable but also because the wired network is a lot faster. It’s not a major hassle to do this manually–it’s only two clicks to turn it off or on. Sure, over time that has added up to over a thousand clicks, still no biggie. But also, sometimes I forget to turn my wireless back on and those few seconds it takes to realize that my wireless is off and turn it on is a mild irritation. It also seems to cause Google Chrome to crash, often. So, cumulatively it adds up to a minor headache. So, I thought I’d automate this. I am indebted to this post: Auto-disable AirPort when ethernet is active. Most of what you need to make this work you c

Author: Anil Natha
This script toggles the visibility of hidden files in OS X. This includes
showing hidden files in Finder windows and on the desktop.
Last Updated: 2015-02-20
tell application "System Events"
Atom Sync
michaelbrawn /
Created November 29, 2015 02:35
Archive Old Unread Gmail
function archiveInbox() {
// Every thread in your Inbox that is older than two days, and not starred.
var threads ='label:inbox older_than:2d -is:starred');
for (var i = 0; i < threads.length; i++)
michaelbrawn / axlsx_date_styles.rb
Last active March 29, 2016 01:49 — forked from randym/date_styles.rb
Axlsx date formatting with custom styles and column formatting
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
require 'axlsx'
require 'date'
p =
wb = p.workbook
wb.styles do |style|
# Date/Time Styles
"Profiles": [
"Working Directory" : "\/Users\/mbrawn",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 1,
"Red Component" : 0.8932039,
"Blue Component" : 1
michaelbrawn / Mohave Dynamic Background
Created June 6, 2018 21:25
Mohave Dynamic Background
-- Author: Michael Brawn (
on run
tell application "System Events"
set theName to name of current user
end tell
set pathName to "/Users/" & theName & "/Pictures/backgrounds/mohave/mojave_dynamic-" & hours of (current date) & ".jpeg"
tell application "Finder" to set desktop picture to POSIX file pathName

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

michaelbrawn /
Last active December 17, 2018 15:45 — forked from tombigel/
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in's Wayback Machine

Mac OS X

To check the current limits on your Mac OS X system, run:

michaelbrawn / GPG and git on
Last active December 11, 2018 15:45 — forked from danieleggert/GPG and git on
How to set up git to use the GPG Suite

GPG and git on macOS


brew cask install gpg-suite "/usr/local/Caskroom/gpg-suite/{{version}}/Install.pkg"

  1. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  2. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys --keyid-format LONG