Skip to content

Instantly share code, notes, and snippets.

View hahouari's full-sized avatar

Hocine Abdellatif Houari hahouari

View GitHub Profile
@Meldiron
Meldiron / backup.sh
Last active July 3, 2024 07:43
Backup and Restore Appwrite, the lazy way 🐌
# 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 \
@Taosif7
Taosif7 / GeoHash.dart
Last active February 10, 2022 09:42
Dart Geohash Implementation
String chars = "0123456789bcdefghjkmnpqrstuvwxyz";
const BITS_PER_BASE32_CHAR = 5;
main() {
LatLng location = LatLng(22.5678, 72.1234);
String geohash = encode(location, 8);
print("Original: " + location.toString());
print("GeoHash: " + geohash);
print("Decoded: " + decodeGeoCode(geohash).toString());
}
@NitinPraksash9911
NitinPraksash9911 / UnzipUtils.kt
Last active May 6, 2024 15:31
Unzipping file in android/kotlin
import java.io.*
import java.util.zip.ZipFile
/**
* UnzipUtils class extracts files and sub-directories of a standard zip file to
* a destination directory.
*
*/
object UnzipUtils {
@tfeldmann
tfeldmann / duplicates.py
Last active July 14, 2024 19:48
Fast duplicate file finder written in python
#!/usr/bin/env python
"""
Fast duplicate file finder.
Usage: duplicates.py <folder> [<folder>...]
Based on https://stackoverflow.com/a/36113168/300783
Modified for Python3 with some small code improvements.
"""
import os
import sys
@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active July 15, 2024 13:40
npm vs yarn command translation cheat sheet
@kasperpeulen
kasperpeulen / README.md
Last active July 13, 2024 09:04
How to pretty-print JSON using Dart.