Skip to content

Instantly share code, notes, and snippets.

@davbre
davbre / .htaccess
Last active August 29, 2015 14:16 — forked from andfinally/.htaccess
# html5 pushstate (history) support:
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L,QSA]
</ifModule>
@davbre
davbre / bcp47.ex
Created October 12, 2017 15:53 — forked from erikreedstrom/bcp47.ex
Elixir module for parsing bcp 47 (https://tools.ietf.org/html/bcp47) spec'd language tags.
defmodule BCP47 do
@moduledoc ~S"""
Main BCP47 module.
The `BCP47` module provides a parser for
[bcp 47](https://tools.ietf.org/html/bcp47) spec'd language tags.
"""
@type tag :: String.t
@davbre
davbre / blank.ex
Created October 12, 2017 16:15 — forked from erikreedstrom/blank.ex
Blank protocol for Elixir
defmodule Blank do
@moduledoc """
Tools around checking and handling undefined or blank data.
"""
@doc """
Returns `true` if data is considered blank/empty.
"""
def blank?(data) do
Blank.Protocol.blank?(data)
@davbre
davbre / DecryptKeystore.java
Last active October 22, 2020 12:58 — forked from usmansaleem/DecryptKeystore.java
Decrypt EIP-2335 Keystore. Place it in web3signer installation and invoke it as `java -cp "lib/*" ./DecryptKeystore.java ./scryptTestVector.json`
/*
* Copyright 2020 ConsenSys AG.
*
* 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, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the