Skip to content

Instantly share code, notes, and snippets.

View seanf's full-sized avatar

Sean Flanigan seanf

  • Brisbane, Australia
View GitHub Profile
@seanf
seanf / jenkins-log-slowest-pipeline-steps.js
Created October 17, 2022 22:58
Log the slowest steps in a Jenkins build
// Paste this JavaScript into the JS console of your Jenkins build page
// eg https://jenkins.example.com/jenkins/job/MyJob/main/lastSuccessfulBuild/
// to see the slowest (non-paused) steps in your pipeline.
//
// Warning: this may not work for large jobs, or parallel steps.
// Ref: https://issues.jenkins.io/browse/JENKINS-52394
//
// This requires https://plugins.jenkins.io/pipeline-rest-api/
// (for https://github.com/jenkinsci/pipeline-stage-view-plugin/blob/master/rest-api/README.md#pipeline-rest-api-plugin)
const NUMBER_OF_CULPRITS = 10;
@seanf
seanf / convert-git-team.sh
Created July 15, 2022 06:44
convert a `git-team` config to `.git_coauthors`
brew install jc jq
cat ~/.gitconfig | jc --ini | jq -r '."team \"alias\"" | to_entries[] | .value'
@seanf
seanf / describe.java
Created November 26, 2021 03:56
describe: a cheap toString substitute for objects which may have verbose toString implementations
public static String describe(Object obj) {
return obj.getClass().getSimpleName() + '@' + System.identityHashCode(obj);
}
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.JTextComponent;
import java.awt.*;
import java.awt.event.*;
import java.util.function.Consumer;
@seanf
seanf / stretchvideo43.js
Last active May 10, 2020 09:42 — forked from arpruss/stretchvideo.js
Bookmarklet to change aspect ratio of html5 video to 4:3
document.dispatchEvent(new Event('mobi.omegacentauri.killStretchVideoEvent'));
var vid = document.getElementsByTagName('video');
if (vid.length == 0) {
alert("No video elements found in this page.");
}
else {
var mode = "4:3";
var stretchX = null;
var stretchY = null;
@seanf
seanf / GWT Compiler Options
Last active May 8, 2019 03:40 — forked from abdennebi/GWT Compiler Options
GWT Compiler Options
Original Source : https://web.archive.org/web/20181012143606/http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions
java -cp ~/.m2/repository/com/google/gwt/gwt-dev/2.8.2/gwt-dev-2.8.2.jar com.google.gwt.dev.Compiler
Missing required argument 'module[s]'
Google Web Toolkit 2.8.2
Compiler [-logLevel (ERROR|WARN|INFO|TRACE|DEBUG|SPAM|ALL)] [-workDir dir] [-X[no]closureFormattedOutput] [-[no]compileReport] [-X[no]checkCasts] [-X[no]classMetadata] [-[no]draftCompile] [-[no]checkAssertions] [-XfragmentCount numFragments] [-XfragmentMerge numFragments] [-gen dir] [-[no]generateJsInteropExports] [-includeJsInteropExports/excludeJsInteropExports regex] [-XmethodNameDisplayMode (NONE|ONLY_METHOD_NAME|ABBREVIATED|FULL)] [-Xnamespace (NONE|PACKAGE)] [-optimize level] [-[no]saveSource] [-setProperty name=value,value...] [-style (DETAILED|OBFUSCATED|PRETTY)] [-[no]failOnError] [-[no]validateOnly] [-sourceLevel [auto, 1.8]] [-localWorkers count] [-[no]incremental] [-war dir] [-depl
@seanf
seanf / mvnhelpcmd
Created February 20, 2019 03:43
Invokes Maven's Help plugin to describe another Maven plugin's goal
#!/bin/bash
cmd="$1"
shift
./mvnw help:describe -Ddetail "-Dcmd=$cmd" "$@"
@seanf
seanf / mvnhelp
Created February 20, 2019 03:42
Invokes Maven's Help plugin to describe another Maven plugin's goals
#!/bin/bash
plugin="$1"
shift
./mvnw help:describe -Ddetail "-Dplugin=$plugin" "$@"
@seanf
seanf / gitlab-realtime.user.js
Created January 20, 2019 05:25
GitLab real time user script
// ==UserScript==
// @name GitLab real time
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace GitLab's relative times (from timeago.js) with real timestamps
// @author Sean Flanigan
// @match https://gitlab.com/*
// ==/UserScript==
(function() {
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
internal class MyRetryableTest {
// Just to help IntelliJ detect this test class:
@Test
@Disabled
fun dummy() {}