Skip to content

Instantly share code, notes, and snippets.

View mmacaulay's full-sized avatar
💭
Compiling

Matt MacAulay mmacaulay

💭
Compiling
View GitHub Profile
@mmacaulay
mmacaulay / gist:3b00653dfa077a93c7b3
Created March 19, 2015 00:11
Solarized Dark Slack Theme
#002B36,#073642,#073642,#268BD2,#073642,#839496,#B58900,#DC322F

Keybase proof

I hereby claim:

  • I am mmacaulay on github.
  • I am mmacaulay (https://keybase.io/mmacaulay) on keybase.
  • I have a public key whose fingerprint is 3C28 DEE3 125B F44C 8F3F 4307 868D 6232 C2EB ADD8

To claim this, I am signing this object:

@mmacaulay
mmacaulay / evernote.scpt
Created September 26, 2014 12:28
Import Notes.app notes to Evernote
tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
set myTitle to the name of thisMessage as string
set myText to the body of thisMessage
set myCreateDate to the creation date of thisMessage
set myModDate to the modification date of thisMessage
tell application "Evernote"
set myNote to create note with text myText title myTitle notebook "Imported" tags ["imported_from_Apple_notes"]
set the HTML content of myNote to myText
@mmacaulay
mmacaulay / vagrant-clean.sh
Last active August 29, 2015 14:04
Vagrant pre-package cleanup script
#!/bin/bash
# Courtesy of http://vmassuchetto.github.io/2013/08/14/reducing-a-vagrant-box-size/
# Unmount project
umount /vagrant
# Remove APT cache
apt-get clean -y
apt-get autoclean -y
["-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: OpenPGP.js VERSION\r\nComment: http://openpgpjs.org\r\n\r\nxo0EU2BWIAEEAJmj68gt4OuUWYzWUdRCxkyJriAvzJKOQ3mDzTy1bUVrCw7p\ndFdPvTwT5btGg6v4c2MXMGNnToIyqWal7lnkKI1eRLmkZntbPMACfwEo30ds\n3iFc3ZBcw66qjl2YFWozCpdC2XIf6y1wmMLBtBudBGo68zOO7tEnEifxh2tW\nwQDPABEBAAHNAMKyBBABCAAmBQJTYFYgBgsJCAcDAgkQdvgQUES2r4wEFQgC\nCgMWAgECGwMCHgEAAI6kA/44TBtUsNg5JkMO7BzimZMKT5oN6lD4OQoNYPKN\nVPPm/94BLv85pc6O1L1ElON+mBdD0LrgQBzogZeVeE72IthFC1pUKxmnmYEA\nN4nkY5k3J1iVWNioO4HU3uyhamJZEkrsKMRf6AbHNUyCHK0q5PFydtLtngGl\nCgr+3m/CslTRas6NBFNgViABBACUNPZChabUW+UxzOIFYiPLINnq33io4vwG\nKrqrf7zy5Wf/IOjjWMD65AyxqFFe2oWsotG46I6TaCteJz+5EYjFASxwzzDx\nKXaFqtAUOcqus782Ar/kH8fLor7DomvVGWuipPyBy/1izPnHHVesgvIBZiHd\npcbQTolUw2ddRwfvlQARAQABwp8EGAEIABMFAlNgViAJEHb4EFBEtq+MAhsM\nAACMKgP/USorSRjTsRFLD0IQSEHp5Rh2tirtY1Q/Tpa5hD1JVDmduLyQhjyw\nm2DNhJoC3a6a4blDiaYw0VbUR9smhwft1Of5iMeFYUDwWDs1VsK0MPnODvww\nP05VKdw2EMvEPrt8J2cDBtXWL5xghNsDCXmxgX8KZaBHIu+gotjb+W+s+Qg=\r\n=aV4c\r\n-----END PGP PUBLIC KEY BLOCK-----\
@mmacaulay
mmacaulay / 0_reuse_code.js
Created January 29, 2014 19:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mmacaulay
mmacaulay / gist:6768417
Created September 30, 2013 18:59
Search and replace in multiple files
find . -type f -print0 | xargs -0 gsed -i 's/thing/other/g'
@mmacaulay
mmacaulay / gist:6737117
Last active December 24, 2015 03:19
Disk usage of all dotfiles in the current directory
ls -a |grep ^\\..*[^\.]$ | xargs du -s | awk '{ sum += $1 } END { print sum }' | gnumfmt --to=iec
@mmacaulay
mmacaulay / custom_matchers.rb
Created November 18, 2011 20:58
RSpec matcher for testing that a hash contains a subset of another hash
# ironic: untested
module CustomMatchers
Spec::Matchers.define :include_hash do |expected|
match do |hash|
expected.keys.each do |key|
return false if !(hash.has_key?(key) && hash[key] == expected[key])
end
end
end
end
@mmacaulay
mmacaulay / IEnumerableExtensionMethods.cs
Created February 8, 2011 01:58
IEnumerable.Each extension method
public static class IEnumerableExtensions
{
public static void Each<T>(this IEnumerable<T> enumerable, Action<T> action)
{
foreach (var item in enumerable)
{
action(item);
}
}
}