Skip to content

Instantly share code, notes, and snippets.

View idnovic's full-sized avatar
🔐
keeping things secure

Ivo Damjanovic idnovic

🔐
keeping things secure
View GitHub Profile
@idnovic
idnovic / numbers.php
Created March 13, 2023 23:00 — forked from bzikarsky/numbers.php
Codegolf: Convert numbers up to 999'999 into german numbers
Minified, 411 Bytes, with umlauts
Run with `php -d display_errors=Off` to hide DEPRECATED errors on 5.3
See OO-Version at <https://gist.github.com/750787>
<?function n($n,$a=0){$e=array(2=>'zwan','dreißig')+$d=split(':',':ein:zwei:drei:vier:fünf:sech:sieb:acht:neun:zehn:elf:zwölf');$t=$n%10;return$n<1000?($n<100?($n<20?($n<13?($d[$n].(($n-7)?(($n-1||$a)&&$n-6?'':'s'):'en')):$d[$t].'zehn'):n($t,1).($t?'und':'').$e[$n/10].(ceil($n/10)-4?'zig':'')):n((int)($n/100),1).'hundert'.n($n%100)):n((int)($n/1000),1).'tausend'.n($n%1000);}while($i<10000)echo n(++$i),"\n";
# verbose (some slight changes for readability)
function n($n, $prefix=0)
{
@idnovic
idnovic / seedutil.md
Created January 25, 2023 14:34 — forked from pookjw/seedutil.md
Enroll macOS Beta Seed without profile installation

seedutil

Enroll macOS Beta Seed without profile installation

Usage

$ sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil 
usage: seedutil enroll SEED_PROGRAM
    seedutil unenroll

seedutil current