delete snippets

Delete messages containing a keyword in mutt

Tagged mutt, mail, bulk, delete  Languages bash

Bulk operations in mutt, a console based email client, are easy. Here's how to delete messages containing the keyword 'Newsletter'.

T
Newsletter
;
d
$

T - asks which messages you want to tag and you reply with 'Newsletter'.

; - asks which action you want to run on the tagged messages.

d - tells that the action you want is delete.

$ - synchronizes the view with the underlying persistence layer.

DELETE, PUT, GET and POST with jQuery

Tagged delete, put, get, post, jquery  Languages javascript

Example of how to do DELETE, PUT, GET and POST with jQuery and Rails REST type routing:

$.ajax({ 
    type: 'get', 
    url: '/subscriptions/' + id,
    data: "subscription[title]=" + encodeURI(value),
    dataType: 'script' 
}); 

$.ajax({ 
    type: 'POST', 
    url: '/subscriptions/' + id,
    data: "subscription[title]=" + encodeURI(value),
    dataType: 'script' 
}); 

$.ajax({ 
    type: 'PUT', 
    url: '/subscriptions/' + id,
    data: "subscription[title]=" + encodeURI(value),
    dataType: 'script' 
}); 

$.ajax({
    type: 'DELETE',
    url: url,
    data: 'subscription[id]=' + id,
    dataType: 'script'
});

The gotcha with DELETE is to specify the ID using the data parameter, otherwise you might get this error; at least with Rails 2.2.2, jQuery 1.3.1, FF 3:

/!\ FAILSAFE /!\  Mon Feb 16 13:57:52 +0200 2009
  Status: 500 Internal Server Error
  You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.attributes
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb:708:in get_attributes'
    /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb:462:in collapse'