Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
'bout to graduate

Bradley Turek TurekBot

🤠
'bout to graduate
View GitHub Profile
@TurekBot
TurekBot / gist:6da5acd27f92c86dc68d3f6588eeb499
Created Aug 30, 2021
Iterates through all subfolders and files of the given folder and changes the owner from you to someone you specify.
View gist:6da5acd27f92c86dc68d3f6588eeb499
/*
Script to iterate through Files/Folders in Google Drive and change Ownership.
Will only attempt change after getting the current Owner and checking for match
from 'Welcome' sheet.
See blog post for full details and original spreadsheet: https://www.pbainbridge.co.uk/2020/04/bulk-change-ownership-of-google-drive.html
Note:
> Current Owner will become an Editor - include option to remove them?
> New Owner will get an email for each item.
@TurekBot
TurekBot / keybase.md
Created Jul 20, 2020
Proof that I'm me.
View keybase.md

Keybase proof

I hereby claim:

  • I am turekbot on github.
  • I am bradleyturek (https://keybase.io/bradleyturek) on keybase.
  • I have a public key ASDN30loKJ5J04uaS-Brg5IWAPP-ydKMKaSFsrYtELfmZAo

To claim this, I am signing this object:

View replace-email.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- This template will return the Message, changing the email address to the one provided. -->
<xsl:output method="xml" omit-xml-declaration="yes"/>
<!-- Here we set up a parameter that will be passed in. -->
<xsl:param name="emailReplacement"/>
<!-- This block copies the whole thing (the input) into the output. -->
<xsl:template match="node() | @*">
<xsl:copy>
View gist:46d7e79bc7f498ef81ec921883558106
2019-10-15 17:20:32,570 [qtp1683360946-59] ERROR (Deploy.java [installAndDeployFromDb]:240) - Deployment incomplete, 1 issues found: replace-email.xsl: replace-email.xsl cannot be stored
org.expath.pkg.repo.PackageException: Deployment incomplete, 1 issues found: replace-email.xsl: replace-email.xsl cannot be stored
at org.exist.repo.Deployment.deploy(Deployment.java:461) ~[exist-core-5.0.0.jar:5.0.0]
at org.exist.repo.Deployment.installAndDeploy(Deployment.java:281) ~[exist-core-5.0.0.jar:5.0.0]
at org.exist.repo.Deployment.installAndDeploy(Deployment.java:158) ~[exist-core-5.0.0.jar:5.0.0]
at org.exist.xquery.modules.expathrepo.Deploy.installAndDeployFromDb(Deploy.java:238) [exist-expathrepo-5.0.0.jar:5.0.0]
at org.exist.xquery.modules.expathrepo.Deploy.eval(Deploy.java:182) [exist-expathrepo-5.0.0.jar:5.0.0]
at org.exist.xquery.BasicFunction.eval(BasicFunction.java:74) [exist-core-5.0.0.jar:5.0.0]
at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:41) [exist-core-5.0.0.jar:5.0.
View WebViewFitContent.java
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.collections.ListChangeListener;
import javafx.concurrent.Worker.State;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.layout.Region;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
@TurekBot
TurekBot / ClipBoardFXAwtComparison.java
Last active Apr 14, 2019
A program to test out the differences between the AWT Java Clipboard and the JavaFX Clipboard.
View ClipBoardFXAwtComparison.java
package sample;
import com.sun.glass.ui.ClipboardAssistance;
import javafx.application.Application;
import javafx.embed.swing.SwingFXUtils;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
@TurekBot
TurekBot / javapackager template.iss
Last active Feb 5, 2020
The Inno Setup template that the javapackager uses to create installers. If you use this template as a drop-in resource, the javapackager will still replace the variables for you. Found in the jar %JAVA_HOME%\lib\ant-javafx.jar under the com\oracle\tools\packager\windows\template.iss file.
View javapackager template.iss
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder APPLICATION_NAME with application files
[Setup]
AppId={{PRODUCT_APP_IDENTIFIER}}
AppName=APPLICATION_NAME
AppVersion=APPLICATION_VERSION
AppVerName=APPLICATION_NAME APPLICATION_VERSION
AppPublisher=APPLICATION_VENDOR
AppComments=APPLICATION_COMMENTS
AppCopyright=APPLICATION_COPYRIGHT
@TurekBot
TurekBot / Investigator.java
Created Mar 8, 2018 — forked from james-d/Investigator.java
Example of JPA entities that use JavaFX properties. These use a "super-lazy" idiom for instantiating the properties, and implement Externalizable to work around the lack of Serialization support in the FX property classes.
View Investigator.java
package edu.marshall.genomics.lims.entities;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
@TurekBot
TurekBot / gist:51187a9bdfde85374cf6f8b2ebccf57e
Created Feb 5, 2018
PopupDemo's `VirtualizedScrollPane<InlineCssTextArea> vsPane = new VirtualizedScrollPane<>(area);` throws this exception when you try to type in the text area.
View gist:51187a9bdfde85374cf6f8b2ebccf57e
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException
at org.reactfx.util.AccumulationFacility$IllegalAccumulation.reduce(AccumulationFacility.java:16)
at org.reactfx.util.HashAccuMap.addAll(AccuMap.java:168)
at org.reactfx.util.IteratorBasedAccuMap.addAll(AccuMap.java:127)
at org.reactfx.util.NotificationAccumulatorBase.addAll(NotificationAccumulator.java:107)
at org.reactfx.ObservableBase.enqueueNotifications(ObservableBase.java:62)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:56)
at org.reactfx.SuspendableBase.handleEvent(SuspendableBase.java:82)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
@TurekBot
TurekBot / build.gradle
Created Jan 10, 2018
Gradle Shadow Example
View build.gradle
group 'com.github.yourusername'
version '1.0-SNAPSHOT'
//These are dependencies that have to do with just the build. See: https://stackoverflow.com/a/23627293/5432315
buildscript {
repositories {
jcenter()
}
dependencies {
//This is necessary to use the gradle shadow plugin