Skip to content

Instantly share code, notes, and snippets.

Jan De Kock jandk

Block or report user

Report or block jandk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jandk /
Last active Oct 27, 2019
Seasonic PSU pinout

Seasonic Prime Ultra Platinum 550

Always looking at connector side, lock on the right. Pin 1, 2 and 3 are defined on the connector by stripes on the side.

24-pin motherboard connector


| Color | Signal | Pin|Pin | Signal | Color |

View Poet.kt
import com.squareup.javapoet.*
import java.util.*
import javax.lang.model.element.Modifier
private fun generateIndexOfTriple(typeName: TypeName): List<MethodSpec> {
val arrayTypeName = ArrayTypeName.of(typeName)
val indexOf4 = indexOf4(arrayTypeName, false)
val indexOf2 = indexOf2(arrayTypeName, indexOf4, false)
val lastIndexOf4 = indexOf4(arrayTypeName, true)
val lastIndexOf2 = indexOf2(arrayTypeName, lastIndexOf4, true)
jandk /
Last active Sep 20, 2018
Product ordering
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
public class Main {
private static final AtomicInteger VOLUME = new AtomicInteger(0);
jandk /
Last active Sep 27, 2018
Reversible encoding and stringification of numbers
package be.tjoener.test;
public final class Feistel {
* Sets the number of rounds, security/speed trade-off
private static final int ROUNDS = 16;
package com.example.demo;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
public final class Person {
private final String firstName;
private final String lastName;
private Person(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
@SuppressWarnings({"unchecked", "rawtypes"})
static final class StringToEnumConverterFactory implements ConverterFactory<String, Enum> {
public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) {
return new StringToEnum(getEnumType(targetType));
import java.util.Arrays;
public class LargestNumber
public static void main(String[] args)
String number = IntStream.range(1, 31)
View Misc.cs
using System.IO;
public static class Misc
/// <summary>
/// Calculates the checksum on a v0.90 MD superblock.
/// Don't ask me why I needed it.
/// </summary>
/// <param name="filename">
if [ "$#" -lt 1 ]
echo "Usage: <folder> [folder]...\n"
exit 1
for d in $@
You can’t perform that action at this time.