Skip to content

Instantly share code, notes, and snippets.

View gggauravgandhi's full-sized avatar
🤓
Something can always be better, nothing is ever complete 🚀

Gaurav gggauravgandhi

🤓
Something can always be better, nothing is ever complete 🚀
View GitHub Profile
@gggauravgandhi
gggauravgandhi / navicat_reset_trial.sh
Created September 10, 2023 13:55 — forked from tuxity/navicat_premium_reset_trial.sh
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@gggauravgandhi
gggauravgandhi / reset-trial-navicat.sh
Created September 10, 2023 13:55 — forked from nakamuraos/reset-trial-navicat.sh
Reset trial Navicat 15, Navicat 16 on Linux
#!/bin/bash
# Author: NakamuraOS
# https://github.com/nakamuraos
# Latest update: 30/03/2022
# Tested on Navicat 15.x, 16.x on Linux
RED="\e[1;31m"
ENDCOLOR="\e[0m"
@gggauravgandhi
gggauravgandhi / child.js
Last active February 24, 2021 10:09
Basic Multi Threaded Perfect Number FInder {entryPoint: runner.js, dependencies: ['worker-farm']}
const numberFeeder = ({ start, end }) => {
const perfectNumbers = [];
for (let i = start; i <= end; i += 1) {
if (isPerfectNumber(i)) {
perfectNumbers.push(i);
}
}
return { range: { start, end }, perfectNumbers };
@gggauravgandhi
gggauravgandhi / express-jwt.js
Created February 19, 2021 08:13 — forked from vesse/express-jwt.js
Two Passport + JWT (JSON Web Token) examples
//
// Implementation using express-jwt middle
//
var express = require('express'),
ejwt = require('express-jwt'),
jwt = require('jsonwebtoken'),
passport = require('passport'),
bodyParser = require('body-parser'),
LocalStrategy = require('passport-local').Strategy,
BearerStrategy = require('passport-http-bearer').Strategy;
@gggauravgandhi
gggauravgandhi / installation_date_linux.sh
Last active February 4, 2021 05:27
Prints the installation date of your linux installation (Debian only)
# Method 1
echo "$(sudo ls -alct /|tail -1|awk '{print $6, $7, $8}')"
# Method 2
echo "$(last | grep 'wtmp'|awk '{print $3, $4, $5, $6, $7}')"
@gggauravgandhi
gggauravgandhi / how_to.md
Created August 4, 2020 14:13
Downloan Free EggHead Courses from Lessons, Courses, Playlist, etc

Steps

  1. Get Video links from page Paste following code into console
        setTimeout(() => {links=new Set(); $("a[data-click-handler=true]").each(function(ind , elem) {
            if(elem.href.match(/^https:\/\/egghead.io\/lessons/) ) 
            links.add(elem.href + "\n");
        }); console.log(links.size); navigator.clipboard.writeText(Array.from(links).join(""));}, 5000);

You have 5 seconds to click within anywhere in webpage, as this trick requries docuent to be active.

@gggauravgandhi
gggauravgandhi / flip_images.py
Created July 31, 2020 16:37
Flip images at random for given probability recursively
from glob import glob
from tqdm import tqdm
import cv2
from random import random
flip_probability = 0.5
base_path = "images"
extentions = ['.png', '.jpg', '.jpeg']
@gggauravgandhi
gggauravgandhi / neofetch.config
Last active June 9, 2020 09:29
Neofetch custom config to print with loop, .config/neofetch/config.conf
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
#info title
#info underline
info "OS" distro
#info "Host" model
info "Kernel" kernel
info "Uptime" uptime
@gggauravgandhi
gggauravgandhi / neofetch_loop.sh
Last active June 9, 2020 08:50
Neofetch print color output every x seconds with buffer using while loop
while true; do neofetch --backend off > /tmp/neofetch_file; clear; cat /tmp/neofetch_file; sleep 60; done
# or
watch -ctn 1 'neofetch | sed "s/25[hl]//g;s/7[hl]//"'
@gggauravgandhi
gggauravgandhi / mmdetection-install.md
Created May 29, 2020 07:22
mmdetection installation on ubuntu

Install dependecies

pip install docopt cython imgaug matplotlib mmcv requests torch==1.2.0 torchvision==0.4.0 terminaltables

pip install torchvision==0.4.0