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 / zanata-creaper.kt
Created August 23, 2017 02:20
Configuring wildfly for Zanata with Creaper
import org.slf4j.LoggerFactory
import org.wildfly.extras.creaper.commands.datasources.AddDataSource
import org.wildfly.extras.creaper.commands.logging.AddLogger
import org.wildfly.extras.creaper.commands.logging.ChangeConsoleLogHandler
import org.wildfly.extras.creaper.commands.logging.LogLevel
import org.wildfly.extras.creaper.commands.messaging.AddQueue
import org.wildfly.extras.creaper.commands.security.AddLoginModule
import org.wildfly.extras.creaper.commands.security.AddSecurityDomain
import org.wildfly.extras.creaper.core.ManagementClient
import org.wildfly.extras.creaper.core.offline.OfflineOptions
@seanf
seanf / versions-rules.xml
Last active January 9, 2018 07:37
Versions rules for versions-maven-plugin
<ruleset comparisonMethod="maven"
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
<!-- Thanks to Michael Piefel and Philip Helger: https://stackoverflow.com/a/22174801/14379 -->
<ignoreVersions>
<ignoreVersion type="regex">.*[-_\.](alpha|Alpha|ALPHA|b|beta|Beta|BETA|rc|RC|M|EA)[-_\.]?[0-9]*</ignoreVersion>
</ignoreVersions>
</ruleset>
@seanf
seanf / debugreact
Created January 22, 2018 03:05
Enables stack traces for React warnings
#!/bin/sh -e
sed -i 's/console.warn(/console.trace(/g' node_modules/react/lib/lowPriorityWarning.js
sed -i 's/console.error(/console.trace(/g' node_modules/fbjs/lib/warning.js
@seanf
seanf / tuple.md
Last active April 29, 2018 23:08 — forked from jcalz/tuple.md
TypeScript tuple inference

You can use the tuple() function in tuple.ts to infer tuple types in TypeScript and cut down on the need to repeat yourself. Without tuple(), declaring a constant of a tuple type looks like this:

const daysOfTheWeek: ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] = 
  ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];

You can't do this:

const daysOfTheWeek = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; 
@seanf
seanf / functionaljava_1.8-pom.xml
Created August 23, 2018 06:49
Functional Java dependencies for Java 8
<!-- http://www.mvnrepository.com/artifact/org.functionaljava -->
<dependency>
<groupId>org.functionaljava</groupId>
<artifactId>functionaljava_1.8</artifactId>
<version>4.8</version>
</dependency>
<dependency>
<groupId>org.functionaljava</groupId>
<artifactId>functionaljava-java-core_1.8</artifactId>
<version>4.8</version>
@seanf
seanf / Instances.java
Created August 27, 2018 08:06
Clean up CDI Instances (Dependent only)
/*
* Copyright 2018, Red Hat, Inc. and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
@seanf
seanf / unit.sh
Last active August 31, 2018 07:36 — forked from tvlooy/unit.sh
Bash test: get the directory of a script
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
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() {}
@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() {
@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" "$@"