Skip to content

Instantly share code, notes, and snippets.

View tresf's full-sized avatar

Tres Finocchiaro tresf

View GitHub Profile
@tresf
tresf / qz-tray-properties.bat
Last active November 16, 2022 17:24
Add entry to properties file
@echo off
NET SESSION >nul 2>&1
if %ERRORLEVEL% EQU 0 (
echo Administrator PRIVILEGES Detected!
) else (
echo NOT AN ADMIN!
pause
exit
)
~LOGO;LOGO-QZ-0;128;256;DOTS
1;1-256
2;1;66;68;70;72;74;82;84;256
3;1;64;67;69;71;83;85;256
4;1;61;63;65;67;84;86;256
5;1;58;60;62;64;86;88;256
6;1;53;55;57;59;61;87;89;256
7;1;51;54;56;58;87;89;91;256
8;1;47;49;51;53;55;89;91;256
9;1;44;46;48;50;52;90;92;256
@tresf
tresf / CFG.html
Last active October 21, 2022 03:40
FGL Printing Examples
<F3>
<RC10,10>Serial Number = <VA1>
<RC60,10>Firmware = <VA7>
<RC110,10>Special Head = <VA18>
<RC160,10>Font File = <VA2>
<RC210,10>Printer Type = <VA11>
<RC260,10>DPI = <VA17>
<RC310,10>Expansion Mem = <VA50>
<RC360,10>Path Type = <VA19>
<RC410,10>Ticket Type = <VA13>
@tresf
tresf / HelloGUI.java
Last active October 10, 2022 22:34 — forked from 0x000000AC/HelloGUI
Hello World using the JOptionPane
/***********************************************
* HelloGUI.java
* Aaron P. Clark, A. Tres Finocchiaro
***********************************************/
import javax.swing.*;
public class HelloGUI {
public static void main(String ... args) throws Throwable {
SwingUtilities.invokeAndWait(() -> JOptionPane.showMessageDialog(null, "Hello, World!"));
}
@tresf
tresf / hello-pdfbox.py
Last active September 27, 2022 04:14
Python PDFBOX Example
# Hello PDFBOX - A suprisingly simple example for calling PDFBOX from Python
#
# Author: Tres Finocchiaro
# License: WTFPL
# STEPS:
# macOS:
# brew install python openjdk@11
# pip3 install jpype1
#
@tresf
tresf / ubl-2.0.xml
Last active June 1, 2022 09:28
UBL 2.0 Embedded Signature Example
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionURI>dummy1</ext:ExtensionURI>
<ext:ExtensionContent>
<dummy1:AnExtension xmlns:dummy1="urn:X-dummy1">
</dummy1:AnExtension>
</ext:ExtensionContent>
</ext:UBLExtension>
@tresf
tresf / qz-tray-angular.md
Last active January 6, 2022 19:52
QZ Tray Angular 11, 12, 13...

See also https://qz.io/wiki/api-overrides which has been updated to include these examples.

  1. QZ Tray uses the browser's path, but this is incompatible with Angular's browserless compiler. Allow the user of the browser's path by toggling this compiler feature off.

    package.json:

    -  }
    +  },
    +  "browser": {
    +    "path": false
@tresf
tresf / hexxit2.log
Last active December 22, 2021 00:43
Hexxit 2 Crash MacOS 10.14.6 Mojave
# Java: 8u311 x86_64
# Memory: 3GB RAM
# Launcher: Technic Launcher 4.708
# Launch Options: -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
# Error: Minecraft failed to start!
# Potential causes: Chocolate Quest Repoured Mod
# crash-2021-12-21_19.23.32-client.txt: https://gist.github.com/tresf/624d27e0634049685c1492a219c67a77
[B#708] Starting download of https://cdn.technicpack.net/platform2/pack-icons/896745.png?1639289357, with 3 tries remaining
[B#708] Running /Users/admin/Library/Application Support/technic/runtimes/jre-legacy/jre.bundle/Contents/Home/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Xms3072m -Xmx3072m -Djava.library.path=/Users/admin/Library/Application Support/technic/modpacks/hexxit-ii/bin/natives -Dfml.core.libraries.mirror=http://mirror.technicpack.net/Technic/lib/fml/%s -Dfml.ignoreInval
@tresf
tresf / hexxit2_modpack.log
Created December 22, 2021 00:42
Hexxit 2 Crash MacOS (con't)
---- Minecraft Crash Report ----
// Daisy, daisy...
Time: 2021-12-21 19:23:32 EST
Description: Initializing game
java.lang.RuntimeException: Failed to compile shader: 0
at team.cqr.cqrepoured.client.render.shader.ShaderProgram.<init>(ShaderProgram.java:50)
at team.cqr.cqrepoured.client.render.shader.ShaderProgram.<init>(ShaderProgram.java:30)
at team.cqr.cqrepoured.client.render.shader.ShaderProgram$Builder.build(ShaderProgram.java:93)
import qz from 'qz-tray'
const jwa = require('jwa')
class QzPrint {
static config = null
// TODO: setupSig can safely be combined with setupCert if needed
static async setupSig () {
// TODO: move private key to flat file, read using AJAX/fetch/etc
// privateKey = fs.readFileSync(__dirname + '/private-key.pem');
var privateKey = '-----BEGIN PRIVATE KEY-----\n''