Skip to content

Instantly share code, notes, and snippets.

View seandenigris's full-sized avatar

Sean DeNigris seandenigris

View GitHub Profile
@seandenigris
seandenigris / autospec_customizer.rb
Created February 26, 2010 20:44
By saving as [project_dir]/.autotest, allows custom (non-"spec") naming conventions, and file names with spaces
require 'autotest/timestamp'
require "autotest/fsevent"
#require "autotest/restart"
class Autotest::Rspec < Autotest
#I'm going to keep using spec for Rails because it got too complicated
unless File.exist?("spec")
puts "Using 'example' for consolidate failures and options file"
# This method tells Autotest which files had failures
# so it knows which hooks to call, and whether to run features.
form.formtastic fieldset ol div.auto_complete {
z-index:1;
}
form.formtastic fieldset ol div.auto_complete li {
margin-bottom: auto;
}
@seandenigris
seandenigris / snipmate_vim_plugin_tweak.vim
Created March 1, 2010 03:14
insert first snippet by default instead of cancelling
" Apply this edit to plugin/snipMate.vim
fun s:ChooseSnippet(scope, trigger)
" Original last line (which cancels on enter) commented out
"return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1]
" Two lines added to choose first snippet if none are selected
let snip_to_return = num == -1 ? 0 : num
return s:multi_snips[a:scope][a:trigger][snip_to_return][1]
endf
@seandenigris
seandenigris / gist:318054
Created March 1, 2010 03:17
use non-standard naming convention with Rspec and autotest
# .autotest file to use non-standard names with autotest and Rspec (e.g. "example" instead of "spec")
class Autotest::Rspec < Autotest
remove_method :consolidate_failures
def consolidate_failures(failed)
filters = new_hash_of_arrays
failed.each do |spec, trace|
if trace =~ /\n(\.\/)?(.*example\.rb):[\d]+:/
filters[$2] << spec
end
@seandenigris
seandenigris / Info.plist
Created March 3, 2010 02:48
Quicklook for HAML and ERB files (see instructions at http://seandenigris.com/?p=403)
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
<string>public.source-code</string>
</array>
<key>UTTypeDescription</key>
<string>Ruby HTML Template file</string>
@seandenigris
seandenigris / gist:322074
Created March 4, 2010 20:28
Syntax highlight files in Quicklook
# Snippet to syntax-highlight source code files matching a certain pattern in Quicklook
# See see http://seandenigris.com/?p=412 for more info for more info
# Used with the qlcolorcode plugin
# Insert into QLColorCode.qlgenerator/Contents/Resources/colorize.sh
# Works for files in languages known to highlight (see qlcolorcode docs), but because of their filename, aren't recognized by Quicklook
#The commented lines are already in the file
#
# debug Handling special cases
"" Sean's custom options
if has("win32")
source $VIMRUNTIME/mswin.vim
behave mswin
endif
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
Feature: developer creates a skeleton Ruby application
In order to get to the beach more quickly
As a developer
I want to instantly create a basic Ruby application skeleton
Scenario: create a new application
Given I want to create a new application named "my_amazing_new_application"
And I am in my projects directory
And a sub-directory with the name of my application does not exist
@seandenigris
seandenigris / gist:942676
Created April 26, 2011 17:14
Name sub albums
tell application "iTunes"
-- Change these two variables as you go for each sub-album
set sub_album_description to ""
set number_of_tracks_in_sub_album to 5
set imported_album_name to ""
-- Date string example "Monday, April 25, 2011 April 25, 2011 12:00:00 AM"
set timestamp_of_first_imported_track to date ""
@seandenigris
seandenigris / gist:942684
Created April 26, 2011 17:18
iTunes: Change artist names
tell application "iTunes"
set wrongName to ""
set rightName to ""
set track_list to tracks of playlist "Music" of source "Library" whose artist is wrongName
repeat with t in track_list
set artist of t to rightName
end repeat
end tell