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 parentPermissions.java
public static void setPermissionsParentally(Path toTraverse, boolean worldWrite) {
Path stepper = toTraverse.toAbsolutePath();
// Assume we shouldn't go higher than top-level (e.g. "/etc")
while(stepper.getParent() != null && !stepper.getRoot().equals(stepper.getParent())) {
log.info("Processing {}", stepper);
File file = stepper.toFile();
file.setReadable(true, false);
file.setExecutable(true, false);
file.setWritable(true, !worldWrite);
if (SystemUtilities.isWindows() && worldWrite) {
View SizeByStage.java
// MIT License
// 2020 Tres Finocchiaro
import javafx.application.*;
import javafx.concurrent.Worker;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.*;
import javafx.scene.image.WritableImage;
import javafx.scene.transform.Transform;
import javafx.scene.web.WebView;
import javafx.stage.*;
View ResizeBeforeShow.java
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.concurrent.Worker;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import javax.imageio.ImageIO;
View async_usage.js
qz.security.setSignaturePromise(async (toSign) => {
var pk = KEYUTIL.getKey(privateKey);
var sig = new KJUR.crypto.Signature({"alg": "SHA1withRSA"}); // Use "SHA1withRSA" for QZ Tray 2.0 and older
sig.init(pk);
sig.updateString(toSign);
var hex = sig.sign();
console.log("DEBUG: \n\n" + stob64(hextorstr(hex)));
return stob64(hextorstr(hex));
});
View lmms_cursor_crash.log
Process: LMMS [47638]
Path: /Users/USER/*/LMMS.app/Contents/MacOS/LMMS
Identifier: io.lmms
Version: 1.2.0.40 (1.2.0.40)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: LMMS [47638]
User ID: 501
Date/Time: 2020-01-29 14:15:49.716 -0500
@tresf
tresf / WebViewResize.java
Created Jan 18, 2020
Trying to fix race conditions in WebView
View WebViewResize.java
import com.sun.javafx.tk.TKPulseListener;
import com.sun.javafx.tk.Toolkit;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.Scene;
import javafx.scene.SnapshotParameters;
View WebViewResize.java
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.Scene;
import javafx.scene.SnapshotParameters;
import javafx.scene.image.WritableImage;
import javafx.scene.web.WebView;
View WebApp.java
package qz.printer.action;
import javafx.animation.PauseTransition;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.embed.swing.SwingFXUtils;
import javafx.event.ActionEvent;
View PrintHTMLStub.java
package qz.printer.action;
import com.github.zafarkhaja.semver.Version;
import qz.common.Constants;
import qz.deploy.DeployUtilities;
import qz.utils.SystemUtilities;
import java.awt.image.BufferedImage;
import java.awt.print.Printable;
import java.io.File;
import java.util.Date;
View qz-node.js
var qz = require("qz-tray"); // 2.1.0-2 or higher to fix #543
// Use default Proimse provided by Node.js
qz.api.setPromiseType(function promise(resolver) { return new Promise(resolver); });
// Simulate the browser's version of the websocket
qz.api.setWebSocketType(require('websocket').w3cwebsocket);
// Node 4.5 doesn't come with crypto, use sha.js instead
var createHash = require('sha.js');
You can’t perform that action at this time.