Skip to content
View EarMaster's full-sized avatar
🛸
🛸

Block or report EarMaster

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. switcherswitcherPublic

    switcher provides a similar syntax to a switch statement in JavaScript but with RegExp as cases

    JavaScript 19 3

  2. https-record-generatorhttps-record-generatorPublic

    Automatically tries to detect and generate a fitting HTTPS record for any website.

    HTML 1

  3. Formats a filesize into a human read...Formats a filesize into a human readable format. First parameter is filesize in bytes, second parameter is the precision of the resulting float and the last parameter is the system (choose between 'decimal' aka SI-based or 'binary' based calculation).
    1
    varformatFilesize=function(size,decimals,system){
    2
    size=parseInt(size,10)
    3
    if(!decimals&&decimals!==0)decimals=1
    4
    if(!system)system='decimal'
    5
    varfileSizes={
  4. Formats a filesize into a human read...Formats a filesize into a human readable format. First parameter is filesize in bytes, second parameter is the precision of the resulting float and the last parameter is the system (choose between 'decimal' aka SI-based or 'binary' based calculation).
    1
    enumFileSizeSystems{
    2
    Decimal='decimal',
    3
    Binary='binary',
    4
    }
    5
    constformatFilesize=(size: number,decimals: number=1,system: FileSizeSystems=FileSizeSystems.Decimal): string=>{
  5. Formats a filesize into a human read...Formats a filesize into a human readable format. First parameter is filesize in bytes, second parameter is the precision of the resulting decimal number and the last parameter is the system (choose between 'decimal' aka SI-based or 'binary' based calculation).
    1
    publicenumFileSizeSystem{Decimal,Binary}
    2
    publicstaticstringFormatFilesize(intSize){returnFormatFilesize(Size,1,FileSizeSystem.Decimal);}
    3
    publicstaticstringFormatFilesize(intSize,intDecimals){returnFormatFilesize(Size,Decimals,FileSizeSystem.Decimal);}
    4
    publicstaticstringFormatFilesize(intSize,FileSizeSystemSystem){returnFormatFilesize(Size,1,System);}
    5
    publicstaticstringFormatFilesize(intSize,intDecimals,FileSizeSystemSizeSystem){
  6. Formats a filesize into a human read...Formats a filesize into a human readable format. First parameter is filesize in bytes, second parameter is the precision of the resulting float and the last parameter is the system (choose between 'decimal' aka SI-based or 'binary' based calculation).
    1
    <?php
    2
    functionformat_filesize($size, $decimals=1, $system='decimal') {
    3
    $size = intval($size);
    4
    $fileSizes = array(
    5
    'decimal' => array('Byte', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'),