I hereby claim:
- I am thinhha on github.
- I am ttha (https://keybase.io/ttha) on keybase.
- I have a public key ASBqxBdGll1GQg5uJY5Wh1Zqw1b74Zg1-z30lfUi4Vcp9Qo
To claim this, I am signing this object:
# See https://pre-commit.com/ for usage and config | |
files: '^(src|tests|scripts)\/\S*' | |
repos: | |
- repo: local | |
hooks: | |
- id: trailing-whitespace | |
name: trailing whitespace | |
stages: [commit] | |
language: system | |
entry: trailing-whitespace-fixer |
# Install sandboxfs | |
sudo apt install libfuse2 | |
curl -Lo /tmp/sandboxfs-0.2.0.tgz https://github.com/bazelbuild/sandboxfs/releases/download/sandboxfs-0.2.0/sandboxfs-0.2.0-20200420-linux-x86_64.tgz | |
sudo tar xzv -C /usr/local -f /tmp/sandboxfs-0.2.0.tgz | |
rm /tmp/sandboxfs-0.2.0.tgz | |
sandboxfs | |
# Install Python dependencies | |
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \ | |
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ |
CREATE OR REPLACE FUNCTION udf_sql.uint64be(x INT64) RETURNS BYTES AS ( | |
CAST((SELECT STRING_AGG(FORMAT("%x",x >> bit & 0x1), "" ORDER BY bit DESC) | |
FROM UNNEST(GENERATE_ARRAY(0, 63)) AS bit) AS BYTES) | |
) | |
; | |
CREATE OR REPLACE FUNCTION udf_sql.custom_hash(input BYTES, is_leaf BOOLEAN, depth INT64) RETURNS BYTES AS ( | |
SHA256( CASE WHEN is_leaf THEN b'0x00' ELSE b'0x01' END || udf_sql.uint64be(depth) || input ) | |
) | |
; |
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", |
I hereby claim:
To claim this, I am signing this object: