Skip to content

Instantly share code, notes, and snippets.

View MWhyte's full-sized avatar

Michael Whyte MWhyte

  • Belfast, Ireland
View GitHub Profile
@MWhyte
MWhyte / basic-select-table-record.java
Last active November 28, 2022 22:51
JOOQ Cheat Sheet
List<StaffRecord> staffRecords = context
.select()
.from(STAFF)
.fetchInto(StaffRecord.class);
A Post: Creating Google Cloud Functions with Kotlin
@MWhyte
MWhyte / A Post: Spring Security - Redirect based on User Roles
Last active December 16, 2021 21:23
A Post: Spring Security - Redirect based on User Roles
Post: TBD
Repo - https://github.com/mwhyte-dev/spring-security/tree/3.redirect-based-on-role
@MWhyte
MWhyte / A Post: Spring Security - User Roles and ThymeLeaf Extras
Last active December 16, 2021 21:10
A Post: Spring Security - User Roles and ThymeLeaf Extras
Post: https://mwhyte.dev/spring-security-user-roles-and-thymeleaf-extras-c10113d4ad75
Repo - https://github.com/mwhyte-dev/spring-security/tree/2.thymeleaf-extras
@MWhyte
MWhyte / A Post: Spring Security - Basic Login Form
Last active December 14, 2021 20:14
Post: Spring Security - Basic Login Form
Post: https://mwhyte.dev/spring-security-basic-login-form-7c8f6e6e9f56
Repo - https://github.com/mwhyte-dev/spring-security/blob/1.basic-form-login/pom.xml
@MWhyte
MWhyte / A Post: Exception Handling in Java
Last active December 8, 2021 20:14
Post: Exception Handling in Java
A Post: Exception Handling in Java
plugins {
java
application
}
repositories {
mavenCentral()
}
dependencies {
@MWhyte
MWhyte / SimpleRetry.kt
Created August 11, 2020 22:37
A simple resilience4j retry example written in kotlin
import io.github.resilience4j.retry.Retry
import io.github.resilience4j.retry.RetryConfig
import io.github.resilience4j.retry.RetryRegistry
import java.time.Duration
import java.util.function.Supplier
var x = 0
fun main() {
@MWhyte
MWhyte / Recovery.java
Last active October 14, 2015 18:22
Potential reconnect methods
package com.code.util;
public class Recovery {
private long SLEEP_TIME = 3000;
public void connectToTp(){
try {
@MWhyte
MWhyte / MainActivity.java
Last active September 30, 2015 12:05
Using lambda's with android. With help from gradle-retrolambda
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
loginBtn = (Button) findViewById(R.id.login_btn);
loginBtn.setOnClickListener((View) -> login());
Log.i(TAG, "onCreate finished");
}