Skip to content

Instantly share code, notes, and snippets.

@findepi
findepi / time zone ids.md
Last active March 5, 2017 11:25
Time Zone ID support across libraries

Table shows offset in hours (on March 5th 2017) of a time zone given the input on the left, across libraries.

                  j.u.TimeZone::getTimeZone     j.t.ZoneId::of  joda.DateTimeZone::forID
            UTC                         0.0                0.0                       0.0
            GMT                         0.0                0.0                       0.0
         +01:00                         0.0                1.0                       1.0
      UTC+01:00                         0.0                1.0                -- fail --
      GMT+01:00                         1.0                1.0                -- fail --
 Europe/Warsaw 1.0 1.0 1.0
@findepi
findepi / jira.css
Created February 17, 2017 21:24
JIRA super style up which moves issue content tabs as a nice bottom bar. And makes JIRA more compact too.
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix("https://pm.syncron.net/jira/") {
/* All pages */
#footer-logo {
display: none !important;
}
section#content {
@findepi
findepi / jira.user.js
Created February 17, 2017 21:22
JIRA 'w' keyboard shortcut for watch/unwatch issue
// ==UserScript==
// @name Jira
// @namespace http://students.mimuw.edu.pl/~findepi
// @version 1
// @include http://match-nothing.example.com
// @grant none
// ==/UserScript==
jQuery(function($) {
var log = ((window.console && typeof window.console.log == "function")
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
/**
* @author piofin <piotr.findeisen@gmail.com>
* @since Mar 4, 2016
*/
public class ParallelStreamAndForeigners {
import java.util.Collections;
/**
* @author piofin <piotr.findeisen@gmail.com>
* @since Mar 4, 2016
*/
public class ParallelStreamReusesCaller {
public static void main(String[] args) {
Thread main = Thread.currentThread();
@findepi
findepi / StreamHog.java
Created March 4, 2016 22:14
Shows how for-loop, sequential stream and parallel stream behave when FJ pool is blocked by other activities
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ForkJoinPool;
import java.util.function.Consumer;
/**
* @author piofin <piotr.findeisen@gmail.com>
// ==UserScript==
// @name anti key-grabber
// @description Prevent web apps from capturing and muting vital keyboard shortcuts
// @grant none
// @version 1.1
// ==/UserScript==
(function(){
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x");
unsafeWindow.document.addEventListener('keydown', function(e) {
if (e.keyCode === 116) {