Skip to content

Instantly share code, notes, and snippets.

View PVince81's full-sized avatar

Vincent Petry PVince81

  • Stuttgart, Germany
View GitHub Profile
@PVince81
PVince81 / nc-test-received-shares.py
Created August 23, 2021 13:38
Create received shares
#!/usr/bin/env python3
# Instructions:
#
# Make sure to run: pip3 install pyocclient
# Might require PYTHONPATH when running if pyocclient is not installed in standard location.
#
import time
import sys
import owncloud
@PVince81
PVince81 / app-store-find-versions.py
Created March 3, 2022 11:06
Find apps compatible with platform version in Nextcloud app store
#!/usr/bin/python3
import json
import sys
from urllib.request import urlopen
from packaging import version
if len(sys.argv) > 1:
expectedVersion = version.parse(sys.argv[1])
else:
<?php
$s = $argv[1];
if (\Normalizer::isNormalized($s, \Normalizer::FORM_D)) {
print("Original string is using NFD normalization\n");
$nfc = \Normalizer::normalize($s, \Normalizer::FORM_C);
print("NFC: $nfc\n");
print("NFD: $s\n");
} elseif (\Normalizer::isNormalized($s, \Normalizer::FORM_C)) {
print("Original string is using NFC normalization\n");
@PVince81
PVince81 / test-norm.php
Last active October 28, 2022 08:33
Test Unicode normalization of given file name
<?php
// ref: https://www.win.tue.nl/~aeb/linux/uc/nfc_vs_nfd.html
$s = $argv[1];
if (\Normalizer::isNormalized($s, \Normalizer::FORM_D)) {
print("Original string is using NFD normalization\n");
$nfc = \Normalizer::normalize($s, \Normalizer::FORM_C);
print("NFC: $nfc\n");
print("NFD: $s\n");
} elseif (\Normalizer::isNormalized($s, \Normalizer::FORM_C)) {