Skip to content

Instantly share code, notes, and snippets.

Tres Finocchiaro tresf

Block or report user

Report or block tresf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ba1f89f121aed61c5df65c63c8164a57
owner 26126 0.0 1.5 11157332 255776 ?? S 10:38PM 0:10.70 /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=64601:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/owner/tray/out/production:/Users/owner/tray/lib/printing/pdfbox-app-2.0.14.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/src.zip:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx-swt.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx.web.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx.base.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx.fxml.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx.media.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx.swing.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javafx.controls.jar:/Users/owner/tray/lib/javafx/mac/javafx-sdk-11.0.2/lib/javaf
View patch_search.java
import sun.awt.AppContext;
import javax.print.PrintServiceLookup;
public class SlowPrinting {
// Refresh interval in seconds
public static int CUPS_REFRESH_INTERVAL = 30;
public static void main(String ... args) {
int count = 0;
View cert2.diff
diff --git a/src/qz/auth/Certificate.java b/src/qz/auth/Certificate.java
index 70b68bf..1bcdcc9 100644
--- a/src/qz/auth/Certificate.java
+++ b/src/qz/auth/Certificate.java
@@ -43,6 +43,10 @@ public class Certificate {
public static Certificate trustedRootCert = null;
public static final String[] saveFields = new String[] {"fingerprint", "commonName", "organization", "validFrom", "validTo", "valid"};
+ // Valid date range allows UI to only show "Expired" text for valid certificates
+ private static final Instant UNKNOWN_MIN = OffsetDateTime.MIN.toInstant();
View cert.diff
diff --git a/src/qz/auth/Certificate.java b/src/qz/auth/Certificate.java
index 70b68bf..5f01b83 100644
--- a/src/qz/auth/Certificate.java
+++ b/src/qz/auth/Certificate.java
@@ -43,6 +43,7 @@ public class Certificate {
public static Certificate trustedRootCert = null;
public static final String[] saveFields = new String[] {"fingerprint", "commonName", "organization", "validFrom", "validTo", "valid"};
+ private static final OffsetDateTime UNKNOWN_TIME = OffsetDateTime.MIN;
private static boolean overrideTrustedRootCert = false;
@tresf
tresf / ScaleFactor.java
Last active Aug 6, 2019
Scale Factor Test
View ScaleFactor.java
import com.sun.jna.platform.win32.GDI32;
import com.sun.jna.platform.win32.WinDef;
import java.awt.*;
public class Main {
public static void main(String[] args) {
float toolkit = 0;
View get-gtk-version.java
if (Toolkit.getDefaultToolkit() instanceof UNIXToolkit) {
int version = UNIXToolkit.getGtkVersion().getNumber();
System.out.println("Gtk version detected: " + version);
}
View findfx.java
try {
Class VersionInfo = Class.forName("com.sun.javafx.runtime.VersionInfo");
fxPath = VersionInfo.getProtectionDomain().getCodeSource().getLocation().toString();
} catch(Exception ignore) {}
if (fxPath.contains(DeployUtilities.detectJarPath())) {
System.out.println("#### Bundled with " + Constants.ABOUT_TITLE);
} else {
System.out.println("#### Provided by " + fxPath);
}
@tresf
tresf / FindJava.ps1
Last active Jun 24, 2019 — forked from elresleff/Find_java_CFs.ps1
Search Java for Commercial Features
View FindJava.ps1
# 2019 Tres Finocchiaro, Ed Resleff - CC0/Public Domain
# - Searches the system for Java
# - Looks for specified files or features (e.g. Commercial Features)
# Whether or not to show script debbuging information
$SHOW_DEBUG = $True;
# List of possible Java Runtime locations (including JDK) search locations
# Also traverses through 32-bit registry hive (WOW6432Node)
$JRE_SEARCH = @{
@tresf
tresf / PrintPDF.diff
Created Apr 17, 2019
Save QZ Tray PDF to file
View PrintPDF.diff
diff --git a/src/qz/printer/action/PrintPDF.java b/src/qz/printer/action/PrintPDF.java
index 9dab76e..240218e 100644
--- a/src/qz/printer/action/PrintPDF.java
+++ b/src/qz/printer/action/PrintPDF.java
@@ -32,6 +32,7 @@ import java.awt.print.PrinterJob;
import java.io.*;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.List;
View jssc_SerialNativeInterface.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class jssc_SerialNativeInterface */
#ifndef _Included_jssc_SerialNativeInterface
#define _Included_jssc_SerialNativeInterface
#ifdef __cplusplus
extern "C" {
#endif
#undef jssc_SerialNativeInterface_OS_LINUX
You can’t perform that action at this time.