Skip to content

Instantly share code, notes, and snippets.

View nedtwigg's full-sized avatar

Ned Twigg nedtwigg

View GitHub Profile
package common
import gg.jte.TemplateEngine
import gg.jte.TemplateOutput
// you need to define this interface yourself. It needs to have the render method,
// and you can add other methods if you want
interface JteModel {
fun render(engine: TemplateEngine, output: TemplateOutput)
}
@nedtwigg
nedtwigg / JteModelPlugin.java
Created March 22, 2023 17:56
A gradle plugin which generates Kotlin model files for each JTE template
import gg.jte.ContentType;
import gg.jte.compiler.TemplateParserVisitorAdapter;
import gg.jte.gradle.JteExtension;
import gg.jte.gradle.JteGradle;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@nedtwigg
nedtwigg / shed.scad
Created September 23, 2020 23:10 — forked from creationix/shed.scad
Shed design. Open in OpenScad to view 3d model.
windows = false; // show windows
stuff = false; // Show bikes, table, mower
l = 32; // Length of building in feet (16, 20, 24, 28, 32, ...)
h = 8*12-4.5+.5;
rl=6*12+1.375+.1; // cut to 73.5" long with 22.5 degree angles
tl = 68.7; // Used to tweak headers on top walls
// 2x6 concrete forms for foundation
// 10" wide grid
@nedtwigg
nedtwigg / copyright.py
Created June 5, 2020 17:18
Copied verbatim from http://0pointer.de/public/copyright.py on June 5 2020, to make sure it doesn't go away
@nedtwigg
nedtwigg / CleanCommand.java
Created April 25, 2019 05:18
A rewrite of CleanCommand
import java.io.File;
import java.io.IOException;
import java.util.Objects;
import java.util.TreeSet;
import java.util.function.Consumer;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.GitCommand;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;

Keybase proof

I hereby claim:

  • I am nedtwigg on github.
  • I am nedtwigg (https://keybase.io/nedtwigg) on keybase.
  • I have a public key ASAMSErs24BpSXmSE3jXGR6voOdYUc_KELFGkDGVPNrnqQo

To claim this, I am signing this object:

/*
* Copyright (C) 2016 DiffPlug, LLC - All Rights Reserved
* Unauthorized copying of this file via any medium is strictly prohibited.
* Proprietary and confidential.
* Please send any inquiries to Ned Twigg <ned.twigg@diffplug.com>
*/
package org.eclipse.swt.widgets2;
import java.util.function.DoubleConsumer;
@nedtwigg
nedtwigg / GitCliJGitWrapper.java
Last active March 12, 2016 01:30
A way to call JGit commands and stream their output.
import java.io.File;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.pgm.TextBuiltin;
import org.eclipse.jgit.pgm.opt.CmdLineParser;