A Pen by A.Marchenko on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Install Docker (https://get.docker.com/) | |
curl -fsSL https://get.docker.com -o install-docker.sh | |
sudo sh install-docker.sh | |
# 2. Setup Caddy | |
mkdir -p caddy | |
cd caddy | |
mkdir -p conf | |
nano conf/Caddyfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prefixWithZero(value, minLength = 2) { | |
value = value + ""; | |
while (value.length < minLength) { | |
value = `0${value}`; | |
} | |
return value; | |
} |
Scrypt is a hashing algorithm first published in 2009 to address the security of passwords stored in a database. Generating such a hash is computationally intensive, meaning it takes a "long" time to generate a hash. This is fast enough for the sign-in process but makes it extremely costly to attempt brute-force to crack an existing password's hash.
SCrypt Modified is a fork of this algorithm. From its documentation, the intentions of the fork are unclear.
While official SCrypt takes password
and salt
to generate the hash, modified has a few additional steps:
- Generate
derivedKey
by creating a Scrypt hash wherepassword
is utf8-encoded, andsalt
is base64-decoded salt + base64-decoded salt separator - Generate
hash
by encrypting base64-decodedsignerKey
with aes-256-ctr wherekey
is the first 32 characters ofderivedKey
, while using an empty initialization vector of length 16 - Final
hash
must be base64-encoded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
traefik: | |
image: traefik:2.5 | |
container_name: appwrite-traefik | |
command: | |
- --providers.file.directory=/storage/config | |
- --providers.file.watch=true | |
- --providers.docker=true | |
- --providers.docker.exposedByDefault=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure to stop Appwrite before this backup, | |
# and make sure you have enough space on the machine. | |
# After backing up, make sure there is a file in 'backups/backup-___.tar.gz'. | |
# Also please check size of this file, it should be at least 5kb, even for small instances. | |
docker run --rm \ | |
-v appwrite_appwrite-mariadb:/backup/appwrite-mariadb \ | |
-v appwrite_appwrite-redis:/backup/appwrite-redis \ | |
-v appwrite_appwrite-cache:/backup/appwrite-cache \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type AppwriteCategory = { | |
title: string; | |
queries: string[]; | |
orderAttributes: string[]; | |
orderTypes: string[]; | |
collectionName?: string; | |
} | |
export const AppwriteMovieCategories: AppwriteCategory[] = [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Offset pagination (ms) | Cursor pagination (ms) | ||
---|---|---|---|
0% offset | 3.73 | 6.27 | |
10% offset | 52.39 | 4.07 | |
20% offset | 96.83 | 5.15 | |
30% offset | 144.13 | 5.29 | |
40% offset | 216.06 | 6.65 | |
50% offset | 257.71 | 7.26 | |
60% offset | 313.06 | 4.61 | |
70% offset | 371.03 | 6.00 | |
80% offset | 424.63 | 5.60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Offset pagination (ms) | ||
---|---|---|
0% offset | 3.73 | |
10% offset | 52.39 | |
20% offset | 96.83 | |
30% offset | 144.13 | |
40% offset | 216.06 | |
50% offset | 257.71 | |
60% offset | 313.06 | |
70% offset | 371.03 | |
80% offset | 424.63 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This snippets expect that your functions use JSON as both input and output | |
// Connect to appwrite, should be globaly shared | |
let sdk = new Appwrite(); | |
sdk | |
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint | |
.setProject("5df5acd0d48c2"); // Your project ID | |
// Shared type for strict type definition |
NewerOlder