HELP, the HTML in my I18n strings is escaped!
If there's any HTML in your I18n string, remember to add "_html" to its name.
Related cards:
'PG::GroupingError: ERROR: column must appear in the GROUP BY clause or be used in an aggregate function' in rails while trying ".group"
TL;DR:
If you have an ordering scope on a column of your ActiveRecord model, that must appear in the result set of the group clause. You need to get rid of the scope with ActiveRecord::Base.unscoped to get **SomeArModel.group(:some_column)....
Gatekeeping: Guide for developer
Note: This has been a private card for some time, because it is heavily tailored to our specific needs and tools. While it will certainly not apply to all (especially larger teams), we thought it might still be helpful as a starting point, and...
Install PostGIS for pgvm
Say you're using pgvm
to manage several versions of Postgres and you need to install the PostGIS extension.
Prerequisites:
- If you have installed PostGIS via brew before, uninstall it:
$ brew uninstall postgis
- Install your favo...
group_by with ActiveModel::Serializers
When using group_by
in a controller that serializes the grouped collection to JSON you will notice that your serializers created with the active_model_serializer
will not be used and all attributes in your model are just converted to JSON. For...
Show the routing table on MacOS
When things get weird with your internet connection and you can't even ping the router's IP, you should have a look at the routing table:
$ netstat -nr
It gives you:
netstat -nr
Routing tables
Internet:
Destination Gateway...
a bookmarklet to generate the commit message from an open pivotal tracker story
javascript: (function ($) {
var storyTitles = [];
var stories = $('div.story .selector.selected').closest('.story');
var collapsed = true;
if (stories.length == 0) {
stories = $('div.story .details').closest('.story');
...
a bookmarklet to generate the branch name from an open jira story
javascript: (function ($) {
var branchName = "nothing found" ;
var story = jQuery(".ghx-fieldname-issuekey a");
if(story){
var title = $("[data-field-id='summary']").text();
var id = story.text();
var translate = {
...
a bookmarklet to generate the commit message from an open jira story
javascript: (function ($) {
var branchName = "nothing found" ;
var story = jQuery(".ghx-fieldname-issuekey a");
if(story){
var title = $("[data-field-id='summary']").text();
var id = story.text();
var translate = {
...
mtr says "mtr: unable to get raw sockets"
This is because mtr needs to open raw sockets, which it can only do as root:
$ mtr 8.8.8.8
mtr: unable to get raw sockets.
$ sudo mtr 8.8.8.8
Keys: Help Display mode Restart statistics Order of fields quit
...
a bookmarklet to generate the branch name from an open pivotal tracker story
javascript: (function ($) {
var storyTitles = [];
var story = $('.story .details').closest('.story').first();
if(story){
var title = story.find('.editor.name').val();
var id = /story_(\d+)/.exec(story.attr('class'))[1];
var s...