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 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
View build.xml.diff
--- a/build.xml
+++ b/build.xml
@@ -86,7 +86,7 @@
<target name="build-jar" depends="compile-socket">
<echo>Building Jar for Socket use</echo>
<mkdir dir="${sign.lib.dir}"/>
- <jar compress="${jar.compress}" index="${jar.index}" destfile="${dist.jar}" duplicate="preserve">
+ <jar compress="false" index="${jar.index}" destfile="${dist.jar}-temp" duplicate="preserve">
<fileset dir="${build.project.dir}"/>
<zipgroupfileset dir="${sign.lib.dir}" includes="**/*.jar" erroronmissingdir="false"/>
View javaonpath.js
function javaOnPath() {
try {
shell.Exec('java.exe -version');
return true;
} catch(ignore) {}
return false;
}
@tresf
tresf / build.xml
Last active Feb 22, 2019
JavaFX download ant
View build.xml
<project name="test" default="download-javafx" basedir=".">
<target name="download-javafx" depends="download-javafx-windows,download-javafx-mac,download-javafx-linux,copy-native-current,copy-native-target">
<echo>Windows:</echo>
<echo> current.platform.windows=${current.platform.windows}</echo>
<echo> target.platform.windows=${target.platform.windows}</echo>
<echo> javafx.windows.needed=${javafx.windows.needed}</echo>
<echo> javafx.windows.found=${javafx.windows.found}</echo>
<echo/>
<echo>Mac:</echo>
<echo> current.platform.mac=${current.platform.mac}</echo>
@tresf
tresf / overflow.html
Last active Feb 5, 2019
QZ Tray HTML Overflow
View overflow.html
<html>
<head>
<script>
/**
* Nudges divs named "overflow" to flow onto the next page
*
* Author: Tres Finocchiaro, 2019-02-05
* License: Public Domain (use as you wish)
*
* TODO: Fix elements cutoff mid-page, is this even possible?
@tresf
tresf / qz_pagebreak.js
Last active Feb 4, 2019
QZ Tray 2.1 Page Break
View qz_pagebreak.js
/*
* Page Size Manipulator
*
* Author:
* 2019-02-04 tres@qz.io
* License:
* Public Domain (no restrictions)
* Description:
* Adjusts page style for print medium by reading dimensions from URL
* Created to work around JavaFX inability to read print style information.
You can’t perform that action at this time.