Skip to content

Instantly share code, notes, and snippets.

View snatvb's full-sized avatar
👹
Maybe monads, maybe not :)

Andrew Avsenin snatvb

👹
Maybe monads, maybe not :)
  • Wargaming
  • Vilnius
View GitHub Profile
@snatvb
snatvb / memorySizeOfObject.js
Created May 21, 2020 14:07
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@snatvb
snatvb / rename_js_files.sh
Created August 8, 2017 09:11 — forked from afternoon/rename_js_files.sh
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;