Skip to content

Instantly share code, notes, and snippets.

View seangaffney's full-sized avatar

Sean Gaffney seangaffney

View GitHub Profile
@seangaffney
seangaffney / SshAddA.plist
Created October 12, 2016 13:30
MacOS Sierra no longer auto-loads SSH keys stored in Keychain. To correct this, add this plist to `~/Library/LaunchAgents`. To load it immediately, run `launchctl load ~/Library/LaunchAgents/SshAddA.plist`.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh-add-a</string>
<key>ProgramArguments</key>
<array>
<string>ssh-add</string>
<string>-A</string>
@seangaffney
seangaffney / vi Mode key macros.kmlibrary
Created September 22, 2016 18:20
A Keyboard Maestro library to mimic Karabiner's vi Mode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Author</key>
<string>Sean Gaffney</string>
<key>AuthorURL</key>
<string>http://seangaffney.cc</string>
<key>CanDragToMacroGroup</key>
<true/>
class MarkdownPreview
constructor: (element) ->
@$element = $(element)
@$preview = $("##{@$element.attr("id")}-preview")
if @$element.val?()
@get_preview()
throttled_get_preview = _.throttle @get_preview(), 1000
@$element.keyup =>
require 'spec/support/grep_matcher'
describe do
disallow_presence_of pattern: "send(.*#",
location: "app/",
description: "Do not use dynamic method invocations",
failure: "Please change dynamic method call to something more sane."
end
@seangaffney
seangaffney / tmux.md
Last active August 29, 2015 14:14 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

require "spec_helper"
describe DripCampaign do
let(:user) { build_stubbed :user }
let(:mail_message) { double(deliver!: true) }
before(:each) do
DummyMailer = double().as_null_object
allow(DummyMailer).to receive(:send).and_return(mail_message)
DripCampaign.mailer :dummy_mailer
end
// ==UserScript==
// @author Jagadeesh
// @name Remove Contextual Gadgets from Gmail
// @namespace
// @description Removes Contextual Gadgets/widgets from footer of email messages in Gmail.
// @include https://mail.google.*
// @include http://mail.google.*
// ==/UserScript==
(function(){
<tr>
<td align="center" style="vertical-align:top;border-collapse:collapse;">
<!-- // BEGIN HEADER -->
<table id="content" border="0" cellpadding="0" cellspacing="0" style="background-color: #FFF;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
<tr>
<td align="center" style="vertical-align:top;border-collapse:collapse;padding-top:3%;padding-right:7%;padding-left:7%;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
<tr>
<td style="vertical-align: top;font-size: 18px;font-weight: bold;line-height: 100%;padding-bottom: 25px;text-align: left;border-collapse: collapse;color: #8d9aa5 !important;font-family: Helvetica,sans-serif !important;" class="MainContent">
<%= main_intro do %>
<tr>
<td align="center" style="vertical-align:top;border-collapse:collapse;">
<!-- // BEGIN HEADER -->
<table id="content" border="0" cellpadding="0" cellspacing="0" style="background-color: #FFF;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
<tr>
<td align="center" style="vertical-align:top;border-collapse:collapse;padding-top:3%;padding-right:7%;padding-left:7%;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;">
<tr>
<td style="vertical-align: top;font-size: 18px;font-weight: bold;line-height: 100%;padding-bottom: 25px;text-align: left;border-collapse: collapse;color: #8d9aa5 !important;font-family: Helvetica,sans-serif !important;" class="MainContent">
<h1 class="MainIntro" style="color: #384047;font-family:
DummyCourse = Struct.new(:title) do
def description
"Courses have been discontinued. This course contains all syllabi."
end
def published_for_ios
true
end