Schmijos' Blog

Git Tag: Sort by Version

You can list all the tags with the command git tag. The output looks like
that if you use tag your commits with versions:

2.1.2
2.10.0
2.2.0

With semantic versioning being in place you probably would like to see
the following listing:

2.1.2
2.2.0
2.10.0

Actually you can achieve that with the option
--sort.
There’s even a configuration option present for that:

git config --global tag.sort version:refname

Cloudflare and document.write

Cloudflare’s Rocket Loader is being intercepted by the new Chrome (v54) and
Firefox rules regarding document.write (more here.

Because of that, pages where Cloudflare decided to inject the rocket loader (for
example not if you visit a page with Safari) doesn’t load any scripts sourced
with data-rocketsrc.

Change the Rocket Loader mode in Cloudflare to manual or wait for a
solution.

Misconfigured AR Database Environment Check

When you execute rails db:schema:load the following can happen:

rails aborted!
ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive
action against your 'production' database.
If you are sure you want to continue, run the same command with the environment
variable:
DISABLE_DATABASE_ENVIRONMENT_CHECK=1

This is a protection so that you don’t delete any production data by accident.
But what happened to me was that I somewhen reconfigured my local system
to be productive (probably to test something with real data).

It is possible to reconfigure the database environment in
ar_internal_metadata with the following command:

bin/rails db:environment:set RAILS_ENV=development

With that database rake tasks to not complain anymore if you mess with
databases locally.