Skip to content

Instantly share code, notes, and snippets.

View juherr's full-sized avatar

Julien Herr juherr

View GitHub Profile
@juherr
juherr / directus-cleaning.sql
Last active December 19, 2023 13:57 — forked from Tummerhore/directus-cleaning.sql
Directus (MySQL): Remove old activities, revisions, flow logs, notifications
/*
DISCLAIMER: Use at your own risk!
Tested with Directus 10.8.0 and MySQL 5.6
This will delete all flow execution logs, revisions and acitivites which are older
than the specified MinTimestamp and are not in the top <specified MinItems> latest
items. Activities related to saved revisions / flow logs are also saved even when
they normally would have been deleted.
Archived notifiactions are deleted when the creation of the notifaction is older
# Boxstarter : http://boxstarter.org
# run command prompt "cmd" as admin
# START START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/juherr/[...]/raw/[...]/win-box.txt
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
#Enable-RemoteDesktop
cinst googlechrome
#cinst firefox
@juherr
juherr / Main.java
Last active October 31, 2016 12:34
Surefire - Mixed JUnit and TestNG tests in a class
package test;
import org.testng.TestNG;
public class Main {
public static void main(String... args) {
TestNG tng = new TestNG();
tng.setTestClasses(new Class[]{MixedTest.class});
tng.setJUnit(false);
@juherr
juherr / JUnitTest.java
Created October 31, 2016 08:09
Surefire threadCount sample
package test;
import org.junit.Test;
public class JUnitTest {
@Test
public void testJ1() {}
}
@juherr
juherr / CompileClass2.java
Last active June 23, 2016 12:40
Eclipse compiler issue
package test;
public class CompileClass2 {
private void addInstance(MyClass<?> clazz) {
addInstance(clazz.getFoo(), clazz.getBar()); // <- compiler issue here
addInstance2(clazz.getFoo(), clazz.getBar());
}
private <T> void addInstance2(MyClass<T> clazz) {
@juherr
juherr / log.txt
Last active December 13, 2015 21:45
CheckTestNgListenerReporterIT_testNgListenerReporter_5.14.4
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.maven.plugins.surefire:testng-listener-reporter:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 75, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
@juherr
juherr / BeforeScreenshotTest.java
Created October 20, 2015 11:30
TestNG: No need of listener by class
package test;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@Listeners(ScreenshotMaker.class)
public class BeforeScreenshotTest implements Screen {
@juherr
juherr / ByteBuddyWithPowerMockTest.java
Created August 17, 2015 16:02
Byte Buddy issue with PowerMock
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.testng.PowerMockTestCase;
import org.testng.annotations.Test;
@PrepareForTest(ByteBuddyWithPowerMockTest.SampleClass.class)
public class ByteBuddyWithPowerMockTest extends PowerMockTestCase {
@juherr
juherr / Branch: surefire-1154
Created April 21, 2015 08:11
[SUREFIRE-1154] TestNG should be able to run its own tests
~/Projects/testng $ mvn -e test
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNG 6.8.22-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.1:resources (default-resources) @ testng ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
@juherr
juherr / keybase.md
Created February 5, 2015 08:28
Keybase proof

Keybase proof

I hereby claim:

  • I am juherr on github.
  • I am juherr (https://keybase.io/juherr) on keybase.
  • I have a public key whose fingerprint is 5324 0E3C 22D6 BB81 4DD6 19B1 838A 9B11 C4CC D7F2

To claim this, I am signing this object: