Skip to content

Instantly share code, notes, and snippets.

View NullDev's full-sized avatar
:octocat:
(◕‿◕)

NullDev // Chris NullDev

:octocat:
(◕‿◕)
View GitHub Profile
@NullDev
NullDev / 1-README.md
Last active May 9, 2023 00:50
Auto-Skip Amazon Video Ads / Promos

Auto-Skip for Amazon Video Ads / Promos

You just want to binge your show but Amazon interrupts your experience with those annoying promos between the episodes?
LOOK NO FURTHER

This script saves you some clicks and automatically skips those promos for you.

How to install

@NullDev
NullDev / greaterThan.js
Last active September 5, 2020 19:31
A JavaScript implementation to allow expressions such as 3 > 2 > 1
/**
* This basically allows expressions like 3 > 2 > 1
* which is usually written as 3 > 2 && 2 > 1
*
* I basically did this because I wanted to see how easy it is
* to implement such "new syntax" in JS
*
* Please don't use this. It's hacky.
*/
@NullDev
NullDev / README.md
Created January 16, 2020 14:42
Check if a windows binary (.exe) was compiled for 32 Bit or 64 Bit (useful for wine)

About

This script checks whether a windows binary (.exe file) was compiled ro 32 Bit or 64 Bit. If you mess around with Wine / PlayOnLinux a lot, this could be useful.

Usage

Making the script executable

@NullDev
NullDev / random_string.js
Last active March 9, 2020 15:39
ES6 way of generating a random string with variable length
let getRandomString = (length) => [...Array(length)].map(() => Math.random().toString(36)[2]).join("");
let str = getRandomString(10);
// -> 225n9b53x6
// ---
// Demo: https://jsfiddle.net/fku9y6sm/
@NullDev
NullDev / LICENSE.md
Last active August 18, 2021 21:16
This MIT License applies to all of my public gist's located at https://gist.github.com/NullDev - unless an individual gist states otherwise

MIT License

Copyright (c) NullDev

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@NullDev
NullDev / StarRating.css
Last active March 27, 2023 12:55
CSS Star rating System - Percentage Based, CSS Only Star rating System
.rating {
unicode-bidi: bidi-override;
color: #c5c5c5;
font-size: 25px;
height: 25px;
width: 100px;
margin: 0 auto;
position: relative;
padding: 0;
text-shadow: 0px 1px 0 #a2a2a2;
@NullDev
NullDev / logger.js
Created September 23, 2019 16:43
NodeJS Logger with StackTrace function
"use strict";
/**
* Formats the current time
*
* @returns {string} Time
*/
let getDate = function(){
const date = new Date();
let hourData = date.getHours();
@NullDev
NullDev / fizzbuzz.js
Last active October 9, 2021 19:38
Readable fizzbuzz one-liner in JavaScript
Array.apply([], Array(100)).map((e, i) => [["fizz"][i % 3], ["buzz"][i % 5]].join("") || i);
@NullDev
NullDev / SpaceShip.js
Last active February 3, 2022 19:23
A weird implementation of PHP's Spaceship operator in JavaScript
Number.prototype["<=>"] = function(x){
return Math.sign(this - x);
}
var result = 5 ["<=>"] `4`;
console.log(result);
// https://jsfiddle.net/veyar51m/
@NullDev
NullDev / ChainFunction.js
Last active November 15, 2018 14:58
Global Chain function example with prototyping
Function.prototype.test = function(x){
var arg1 = this();
var arg2 = x;
console.log(
"Arg1: " + arg1 +
"\nArg2: " + arg2
);
}