Skip to content

Instantly share code, notes, and snippets.

@todokr
Last active August 29, 2015 14:27
Show Gist options
  • Save todokr/dac49963593e2ac50f2f to your computer and use it in GitHub Desktop.
Save todokr/dac49963593e2ac50f2f to your computer and use it in GitHub Desktop.
Clear favicon cache of localhost (Google Chrome v.44.0)
require 'sqlite3'
favicon_path = File.join(ENV['HOME'], '/Library/Application Support/Google/Chrome/Default/Favicons')
db = SQLite3::Database.new favicon_path
begin
command = "delete from favicons where url like '%localhost%'"
db.execute(command)
p "Done: #{command}"
rescue SQLite3::BusyException => ex
print <<-ERROR_DOC
Chrome may be running. Quit and retry.
ERROR_DOC
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment