Skip to content

Instantly share code, notes, and snippets.

View Hc747's full-sized avatar
🤠
Waiting for builds to finish...

Harrison Cole Hc747

🤠
Waiting for builds to finish...
  • Australia
  • 14:13 (UTC +10:00)
View GitHub Profile
@catalinsgh
catalinsgh / PasswordValidatorTest.kt
Created June 29, 2020 19:48
PasswordValidatorTest using ParameterizedTest
internal class PasswordValidatorTest {
private val validator = PasswordValidator()
@ParameterizedTest(name = "given \"{0}\", when validating the password, then it should return {1}")
@MethodSource("passwordArguments")
fun `given input password, when validating it, then is should return if it is valid`(
password: String,
expected: Boolean
) {
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@roalcantara
roalcantara / sub_query.groovy
Last active March 1, 2024 16:49
Grails: Criteria + Subquery (DetachedCriteria)
/*
Suppose we need a query searching for all Equipments that are not being used in any ServiceOrder.
It means, given the following query:
select this_.*
from equipment this_
where this_.status == 'enabled'
and not exists (select so_.id as y0_ from service_order so_ where (so_.equipment_id=this_.id))
order by this_.serial_number asc;