Skip to content

Instantly share code, notes, and snippets.

import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.builder.JqlQueryBuilder
import com.atlassian.jira.util.thread.JiraThreadLocalUtils
def searchService = ComponentAccessor.getComponent(SearchService)
def customFieldManager = ComponentAccessor.customFieldManager
def storyPointsCf = customFieldManager.getCustomFieldObjectByName('Story Points')
def issue = event.issue
Recently, I use JMXterm to collect info about Java JVM via JMX and MBeans. Here is a short note.
- Download JMXterm
https://sourceforge.net/projects/cyclops-group/files/jmxterm/1.0.0/jmxterm-1.0.0-uber.jar/download
- Run JMXterm
java -jar jmxterm-1.0.0-uber.jar --url localhost:<jmx listen port>
- All MBeans from java.lang
$>domain java.lang
package com.lightbend.akka.http.sample
import java.util.UUID
import akka.NotUsed
import akka.actor.{ ActorSystem, Cancellable }
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Source
import scala.collection.mutable
@vchernogorov
vchernogorov / _readme.md
Last active October 8, 2022 03:18
Анализ данных
@miguno
miguno / WordCount.java
Last active June 27, 2018 17:01
WordCount application in Java 7, using Kafka's Streams API (Kafka version 0.11.0.0)
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KStreamBuilder;
import org.apache.kafka.streams.kstream.KTable;
import org.apache.kafka.streams.kstream.KeyValueMapper;
import org.apache.kafka.streams.kstream.ValueMapper;
import java.util.Arrays;
@logic
logic / command-completion.sh
Created March 11, 2017 22:32
terminal command-completion notifications from inside tmux
# Like gnome-terminal's command-completion notifications, but usually run
# everything within a tmux window? No problem: add this to your .bashrc, and
# make sure `xdotool` is installed. Adjust the `notify-send` command line to
# taste.
#
# THIS DOESN'T WORK WITH WAYLAND. If you're on Wayland, let me know if you
# come up with a reliable way to identify the currently-focused window.
function notify_finished() {
# If we're not in tmux, fall back to gnome-terminal's notification.
[[ -z $TMUX_PANE ]] && __vte_prompt_command && return
@sagrawal31
sagrawal31 / formatSeconds.groovy
Created February 24, 2017 10:53
A simple Java/Groovy code to convert a given seconds value to hh:mm:ss format
import java.util.concurrent.TimeUnit
void convert(int secondsToConvert) {
long millis = secondsToConvert * 1000;
long hours = TimeUnit.MILLISECONDS.toHours(millis);
long minutes = TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1);
long seconds = TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1);
String format = String.format("%02d:%02d:%02d", Math.abs(hours), Math.abs(minutes), Math.abs(seconds));
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}