Skip to content

Instantly share code, notes, and snippets.

View seth-macpherson's full-sized avatar

Seth MacPherson seth-macpherson

  • Appfolio
  • Hood River, OR
View GitHub Profile
@seth-macpherson
seth-macpherson / .gitconfig
Created September 4, 2015 17:11
$HOME/.gitconfig
[diff]
# tool = bc3
keepBackup = false
prompt = false
# [difftool "bc3"]
# dirDiff = true
# trustExitCode = true
# prompt = false
# keepTemporaries = false
# trustExitCode = true
require 'benchmark'
class QuestionScheduler
@queue = :email_notifications
MAX_ATTEMPTS = 2
# ============================================================
# When both queries are constrained to :current_enrollments
# the results are close with pluck ~2x speed improvement
@seth-macpherson
seth-macpherson / 0_reuse_code.js
Last active August 29, 2015 14:17
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
@seth-macpherson
seth-macpherson / compass validate
Created February 26, 2015 20:16
$ compass validate
************************************************************
Result: Invalid
46 files validated.
906 errors found in 32 files.
Somewhere, a kitten is crying.
************************************************************
valid public/stylesheets/ajaxful_rating.css
valid public/stylesheets/android.css
#!/bin/sh
export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}"
/usr/bin/env ruby -KU -- "$SETH_BUNDLE_SUPPORT/RubyMate/run_script_with_zeus.rb" --name=
require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor"
require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/save_current_document"
require "pathname"
TextMate.save_if_untitled
# For Run focused unit test, find the name of the test the user wishes to run.
args = [ ]
if ARGV.first == "--name="
n = ENV['TM_LINE_NUMBER'].to_i
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -KU
ENV['RUBYLIB'] = "#{ENV['TM_BUNDLE_SUPPORT']}/RubyMate"
require "#{ENV['TM_BUNDLE_SUPPORT']}/RubyMate/run_script_with_zeus.rb"
Loaded Suite test,test/browser,test/fixtures,test/functional,test/integration,test/support,test/unit
Started at 2013-09-25 16:39:42 -0700 w/ seed 1886.
MyPasswordTest
PASS (0:00:00.003) alpha sequences
PASS (0:00:00.004) blacklist
PASS (0:00:00.019) blocks morons policy
PASS (0:00:00.020) min length
PASS (0:00:00.021) numeric sequences
require './test/test_helper.rb'
require "password_policy"
class MyPasswordTest < ActiveSupport::TestCase
def test_min_length
password = "howdy"
policy = PasswordPolicy.new({:min_length => 6})
assert_equal(false, policy.validate(password))
ReferralUserTest
at top level in PASS (0 at line 00
Finished in 0.003279 seconds.
1 tests, 1 passed, 0 failures, 0 errors, 0 skips, 3 assertions
copy output
Program exited with code #0 after 10.35 seconds.