Skip to content

Instantly share code, notes, and snippets.

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 Dec 11, 2018 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite
View GPG and git on macOS.md

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 Dec 17, 2018 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

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:

View homebrew_multiple_mysql_versions.md

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

View 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
View iTerm 2 Profile
{
"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 Mar 29, 2016 — forked from randym/date_styles.rb
Axlsx date formatting with custom styles and column formatting
View axlsx_date_styles.rb
$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 Nov 29, 2015
Archive Old Unread Gmail
View archive_inbox.gs
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();
}
View Toggle Hidden Files.workflow
(*
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 Apr 15, 2015
Toggle Wifi On/Off when Ethernet changes
View Auto Toggle Wifi on Mac.md

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