Skip to content

Instantly share code, notes, and snippets.

View rhbvkleef's full-sized avatar

Rolf van Kleef rhbvkleef

  • Enschede, Netherlands
View GitHub Profile
@rhbvkleef
rhbvkleef / dragrace-api.yml
Last active May 16, 2021 14:35
Accumulation API for Drag Race Benchmark Results
openapi: "3.0.3"
info:
title: "DragRace Benchmark Service"
version: "0.0.1"
description: |
API definitions for the DragRace benchmark result accumulation service.
license:
name: "BSD 3-Clause"
url: "https://opensource.org/licenses/BSD-3-Clause"
servers:
defmodule Comeonin.Crypt do
use Agent
@callback check_pass(map(), String.t()) :: {:ok, map()} | {:error, String.t()}
@callback hashpwsalt(String.t(), Keyword.t()) :: String.t()
@callback checkpw(String.t(), String.t()) :: boolean()
@callback dummy_checkpw(Keyword.t()) :: false
@callback add_hash(String.t(), Keyword.t()) :: map()
@callback can_verify_hash(String.t()) :: boolean()
@callback needs_rehash(String.t(), Keyword.t()) :: boolean()
@rhbvkleef
rhbvkleef / comeonin_auto.ex
Created December 30, 2018 13:01
A concept for improving the usability of Comeonin. It may be a good idea to make the hashing modules check the requirements for rehashing so that algorithm-specific settings can be checked as well. This is just a concept for what I would like to see added in comeonin.
defmodule Comeonin.Auto do
if Application.get_env(:comeonin, :hash_algo) == Plain do
:elixir_errors.warn __ENV__.line, __ENV__.file,
"You are using the plain hashing algorithm! This results in passwords being plainly visible in the database! DO NOT USE THIS IN PRODUCTION!"
end
defp get_hash_mod hash do
cond do
String.starts_with?(hash, "$plain") -> Comeonin.Plain
String.starts_with?(hash, "$argon2") -> Comeonin.Argon2
@rhbvkleef
rhbvkleef / floppy.ino
Created February 8, 2015 15:52
Arduino floppy drive music - Sinterklaas is jarig
const int MUSIC_WAIT_TIME = 83;
const int MUSIC_BASE_TIME = 250;
const int MUSIC_INCREMENT_TIME = 333;
const int MUSIC_ARRAY_LENGTH = 61;
int dirPin = 2;
int stepPin = 3;
int dly = 1;
@rhbvkleef
rhbvkleef / dutch.js
Last active April 4, 2016 20:29
Dutch translation for tellraw generator
{
"template": {
"sign_block": "Bord (/blockdata)",
"sign_item": "Bord (/give)",
"subtitle": "Ondertitel",
"title": "Titel",
"tellraw": "Ruw vertellen",
"book": "Boek",
"execute_tellraw": "Voer uit"
},