Skip to content

Instantly share code, notes, and snippets.

AJ Morris ajmorris

Block or report user

Report or block ajmorris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1745
<%= select(:team, :id, team_selection_matrix, {}, :onchange => "display(this,'#{}');") %>
View init.rb
require "lockdown"
require File.join(File.dirname(__FILE__), "session")
Lockdown::System.configure do
# Configuration Options
# Options with defaults:
View gist:11111
def discretionary_leave {|time| time.hours}.sum
def accrued_annual_leave(year=current_fiscal_year), year).accrued_leave + discretionary_leave
def net_annual_leave(year=current_fiscal_year)
accrued_annual_leave(year) - used_annual_leave(year)
View gist:16577
xml.instruct! :xml, :version =>"1.0"
xml.feed(:xmlns => "") do |feed|
feed.title('My Super Cool Feed!') "rel" => "self", "href" => url_for(:only_path => false,
:controller => 'articles',
:action => 'atom') "rel" => "alternate", "href" => url_for(:only_path => false,
:controller => 'articles')
feed.updated @articles.first.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ" if @articles.any? { "Academic Technologies" }
View date_field.rb
# Originally from
# Modified for new Merb 0.9.6 helpers
module Merb::Helpers::Form
def date_field(*args)
if bound?(*args)
View at_ldap.rb
require 'rubygems'
require 'net/ldap'
module Merb::Authentication::Strategies
class AtLdap < Merb::Authentication::Strategy
def run!( login, password )
initialize_ldap_connection unless @ldap
:base => "cn=#{login},ou=cats,o=gwu",
View init.rb
Merb::BootLoader.after_app_loads do
dependency 'merb-builder'
# This will get executed after your app's classes have been loaded.
View .bash_profile
### .bash_profile
export EDITOR='mate -w'
export VISUAL='mate -w'
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
function proml {
View gist:46622
def years_of_service
(( - adjusted_start_date).to_i / 365.25).to_i
View autotest.rb
# .autotest
require 'autotest/redgreen'
require 'autotest/menu'
# This replaces the stock Autotest::Growl
module Autotest::Growl
def self.growl title, msg, image=nil, pri=0
title += " in #{Dir.pwd}"
msg += " at #{}"
system "growlnotify -n autotest --image #{image || "/Applications/"} -m #{msg.inspect} -t #{title}"
You can’t perform that action at this time.