Redmine Backlog Tweaks (via Tampermonkey/Greasemonkey): Highlight My Backlog

My coworkers wrote a script that, via a Chrome/Firefox plugin (Tampermonkey/Greasemonkey respectively), highlights the items on a Redmine backlog that belong to you and also puts in parenthesis at the top how many of the points on the sprint are yours.
Before:Screenshot from 2015-07-30 14:53:50After:Screenshot from 2015-07-30 14:53:27The scripts, written by Tom and Abra, can be found at https://arvados.org/projects/arvados/wiki/Highlight_my_backlog , and my version (combining the two and adding in a strong orange color + larger and different font) can be found as follows:

// ==UserScript==
// @name         Highlight my redmine backlog
// @namespace    https://arvados.org/projects/arvados/wiki/Highlight_my_backlog
// @version      0.1b
// @description  Highlights issues assigned to you in redmine Backlogs view and
//               puts in parens the total point count you have for each sprint.
// @author       Tom Clegg, Abram Connelly
// @match        https://arvados.org/rb/master_backlog/*
// @grant        none
// ==/UserScript==

$.ajax('/my/account', {success: function(data, _, _) {
    var key = $('#api-access-key',data).text();
    var url = '/issues.json?assigned_to_id=me&limit=100';
    var ajaxopts = {
        dataType: 'json',
        headers: {'X-Redmine-API-Key': key},
        success: dopage
    };
    $.ajax(url, ajaxopts);
    function dopage(data, _, _) {

        var my_sprint_info = {};

        for (var i=0; i<data.issues.length; i++) {

            if ("fixed_version" in data.issues[i]) {
              var sprint_id = data.issues[i].fixed_version.id;
              var sprint_name = data.issues[i].fixed_version.name;
              if (!(sprint_id in my_sprint_info)) {
                  my_sprint_info[sprint_id]={"story_points" : 0, "sprint_id" : sprint_id, "sprint_name" : sprint_name };
              }
              if ("story_points" in data.issues[i]) {
                my_sprint_info[sprint_id].story_points += data.issues[i].story_points;
              }
            }

            $('#story_'+data.issues[i].id).css({
                'background':'#F49C54', //orange
                'font-family':'URW Bookman L, serif',
                'font-size':'1.2em',
            });
        }

        if (data.total_count > data.offset + data.limit) {
            $.ajax(url + '&offset=' + (data.offset + data.limit), ajaxopts);
        }

        for (var sprint_id in my_sprint_info) {
            var cur_pnt = $("#sprint_" + sprint_id).children(".fff-right").children(".velocity").text();
            cur_pnt += " (" + my_sprint_info[sprint_id].story_points +")";
            $("#sprint_" + sprint_id).children(".fff-right").children(".velocity").text(cur_pnt);
        }
    }
}});

Step-by-Step Greasemonkey Install

1. Install Greasemonkey: https://addons.mozilla.org/en-us/firefox/addon/greasemonkey/

2. Create a file with the contents above ending in “.user.js”

3. Double-click the file and Greasemonkey will install it

For more details, see http://www.orangenarwhals.com/2015/02/step-by-step-greasemonkey-script-to-remove-ui-elements-for-screenshots/ .

Step-by-Step Tampermonkey Install

1. Install Tampermonkey: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en

2.  Go to the tampermonkey icon and click “Add a new script…”Screenshot from 2015-07-15 05:10:49

3. Copy-and-paste the code in and ctrl-s to save (or click the floppy disk)

Screenshot from 2015-07-15 05:11:31

If you want to edit the script, just go to Dashboard and click the script name to open up the editor.

Screenshot from 2015-07-15 05:11:11

Backstory

At work (Curoverse), we are all Arvados contributors (and open-source data and computation workflow management platform) and use the open-source Redmine to keep track of our open issues, tickets, and bugs.

We chose to use Redmine and merely mirror on Github, instead of using Github Issues, because Github itself is not open-source and we prefer to own our own data. In particular, since we operate in sprints, we use the backlog feature a lot. However, I’d been struggling to adopt Redmine, since it was impossible to use as a to-do list.

But my co-workers made a greasemonkey / tampermonkey browser plugin that highlights your tasks & how many points are assigned to you, which makes the whole system way more usable.

See the original link, https://arvados.org/projects/arvados/wiki/Highlight_my_backlog, for more details about the Redmine API and features you could add  to this script 🙂

A gif of my brain (MRI scans)

http://www.gfycat.com/BetterPhysicalIvorybilledwoodpecker

(License: Public Domain, https://creativecommons.org/publicdomain/zero/1.0/)

I participated in a research study last night and got a CD with 40 MB of scans of my brain. Yay!

I didn’t have a fancy DICOM viewer like OSIRIx, which lets you fly through the brain in any direction you want by reconstructing the data appropriately from the MRI slices, but I was able to make the above gif using just two lines on the command-line in linux.

How I made the gif

Then, upload to gfycat.

Other viewers

Mango

A DICOM viewer (kind of clunky / not well integrated into Ubuntu):

DICOM Web Viewer

A browser-based DICOM viewer that is somehow better integrated into linux:

https://github.com/ivmartel/dwv

To use, download and unzip, go to the folder for the viewer you want, and open up “index.html”. For instance:

file:///home/nrw/Pictures/ivmartel-dwv-2b340ec/viewers/static/index.html

Then click “file” and select all the files you want to open.

Scaling Gfycats (in embedded iframes)

The gfycat was pretty small, so I wanted to embed a scaled-up version here. Doing so took me a few minutes to figure out, so here it is. After getting the iframe code from gfycat.com, I manually set the width and height to be 2x, then set scale to be 2  and added scaling for firefox.

However, my image was now scaling off the page! From stackoverflow I figured out that I need to add “transform-origin” attributes in there. See below.

 <iframe width="512" height="512" style="-webkit-backface-visibility: hidden; -webkit-transform: scale(2); -webkit-transform-origin: 0 0; -moz-transform-scale(2); -moz-transform-origin: 0 0;" src="http://gfycat.com/ifr/BetterPhysicalIvorybilledwoodpecker" frameborder="0" scrolling="no"></iframe>

Update: 29 July 2015

I found a better viewer than mango and dwv. Slicer lets you see the brain scans from any angle (the defaut is top – side – back), and you can import ALL the DICOM files and it will sort out for you which ones belong to a “series” (hard to do in the native file manager since my file manager doesn’t show DICOM previews). See pictures below.

To get slicer, go to http://download.slicer.org/ and download the .tar.gz, then extract its contents. Go into the extracted root folder (something like “Slicer-4.4.0-linux-amd64”) and run the executable in the root folder.

Screenshot from 2015-07-28 19:46:04

Screenshot from 2015-07-29 04:43:05

youtube channels!

Lately I’ve been finding some awesome youtube channels with really well-done content to watch and learn about fields I don’t really know much about.

This is Alice and my attempt at the rainbow heart cookies… we tried ^^;

20150411_204027

I haven’t found a good one for sewing / cosplay / diy fashion / theater costumes / movie props / cosmetics stuff yet.

Anyway, the plan is, instead of going to film school, I’m going to watch youtube videos, buy a few books, and make tons and tons of crappy videos.  🙂

 

[edit 13 July 2015] Part II!

I decided to do a more comprehensive post, since why not, I’ve already got them in my bookmarks.

My giant playlist of nails / fashion / clothes manufacturing: