Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am thiloplanz on github.
  • I am thilosophy (https://keybase.io/thilosophy) on keybase.
  • I have a public key ASBhKvkq5ex7eDCaYBFEZV0t5bWAju_XF6CRfo80GOfRPQo

To claim this, I am signing this object:

@thiloplanz
thiloplanz / JacksonJsonSupport.scala
Last active Dec 18, 2015 — forked from chadselph/JacksonJsonSupport.scala
Spray JSON Support with Jackson
View JacksonJsonSupport.scala
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
import spray.http.{ContentTypes, HttpCharsets, HttpEntity, MediaTypes}
import spray.httpx.marshalling.Marshaller
import spray.httpx.unmarshalling.Unmarshaller
/**
* Use Jackson directly to avoid json4s's dependencies
*/
@thiloplanz
thiloplanz / Dockerfile
Last active Apr 9, 2018
Dockerfile for running WSO2 Identity Server 5.0.0 backed by Amazon RDS (MySQL) and Directory Service
View Dockerfile
#
# This Dockerfile builds a container image with the WSO2 Identity Server configured for use on AWS.
#
# It requires you to provide an RDS (using MySQL 5.5) and Amazon Directory Service.
# The URL and credentials are passed in using environment variables (which you can give to the run
# command or just add to the end of this file)
#
# You only need to copy/download this Dockerfile. The other files are automatically downloaded
# from this gist during the build.
#
@thiloplanz
thiloplanz / LICENSE
Created Dec 10, 2015
Apache License, version 2.0
View LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@thiloplanz
thiloplanz / NingJsonClient.scala
Last active Jan 9, 2016
Combines the Ning HTTP client library and the Jackson JSON library.
View NingJsonClient.scala
// Copyright (c) 2015/2016, Thilo Planz.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the Apache License, Version 2.0
// as published by the Apache Software Foundation (the "License").
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
@thiloplanz
thiloplanz / SSLKeyPinning.scala
Last active Sep 23, 2015
SSL key pinning helper for Scala applications (useful to securely work with self-signed server certificates)
View SSLKeyPinning.scala
// Copyright (c) 2015/2016, Thilo Planz.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the Apache License, Version 2.0
// as published by the Apache Software Foundation (the "License").
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
@thiloplanz
thiloplanz / Zero_knowledge_db.md
Last active Aug 2, 2022
Zero-knowledge databases
View Zero_knowledge_db.md

Zero knowledge databases

The idea

The idea is to provide a database as a service to end users in such a way that no one except the user herself can access the data, not even the hosting provider or the database administrator.

Advantages

  • A privacy- and/or security-conscious user will have more trust in such a setup.
  • The service provider cannot be coerced to release the data they were trusted with, and he cannot be held responsible for the content he is storing.
@thiloplanz
thiloplanz / ArrayConverter.java
Last active Jul 18, 2022
Sql2o type converter to handle columns of type ARRAY. https://github.com/aaberg/sql2o/issues/199
View ArrayConverter.java
// Written in 2015 by Thilo Planz
// To the extent possible under law, I have dedicated all copyright and related and neighboring rights
// to this software to the public domain worldwide. This software is distributed without any warranty.
// http://creativecommons.org/publicdomain/zero/1.0/
package sql2oarrays;
import java.io.InputStream;
import java.sql.Array;
import java.sql.Connection;
@thiloplanz
thiloplanz / mersenne-twister.ts
Last active Dec 30, 2021 — forked from banksean/mersenne-twister.js
A TypeScript implementation of the Mersenne Twister pseudo-random number generator
View mersenne-twister.ts
/*
* TypeScript port by Thilo Planz
*
* https://gist.github.com/thiloplanz/6abf04f957197e9e3912
*/
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
@thiloplanz
thiloplanz / PixelCounter.java
Created May 27, 2015
Counts the number of pixels in given RGB colour ranges that an image has
View PixelCounter.java
// Copyright 2015 Thilo Planz
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,