Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Potthoff ElectroDrome

View GitHub Profile
@ElectroDrome
ElectroDrome / format_bytes.php
Last active Apr 27, 2020
PHP: Format bytes into a human readable format
View format_bytes.php
// convert bytes format
function format_Bytes($size,$level=0,$precision=2,$base=1024)
{
if ($size === '0' || $size === null) {
return "0 B";
}
else
$unit = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB','YB');
$times = floor(log($size,$base));
return sprintf("%.".$precision."f",$size/pow($base,($times+$level)))." ".$unit[$times+$level];
@ElectroDrome
ElectroDrome / cla_pi-fusion.md
Last active Apr 27, 2020
Contributor License Agreement - Pi Fusion
View cla_pi-fusion.md

Contributor License Agreement

This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, bug fixes, documentation, data, feedback, information or any other works of authorship that you submit or have submitted, in any form and in any manner, to the maintainer(s) of Essential Additions ("Maintainers"). If you have any questions regarding this Agreement or license(s), please contact licences @ electrodrome.net

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License

You hereby grant, and agree to grant, to the Maintainers a non-exclusive, perpetual, irrevocable, worldwide, royalty-free, transferable copyright license to reproduce, prepare derivative works of, publicly display, distribute your Contributions, and reserve all rights under the Apache 2.0 license and any later versi

You can’t perform that action at this time.