Skip to content

Instantly share code, notes, and snippets.

View lucasfernandodev's full-sized avatar
👋

Lucas Fernando lucasfernandodev

👋
View GitHub Profile
@lucasfernandodev
lucasfernandodev / AdbCommands
Created January 31, 2024 23:00 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@lucasfernandodev
lucasfernandodev / bytesToSize.js
Created October 7, 2019 02:21 — forked from lanqy/bytesToSize.js
JavaScript To Convert Bytes To MB, KB, Etc
// from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return 'n/a';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if (i == 0) return bytes + ' ' + sizes[i];
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
};