Skip to content

Instantly share code, notes, and snippets.


Andreas Potthoff ElectroDrome

View GitHub Profile
ElectroDrome / format_bytes.php
Last active April 27, 2020 12:40
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";
$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 /
Last active April 27, 2020 12:48
Contributor License Agreement - Pi Fusion

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 @

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