Skip to content

Instantly share code, notes, and snippets.

@romiras
romiras / dictionary-gnu-sort-bd.txt
Last active January 1, 2020 10:56 — forked from klauspost/dictionary-sorted.txt
Brotli dictionary - printed escaped - sorted with "sort -bd" (with dictionary order, ignoring blanks), a tool from GNU coreutils
"<!--"
"><!--"
"||[];"
"--><!--"
"--></"
"----"
"!--<"
"//--></"
"//-->"
"...</"
@romiras
romiras / backup.rake
Last active August 29, 2015 14:17 — forked from stevebartholomew/gist:50180
MySQL backup rake task for Rails 2.3.x
# put this file into directory <RAILS_ROOT>/lib/tasks
namespace :db do
desc "Backup database"
task :backup do
RAILS_ENV = "development" if !defined?(RAILS_ENV)
settings = YAML.load(File.read(File.join(Rails.root, "config", "database.yml")))[RAILS_ENV]
bak_dir = ENV['BAK_DIR']
raise(RuntimeError, "==> Error: environment variable BAK_DIR not set.") if bak_dir.blank?
extra_parameters = ["--default-character-set=utf8"]