Skip to content

Instantly share code, notes, and snippets.

View incubated-geek-cc's full-sized avatar
🌏
Improving the world with baby steps 👣

CharmaineC incubated-geek-cc

🌏
Improving the world with baby steps 👣
View GitHub Profile
@incubated-geek-cc
incubated-geek-cc / imagedataToSVGDemo.html
Created January 28, 2025 21:12
Demo ImageTracer JavaScript plugin (https://github.com/jankovicsandras/imagetracerjs) built-in function imagedataToSVG: ƒ( imgd, options ).
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width,initial-scale=1.0'>
<title>Demo PNG to SVG</title>
<style>
html,body {
padding:0;
margin:0;
@incubated-geek-cc
incubated-geek-cc / imageToSVGDemo.html
Created January 28, 2025 20:01
Demo ImageTracer JavaScript plugin (https://github.com/jankovicsandras/imagetracerjs) built-in function imageToSVG: ƒ( url, callback, options ).
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width,initial-scale=1.0'>
<title>Demo PNG to SVG</title>
<style>
html,body {
padding:0;
margin:0;
@incubated-geek-cc
incubated-geek-cc / demo.html
Created August 28, 2024 04:07
The complete source code for how to export emoji image rendered by specific font files.
<!DOCTYPE html>
<html lang='en' class='notranslate' translate='no'>
<head>
<meta name='google' content='notranslate' />
<meta http-equiv='Content-Language' content='en' />
<meta charset='UTF-8'>
<style>
body {
padding: 5% 15%;
}
@incubated-geek-cc
incubated-geek-cc / ChatApplication.java
Created March 28, 2024 18:23
Source code for ChatApplication.java entity class converted from Application.java.
package gpt4all;
import com.hexadevlabs.gpt4all.LLModel;
import java.io.File;
import java.nio.file.Paths;
public class ChatApplication {
private LLModel model;
LLModel.GenerationConfig config;
@incubated-geek-cc
incubated-geek-cc / ChatPanel.java
Last active March 28, 2024 18:06
Chat interface code template for GPT4All.
package gpt4all.gui;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
@incubated-geek-cc
incubated-geek-cc / Application.java
Created March 19, 2024 11:44
Cleaned up source codes at Step 3.
package gpt4all;
import com.hexadevlabs.gpt4all.LLModel;
import java.io.File;
import java.nio.file.Paths;
public class Application {
public static void main(String[] args){
String prompt = "### Human:\nWhat is the meaning of life\n### Assistant:";
@incubated-geek-cc
incubated-geek-cc / Application.java
Created March 16, 2024 10:24
Source code taken originally from https://github.com/nomic-ai/gpt4all/tree/main/gpt4all-bindings/java. Configuration assumes that model is located in the same folder as the project folder.
package gpt4all;
import com.hexadevlabs.gpt4all.LLModel;
import java.io.File;
import java.nio.file.Path;
public class Application {
public static void main(String[] args){
@incubated-geek-cc
incubated-geek-cc / pg1.html
Created February 14, 2024 21:21
HOCR output produced by Tess4J V4, a Tesseract OCR wrapper for Java.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name='ocr-system' content='tesseract'/>
</head>
<body>
<div class='ocr_page' id='page_1' title='image ""; bbox 0 0 2480 3507; ppageno 0'>
<div class='ocr_carea' id='block_1_1' title="bbox 301 311 2176 1586">
@incubated-geek-cc
incubated-geek-cc / Test.java
Created February 13, 2024 16:04
Code snippet demo for step 2.
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.multipdf.Splitter;
@incubated-geek-cc
incubated-geek-cc / Test.java
Created February 13, 2024 15:41
Boilerplate for Tess4J v4. Code snippet demo for step 1.
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import net.sourceforge.tess4j.Tesseract;
public class Test {
public static void main(String[] args) {
Tesseract instance = new Tesseract();
int imageDPI = 300;
Path currentRelativePath = Paths.get("");