Skip to content

Instantly share code, notes, and snippets.

Adrian D. Finlay afinlay5

Block or report user

Report or block afinlay5

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 Countdown.sh
#!/home/adrian/java/openjdk-11/bin/java --source 11
//Simple CRON Job reimplemented using Java APIs!
import java.io.File;
import java.util.Date;
import java.util.Timer;
import java.util.Calendar;
import java.util.TimerTask;
import java.time.LocalDateTime;
@afinlay5
afinlay5 / RenamePhotos.sh
Created Jul 10, 2018
Script I used to rename and move photos.
View RenamePhotos.sh
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Files;
import java.io.IOException;
public class RenamePhotos {
public static void main (String[] args) throws IOException {
try {
var dest = new java.io.File("/run/secret/").toPath();
var photos = new java.io.File("/run/secret/blah").listFiles();
View build.gradle
/*
OnyxFxMobile: A simple, cross-platform NBA stat app for Andriod, iOS written in Java/JavaFX.
Author: Adrian D. Finlay
License: GPLv2
*/
buildscript {
repositories {
jcenter()
}
View javafxports Bash Script
#!/bin/bash
echo "Creating platform independent directories...."
mkdir -p src/main/java
mkdir -p src/main/resources
echo "Creating directories for Android...."
mkdir -p src/android/java
mkdir -p src/android/resources
mkdir -p src/android/assets
View javafxports Windows Shell
:: This Script automates the creating of our project directories.
@ECHO OFF
ECHO "Creating platform independent directories...."
MD src/main/java
MD src/main/resources
ECHO "Creating directories for Android...."
MD src/android/java
MD src/android/resources
View HTTPDemo.java
import java.io.File;
import java.net.URI;
import java.util.Scanner;
import java.time.Duration;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.io.InputStream;
import java.io.FileOutputStream​;
import java.net.Authenticator;
View RESTDemo11.java
/*
Copyright (C) 2018 Adrian D. Finlay. All rights reserved.
Licensed under the MIT License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://opensource.org/licenses/MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
View RESTDemo.java
/*
Copyright (C) 2018 Adrian D. Finlay. All rights reserved.
Licensed under the MIT License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://opensource.org/licenses/MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
View win.gradle snippet
{ properties ->
defineProperty("WINDOWS_VS_VSINSTALLDIR", properties, "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community");
defineProperty("WINDOWS_VS_WINSDKDLLINSTALLDIR", properties, "C:/Program Files (x86)/Windows Kits/10/Redist/10.0.17763.0/ucrt/DLLs");
defineProperty("WINDOWS_SDK_DIR", properties, System.getenv().get("WINSDK_DIR"))
defineProperty("WINDOWS_SDK_VERSION", properties, "")
defineProperty("WINDOWS_VS_VCINSTALLDIR", properties, "$WINDOWS_VS_VSINSTALLDIR/VC")
defineProperty("WINDOWS_VS_DEVENVDIR", properties, "$WINDOWS_VS_VSINSTALLDIR/Common7/IDE")
defineProperty("WINDOWS_VS_DEVENVCMD", properties, "$WINDOWS_VS_DEVENVDIR/devenv.exe")
defineProperty("WINDOWS_VS_MSVCDIR", properties, WINDOWS_VS_VCINSTALLDIR)
defineProperty("WINDOWS_DXSDK_DIR", properties, System.getenv().get("DXSDK_DIR"))
View VarAnonInner.java
public class VarAnonInner {
public static void main (String[] args) throws Exception {
var anonInner = new Anon() {
public void hello() {
System.out.println("New method here, and you can easily access me in Java 10!\n" +
"The class is: " + this.getClass()
);
};
};
anonInner.hello();
You can’t perform that action at this time.