Skip to content

Instantly share code, notes, and snippets.

View ArjanSchouten's full-sized avatar

Arjan Schouten ArjanSchouten

View GitHub Profile
@ArjanSchouten
ArjanSchouten / NativeHints.kt
Created January 13, 2023 11:07
Native hints for GraalVM using Spring boot 3 native-image support
package com.excellentwebcheck.x.config
import com.google.common.reflect.ClassPath
import org.springframework.aot.hint.*
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.ImportRuntimeHints
@Configuration
@ImportRuntimeHints(NativeHints.Companion.NativeHintsRegistrar::class)
class NativeHints {
@ArjanSchouten
ArjanSchouten / two-way-data-binding-react.tsx
Created December 20, 2022 10:13
Two-way databinding for Input elements for React, close to VueJS
import React, { useState } from 'react'
const bind = (value: string, set: (val: string) => void): Partial<React.InputHTMLAttributes<HTMLInputElement>> => ({
value,
onChange: (val) => set(val.currentTarget.value)
})
export const MyComponent = () => {
const [name, setName] = useState<string>('')
return (
{
"defaultAction": "SCMP_ACT_LOG"
}
@ArjanSchouten
ArjanSchouten / HTML boolean attributes list
Last active May 7, 2021 12:14
Below is a list of html boolean attributes. All these attributes must be leaved empty, filed with 0|1, filled with on|off, filled with true|false or used as a flag.
async
autocomplete
autofocus
autoplay
border
challenge
checked
compact
contenteditable
controls