Skip to content

Instantly share code, notes, and snippets.

View rluvaton's full-sized avatar
:octocat:
Programming

Raz Luvaton rluvaton

:octocat:
Programming
View GitHub Profile
@rluvaton
rluvaton / MarkdownGitHubTheme.md
Last active January 9, 2018 13:06
Markdown Theme On GitHub

Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

underline


@rluvaton
rluvaton / getFolderSize.js
Last active June 26, 2023 12:15
Get Folder Size - App Script
var count = 0;
function myFunction() {
Logger.log('Starting');
// Please Write the path of the folder you want sub path seperated with slash(,) (spaces are counted)
// for example: for myFolder/test -> myFolder,test
// And NOT myFolder, test
var folders = [];
if(!folders) {
@rluvaton
rluvaton / mongo-error-code.ts
Last active October 23, 2023 06:41
Mongo Error Code #mongo #ts
export enum MongoErrorCode {
OK = 0,
InternalError = 1,
BadValue = 2,
OBSOLETE_DuplicateKey = 3,
NoSuchKey = 4,
GraphContainsCycle = 5,
HostUnreachable = 6,// Categories: NetworkError, RetriableError
HostNotFound = 7,// Categories: NetworkError, RetriableError
UnknownError = 8,
@rluvaton
rluvaton / unicodeToText.js
Created January 8, 2019 13:39
Unicode to text converter
function unicodeToText(b, endian, backSlashU) {
var d, c = "";
if (!backSlashU) {
c = "\\\\u"
}
return b.replace(new RegExp(c + "([0-9a-fA-F]{4})", "g"), function(e, f) {
d = parseInt(f, 16);
if (endian) {
d = (((d & 255) << 8) | ((d & 65280) >>> 8))
}
@rluvaton
rluvaton / pouchdb-benchmark.js
Created February 7, 2019 16:10 — forked from perliedman/pouchdb-benchmark.js
PouchDB Benchmark
var dbName = 'http://localhost:5984/couch-test',
nDocs = 10000,
batchSize = 1000,
scrapFactor = 0,
docs = [],
testQuery = 'entries/sumTime',
destroyDb = false,
_log = console.log,
db;
@rluvaton
rluvaton / consoleMd5Encryption.js
Created February 28, 2019 12:33
MD5 Command Line Script #cli #tool
function md5cycle(x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];
a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17, 606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
@rluvaton
rluvaton / BatteryIconDirective.ts
Created March 6, 2019 16:33
Angular Directive for making battery Icon from font awesome change by the percentage #angular #directive #battery-animation
import {AfterViewInit, Directive, ElementRef, Input} from '@angular/core';
@Directive({
selector: '[batteryIcon]'
})
export class BatteryIconDirective implements AfterViewInit {
private _batteryPercentage: number;
@Input()
@rluvaton
rluvaton / logger.service.ts
Last active April 29, 2020 21:34
Logger Service in Angular #angular #ts #service #logger
import {Injectable} from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class LoggerService {
constructor() {
}
@rluvaton
rluvaton / README.md
Last active April 29, 2020 21:37
Run CMD As Administrator #batch #cmd #powershell #cli

Run CMD as Administrator

💡 Pro Tip: Add this script to PATH to make it accessible from anywhere

@rluvaton
rluvaton / reference-types-from-another-file-library.js
Last active April 29, 2020 21:24
Reference types from another file / library #jsdoc #types #js
// Example of how to reference another file / library type
import puppeteer from 'puppeteer';
/** @typedef {import(@types/puppeteer).Browser} Browser */
/**
* @type Browser
*/
let browser;