Skip to content

Instantly share code, notes, and snippets.

View bhagatparwinder's full-sized avatar
♥️
Happy, cheerful & confident!

Parwinder Bhagat bhagatparwinder

♥️
Happy, cheerful & confident!
View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@bhagatparwinder
bhagatparwinder / npm-upgrade-bleeding.sh
Created January 22, 2020 15:49 — forked from othiym23/npm-upgrade-bleeding.sh
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@bhagatparwinder
bhagatparwinder / validate_credit_card.js
Created May 28, 2021 15:51 — forked from DiegoSalazar/validate_credit_card.js
Luhn algorithm in Javascript. Check valid credit card numbers
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@bhagatparwinder
bhagatparwinder / scanner.sh
Created April 20, 2022 14:29 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@bhagatparwinder
bhagatparwinder / delete.md
Created June 14, 2022 19:07 — forked from timwco/delete.md
LinkedIn: Delete Messages (June 2022)

What

LinkedIn is a valuable resource, but sometimes it sucks. One of those times is when you want to delete messages. You have to select each message one by one. It takes about 4 "clicks" to successfully delete a message.

This script should help. Since LI requires you to perform multiple steps, I decided to automate it for you. Once you initiate the script, it will run every second. If a message has the ability to be deleted, it will be. If not, it will be archived. Some "InMail" messages cannot be deleted on the web app. This script should work as long as LI doesn't change their page layout or element names, which happens often.

Last tested & verified working on: June, 10, 2022

Special Thanks to @noncent for the updated script.

@bhagatparwinder
bhagatparwinder / fangxiao-domains-pihole-blocklist-11-2022
Created November 19, 2022 18:03 — forked from leviem1/fangxiao-domains-pihole-blocklist-11-2022
PiHole blocklist for phishing domains used by Fangxiao: bleepingcomputer.com/news/security/42-000-sites-used-to-trap-users-in-brand-impersonation-scheme/
This file has been truncated, but you can view the full file.
0.0.0.0 002sen.cn
0.0.0.0 003bty.cyou
0.0.0.0 005nj7z.cn
0.0.0.0 006ks4g.cn
0.0.0.0 0072875.xyz
0.0.0.0 0099q7e.cn
0.0.0.0 009gfy.cyou
0.0.0.0 00ckpr.cn
0.0.0.0 00cojpj.cn
0.0.0.0 00cvl.cn