Skip to content

Instantly share code, notes, and snippets.

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

Michael Brawn michaelbrawn

:octocat:
My format: Guardian
View GitHub Profile
@michaelbrawn
michaelbrawn / GPG and git on macOS.md
Last active December 11, 2018 15:45 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

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
@michaelbrawn
michaelbrawn / README.md
Last active December 17, 2018 15:45 — forked from tombigel/README.md
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 https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

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

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
michaelbrawn / Mohave Dynamic Background
Created June 6, 2018 21:25
Mohave Dynamic Background
-- Author: Michael Brawn (michaelbrawn.com)
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
{
"Profiles": [
{
"Working Directory" : "\/Users\/mbrawn",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 1,
"Red Component" : 0.8932039,
"Blue Component" : 1
},
@michaelbrawn
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 = Axlsx::Package.new
wb = p.workbook
wb.styles do |style|
# Date/Time Styles
#
@michaelbrawn
michaelbrawn / archive_inbox.gs
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 = GmailApp.search('label:inbox older_than:2d -is:starred');
for (var i = 0; i < threads.length; i++)
threads[i].moveToArchive();
}
Atom Sync
(*
Author: Anil Natha
Description:
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"
try
@michaelbrawn
michaelbrawn / Auto Toggle Wifi on Mac.md
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