Skip to content

Instantly share code, notes, and snippets.

@beccasaurus
Created September 22, 2008 04:11
Show Gist options
  • Save beccasaurus/11940 to your computer and use it in GitHub Desktop.
Save beccasaurus/11940 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
puts "closing firefox ..."
`killall firefox`
require 'rubygems'
require 'activerecord'
ActiveRecord::Base.establish_connection :adapter => 'sqlite3',
:database => '/home/remi/.mozilla/firefox/efs72yik.default/places.sqlite'
ActiveRecord::Base.table_name_prefix = 'moz_'
class Favicon < ActiveRecord::Base; end
# mime_type => 'image/png'
# expiration => 0
# id => [generated]
# url => full path to favicon
#
# Favicon.create :url => "http://localhost:3000/favicon.png", :mime_type => "image/png",
# :expiration => 0
puts "deleting favicons for localhost ..."
favicons = Favicon.find :all, :conditions => "url like '%localhost%'"
favicons.each {|f| f.update_attribute :data, nil }
puts "deleted #{favicons.length} favicons"
puts "restoring firefox ..."
`firefox &`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment