Skip to content

Instantly share code, notes, and snippets.

@PseudoSky
PseudoSky / range-to-regex.ts
Created February 9, 2024 18:05
Utility to create numeric range validators
const RegexRange = {
cache: {},
clearCache: () => (RegexRange.cache = {})
}
interface CacheEntry {
min: number
a: number
max: number
b: number
@PseudoSky
PseudoSky / types.ts
Created December 14, 2020 02:13 — forked from ClickerMonkey/types.ts
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// empty object
type EmptyObject = { [key: string]: never };
@PseudoSky
PseudoSky / Awesome.md
Last active August 22, 2020 07:18
Awesome list
@PseudoSky
PseudoSky / 1_Notes.md
Last active July 2, 2020 14:53
Data structures & Algorithms
Input : Inorder -> 4 2 5 1 3
        Preorder -> 1 2 4 5 3
        Postorder -> 4 5 2 3 1
Output : Yes
Exaplanation : All of the above three traversals are of 
the same tree              1
@PseudoSky
PseudoSky / vindecoder.js
Created December 3, 2019 02:22 — forked from kevboutin/vindecoder.js
Decode a VIN
/**
* VIN decoder.
*
* kevinboutin on 3/11/18.
*
* My VIN for testing is WBA3A5G59DNP26082 so use the following command to invoke:
* node vindecoder WBA3A5G59DNP26082
*
* Examples:
* KM8JM12D56U303366
@PseudoSky
PseudoSky / README.md
Created October 31, 2018 13:18
Extract a dom nodes css selector

SmartSelect

Compute and minify an element's css selector

gistFileNameInput = '#gists > div:nth-child(4) > div > div.file-header > div.input-group.gist-filename-input > input.form-control.filename.js-gist-filename.js-blob-filename'
gistFileNameInput.length
> 151

newSelect = SmartSelect.cssPath(gistFileNameInput)
var SEPARATION = 80, AMOUNTX = 50, AMOUNTY = 50;
var container, stats;
var camera, scene, renderer;
var startX, startY;
var particles, particle, count = 0;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 3;
var mouseX = 0, mouseY = 50;
@PseudoSky
PseudoSky / Apentest2015
Created December 21, 2017 06:13 — forked from CHEF-KOCH/Apentest2015
Android Penetration Testing Tools 2015
Android Penetration Testing Tools 2015
by CHEF-KOCH
==============
Note:
1. These apps are not for beginners because expertise is needed on the Android platform.
2. Most of the apps work on Rooted Android devices. So root your Android device first. If you are not sure how to do it, learn how to by, reading one of the many sites available to help with this process.
3. You will lose your device’s warranty if you root it, so think twice before proceeding.
4. These apps can also harm your Android device. So please try these apps at your own risk
@PseudoSky
PseudoSky / .mongorc.js
Created December 12, 2017 04:15
Mongorc
__ansi = {
csi: String.fromCharCode(0x1B) + '[',
reset: '0',
text_prop: 'm',
foreground: '3',
bright: '1',
underline: '4',
colors: {
red: '1',
@PseudoSky
PseudoSky / Default (OSX).sublime-keymap
Last active September 26, 2018 03:35
Sublime Key Bindings
[
{
"keys": ["option+i"],
"args": null,
"command": "swap_case"
},
{
"keys": ["option+="],
"command": "show_overlay",