Skip to content

Instantly share code, notes, and snippets.

View adamlogic's full-sized avatar

Adam McCrea adamlogic

View GitHub Profile
$(function() {
$('#summaries tr').live('click', clearDetail).live('click', selectRow);
$('form#search').submit(clearSummaries);
function clearDetail(e) {
$('#detail').empty();
}
function clearSummaries(e) {
Scenario: Filter by controller
Given I am on the initial page
When I filter results for the "users" controller
Then all entries in the summary list should be for the "users" controller
def choose_last_radio_in_selector(selector)
within(selector) do
choose field_by_xpath('.//input[@type="radio"][last()]')
end
end
class Tracker
include HTTParty
TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
base_uri 'www.pivotaltracker.com'
def self.projects
api_get 'projects'
end
@adamlogic
adamlogic / rails_template.rb
Created December 16, 2008 13:31
an example rails template... just a start
run 'rm public/index.html'
run 'rm public/javascripts/*'
run 'mkdir public/vendor'
run 'haml --rails .'
git :init
git :add => "."
git :commit => "-a -m 'Initial commit'"
ajaxLink: function() {
return this.click(function() {
$.getScript(this.href);
return false;
});
},
(function($) {
$.fn.extend({
jaxy: function() {
return this.each(function() {
if (/^a$/i.test(this.tagName)) $(this).ajaxLink();
if (/^form$/i.test(this.tagName)) $(this).ajaxForm({dataType: 'script'});
});
},
" posting a snippet to Gist http://gist.github.com
:nmap ,g :Gist
submitClick: function() {
return this.click(function() {
var el = $(this);
if (el.attr('target')) {
el.findTarget().submit();
} else {
el.parents('form:first').submit();
}
jaxy: function() {
return this.each(function() {
if (/^a$/i.test(this.tagName)) $(this).ajaxLink();
if (/^form$/i.test(this.tagName)) $(this).ajaxForm({dataType: 'script'});
});
},