Skip to content

Instantly share code, notes, and snippets.

@zorzysty
zorzysty / bytes.filter.js
Last active October 28, 2015 16:22 — forked from thomseddon/gist:3511330
AngularJS byte format filter
"use strict";
(function () {
angular.module("backOffice")
.filter('bytes', function () {
return function (bytes, precision) {
if (bytes === 0 || isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024)),
@zorzysty
zorzysty / pixel_z_README.md
Created September 15, 2013 21:42
pixel_z beta

pixel_z - the JS game

created by zorza 2013

beta version