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 / interfaces.go
Last active September 11, 2024 22:00
A Simple example of how to use interfaces in go
package main
import "fmt"
type DataSource interface {
Connect() error
Disconnect() error
}
type Postgres struct {
@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);
@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
A Post: Creating Google Cloud Functions with Kotlin
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 {