I hereby claim:
- I am mpellegrini on github.
- I am mpellegrini (https://keybase.io/mpellegrini) on keybase.
- I have a public key ASCJzHB0u-QGRLctjx9M5lAJx3bsi5zOGQMbNmH6GWJt-go
To claim this, I am signing this object:
import { type AnyColumn, type SQL, sql } from 'drizzle-orm' | |
/** | |
* The Coalesce function evaluates the arguments in the specified order | |
* and always returns the first non-null value from the argument list. | |
* | |
* @template T - The type of the value being coalesced. | |
* @param args - The value to be coalesced. | |
* @returns - The SQL expression representing the coalesced value. | |
*/ |
CREATE OR REPLACE FUNCTION public.update_audit_metadata() | |
RETURNS trigger | |
LANGUAGE 'plpgsql' | |
AS | |
$function$ | |
BEGIN | |
NEW.created_at := OLD.created_at; | |
NEW.created_by := OLD.created_by; | |
NEW.version := OLD.version; | |
IF row (NEW.*) IS DISTINCT FROM row (OLD.*) THEN |
I hereby claim:
To claim this, I am signing this object:
package com.michaelpellegrini.example.functional; | |
import io.vavr.Function1; | |
import io.vavr.collection.List; | |
import static io.vavr.API.$; | |
import static io.vavr.API.Case; | |
import static io.vavr.API.Match; | |
import static io.vavr.Predicates.instanceOf; |
import org.jboss.resteasy.annotations.interception.ServerInterceptor; | |
import org.jboss.resteasy.core.ResourceMethod; | |
import org.jboss.resteasy.core.ServerResponse; | |
import org.jboss.resteasy.spi.Failure; | |
import org.jboss.resteasy.spi.HttpRequest; | |
import org.jboss.resteasy.spi.interception.MessageBodyWriterContext; | |
import org.jboss.resteasy.spi.interception.MessageBodyWriterInterceptor; | |
import org.jboss.resteasy.spi.interception.PreProcessInterceptor; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
public class LocalDateBinder implements Binder<Bind, LocalDate> { | |
@Override | |
public void bind(SQLStatement<?> stmt, Bind bind, LocalDate localDate) { | |
stmt.bind(bind.value(), localDate.format(DateTimeFormatter.ISO_LOCAL_DATE)); | |
} | |
} |
import javax.naming.Context; | |
import javax.naming.NamingEnumeration; | |
import javax.naming.NamingException; | |
import javax.naming.directory.Attributes; | |
import javax.naming.directory.DirContext; | |
import javax.naming.directory.InitialDirContext; | |
import javax.naming.spi.NamingManager; | |
import java.net.InetSocketAddress; | |
import java.util.ArrayList; | |
import java.util.Collection; |
// Create a configuration | |
Configuration configuration = new Configuration(); | |
//Create a CacheManager using defaults | |
CacheManager manager = CacheManager.create(configuration); | |
//Create a Cache specifying its configuration. | |
Cache testCache = new Cache( | |
new CacheConfiguration("test", maxElements) | |
.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU) |
<?xml version="1.0" encoding="UTF-8"?> | |
<web-fragment version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"> | |
<display-name>display-name</display-name> | |
<description>description</description> | |
</web-fragment> | |
// Better | |
public static boolean isEqual(byte[] a, byte[] b) { | |
if (a.length != b.length) { | |
return false; | |
} | |
int result = 0; | |
for (int i = 0; i < a.length; i++) { | |
result |= a[i] ^ b[i] | |
} |