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 / 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 / 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;
@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 / 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 / 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 / remove-all.js
Created July 1, 2020 11:23
Remove all recording from terminalizer profile #helper #terminalizer #remove
function getAllRecordingsUrl() {
return Array.from(document.querySelectorAll('a[href^="/view/"]')).map(a => a.href)
}
function sendDeleteRecordingReq(id) {
return fetch(`https://terminalizer.com/delete/${id}`, {
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-language": "en-US,en;q=0.9,he;q=0.8",
"sec-fetch-dest": "document",
a
@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 / README.md
Last active March 15, 2022 19:54
Helpful bash snippets

Helpful bash snippets

Git

Diff

Count number of additions in diff between HEAD and master for some file pattern

git diff master --numstat | \