Skip to content

Instantly share code, notes, and snippets.

/**
* Exact implementation in javascript of the Damerau-Levenshtein algorithm as
* described on https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance
*
* The only difference is that all arrays in here are 0-based indexed whereas
* on wikipedia d has indices starting at −1, while a, b and da are one-indexed.
*
* @customfunction
*/
function distance(a, b) {
#!/usr/bin/env python3
# simple python script that reads eiscd file and outputs sortcode,bankid per sortcode for a specific range of banks
import sys
from lxml import etree
if len(sys.argv) != 2:
print("Please supply one argument, namely the eiscd file")
sys.exit()
@fschutte
fschutte / EiscdslurperApplication.kt
Last active October 1, 2022 20:47
EISCD slurper with Spring Boot and Kotlin. Reads EISCD xml file and outputs map from sort code to bank code.
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.MapperFeature
import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule
import com.fasterxml.jackson.dataformat.xml.XmlMapper
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import org.springframework.boot.*
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.stereotype.Component
import java.io.File
@fschutte
fschutte / create-keys-and-certificates.kts
Created December 9, 2018 13:46
Kotlin script for creating keys and certificates
import sun.security.x509.*
import java.io.File
import java.math.BigInteger
import java.security.*
import java.security.cert.X509Certificate
import java.util.*
/**
* Simple script for generating keys and certificates as needed to connect to the ING API.
@fschutte
fschutte / INGBasicExample.java
Last active October 4, 2020 06:36
Simple example for calling ING Bank Sandbox API
package nl.brachio.ingapi;
import com.jayway.jsonpath.JsonPath;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.net.JksOptions;
import io.vertx.ext.web.client.WebClientOptions;
import io.vertx.rxjava.core.Vertx;
import io.vertx.rxjava.core.buffer.Buffer;
import io.vertx.rxjava.ext.web.client.HttpResponse;
import io.vertx.rxjava.ext.web.client.WebClient;
@fschutte
fschutte / conditionalformatting.js
Last active August 29, 2015 14:20
Google Sheets script om de rij grijs te kleuren als de status op gesloten staat
function onEdit(e) {
if (e) {
var sheet = e.source.getActiveSheet();
var row = e.source.getActiveRange().getRow();
if (row != 1) { // kleur niet de eerste rij
colorRowByStatus(sheet, row);
}
}
}