Skip to content

Instantly share code, notes, and snippets.

View aeden's full-sized avatar

Anthony Eden aeden

View GitHub Profile
# within the else block in paths.rb:
path_method = page_name.gsub(/^(the|my) /i, '').gsub(/ page$/i, ' path').gsub(/\s+/, '_')
begin
send(path_method.to_sym)
rescue
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
"Now, go and add a mapping in #{__FILE__}"
end
Spec::Runner.configure do |config|
config.before do
subscriber = mock(RSpreedly::Subscriber)
subscriber.stub!(:save)
RSpreedly::Subscriber.stub!(:new).and_return(subscriber)
end
end
export PATH=$PATH:/Users/aeden/.gem/ruby/1.8/bin
alias gst='git status '
alias gc='git commit '
alias gca='git commit -a '
alias ga='git add '
alias gco='git checkout '
alias gb='git branch '
alias gm='git merge '
alias gp='git push '
system:
uname: "Darwin Anthony-Edens-MacBook-Pro.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386"
shell: "bash"
version: "3.2.48(1)-release"
ruby:
interpreter: "ruby"
version: "1.8.7"
date: "2010-01-10"
platform: "i686-darwin10.2.0"
/Users/aeden/.rvm/bin:/Users/aeden/.rvm/bin:/Users/aeden/.rvm/rubies/ruby-1.8.7-p249/bin:/Users/aeden/.rvm/gems/ruby-1.8.7-p249/bin:/Users/aeden/.rvm/gems/ruby-1.8.7-p249%global/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/aeden/.gem/ruby/1.8/bin
system:
uname: "Darwin Anthony-Edens-MacBook-Pro.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386"
shell: "bash"
version: "3.2.48(1)-release"
ruby:
interpreter: "ruby"
version: "1.8.7"
date: "2009-12-24"
platform: "i686-darwin10.2.0"
$('ul.people').append('<li><span class="name">' +
html_sanitize(json.person.name) + '</span> <a href="/people/' +
json.person.id + '/delete" class="delete">delete</a></li>');
<li><span class="name"><%= h person.name %></span>
<%= link_to 'delete', delete_person_path(person), :class => 'delete' %>
</li>
git clone git://github.com/aeden/unobtrusive-jquery-example.git
cd unobtrusive-jquery-example
script/server
connectDeleteLinks: function() {
$('ul.people').find('a.delete').live('click', function() {
var li = $(this).parent();
if (confirm('Are you sure you want to delete the person "' + li.find('span.name').text() + '"?')) {
$.ajax({
type: 'post',
dataType: 'json',
url: this.href.replace(/\/delete/, ''),
data: {'_method': 'delete'},
success: function(json) {