Skip to content

Instantly share code, notes, and snippets.

View schlick's full-sized avatar

Michael MacDonald schlick

View GitHub Profile
@schlick
schlick / Gemfile
Created January 16, 2016 18:25
Basic development gems
group :development do
gem 'better_errors' # https://github.com/charliesome/better_errors
gem 'binding_of_caller' # - optional dependency for better_errors
gem 'quiet_assets' # https://github.com/evrone/quiet_assets
gem 'spring' # https://github.com/rails/spring
gem 'spring-commands-rspec' # https://github.com/jonleighton/spring-commands-rspec
end
@schlick
schlick / simplecov.rb
Last active January 16, 2016 17:33
SimpleCov config to add groups for tracking changed files in a commit and a branch. Originally from an email by @fredwu.
if ENV['COV']
require 'simplecov'
SimpleCov.start 'rails' do
add_group 'This Commit' do |source_file|
`git ls-files --exclude-standard --others \
&& git diff --name-only \
&& git diff --name-only --cached`.split("\n").detect do |filename|
source_file.filename.ends_with?(filename)
end
end
@schlick
schlick / 01.configure
Created January 30, 2014 02:10
Logs of an unsuccessful brew reinstall ghostscript. Files from ~/Library/Logs/Homebrew/ghostscript
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
@schlick
schlick / 01.configure
Created January 30, 2014 01:31
~/Library/Logs/Homebrew/ghostscript
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
@schlick
schlick / best_model.rb
Last active September 30, 2015 01:57 — forked from ltw/best_model.rb
Order of a standard Model
class Model < ParentModel
include Foo::Bar
extend Bar::Baz
acts_as_authentic
dsl_specific_flags
module InternalModule
...
end
amc-projects:sqlite3 {
'sqlite3' / setup not defined.
Already pulled amc-projects (git@github.com:amc-projects/babushka-deps.git) this session.
build tools {
'build tools' / internal_setup not defined.
'build tools' / setup not defined.
build-essential {
'build-essential' / setup not defined.
apt {
'apt' / internal_setup not defined.
When /^(\d+) (minutes|hours|days) pass$/ do |amount, unit|
now = Time.now
Time.stubs(:now).returns(now + amount.to_i.send(unit.to_sym))
end
When /^going back (\d+) (minutes|hours|days)$/ do |minutes|
now = Time.now
Time.stubs(:now).returns(now - amount.to_i.send(unit.to_sym))
end
@schlick
schlick / pickle_extra_steps.rb
Created November 3, 2009 10:51
A cucumber step definition for destroying all objects using pickle
# destroy all objects
Given(/^no #{capture_plural_factory} exist$/) do |plural_factory|
plural_factory.classify.constantize.destroy_all
# you could add the following to verify that there are indeed no records
find_models(plural_factory.singularize).should be_nil
end
@schlick
schlick / Grep in Project.tmDelta.txt
Created May 30, 2009 12:17
Modifications to original Grep in Project Textmate command to also ignore vendor and git directories
<?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>changed</key>
<dict>
<key>command</key>
<string>#!/usr/bin/env ruby -rcgi
# By Henrik Nyh &lt;http://henrik.nyh.se&gt; 2007-06-26
@schlick
schlick / Grep in Project.tmDelta
Created May 30, 2009 12:14
Modifications to original Grep in Project Textmate command to also ignore vendor and git directories
<?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>changed</key>
<dict>
<key>command</key>
<string>#!/usr/bin/env ruby -rcgi
# By Henrik Nyh &lt;http://henrik.nyh.se&gt; 2007-06-26