Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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. switcher switcher Public

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

    JavaScript 19 3

  2. https-record-generator https-record-generator Public

    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
    var formatFilesize = function (size, decimals, system) {
    2
    	size = parseInt(size, 10)
    3
    	if (!decimals && decimals!==0) decimals = 1
    4
    	if (!system) system = 'decimal'
    5
    	var fileSizes = {
  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
    enum FileSizeSystems {
    2
    	Decimal = 'decimal',
    3
    	Binary = 'binary',
    4
    }
    5
    const formatFilesize = (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
    public enum FileSizeSystem { Decimal, Binary }
    2
    public static string FormatFilesize (int Size) { return FormatFilesize(Size, 1, FileSizeSystem.Decimal); }
    3
    public static string FormatFilesize (int Size, int Decimals) { return FormatFilesize(Size, Decimals, FileSizeSystem.Decimal); }
    4
    public static string FormatFilesize (int Size, FileSizeSystem System) { return FormatFilesize(Size, 1, System); }
    5
    public static string FormatFilesize (int Size, int Decimals, FileSizeSystem SizeSystem) {
  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
    function format_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'),
Morty Proxy This is a proxified and sanitized view of the page, visit original site.