Skip to content

Instantly share code, notes, and snippets.

@nickman
nickman / AttributeValueSerializer.java
Last active March 1, 2024 04:14
Jackson JSON serializer for the DynamoDB V2 SDK's AttributeValue
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import software.amazon.awssdk.core.SdkBytes;
@bmhatfield
bmhatfield / .profile
Last active May 6, 2024 22:27
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
package hu.axt.iotrace;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_FINAL;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PRIVATE;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_STATIC;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_SUPER;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ILOAD;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESPECIAL;
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESTATIC;
@fumokmm
fumokmm / helloJLine.groovy
Last active December 10, 2015 22:38
JLine minimum sample in Groovy.
@GrabResolver(name='jline', root='http://jline.sourceforge.net/m2repo')
@Grab(group='jline', module='jline', version='0.9.9')
import jline.*
def prompt(ConsoleReader reader, String msg, Closure clos) {
while (true) {
def line = reader.readLine(msg)
if (line in [null, 'exit']) break
clos(line)
}
@zizon
zizon / Java6_flags
Created May 8, 2012 02:45
Java6 flags
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-XX:PSAdaptiveSizePolicyResizeVirtualSpaceAlot=-1
-XX:+JavaObjectsInPerm
-XX:-ZapUnusedHeapArea
-XX:-VerifyObjectStartArray
-XX:-VerifyAfterGC
-XX:-VerifyRememberedSets
-XX:+ScavengeBeforeFullGC
-XX:NewRatio=1
@vtkstef
vtkstef / todos
Created February 3, 2012 23:53
Add comments
add comments