Skip to content

Instantly share code, notes, and snippets.

View Ritika-Das's full-sized avatar
:octocat:
Bring things your way.

Ritika Das Ritika-Das

:octocat:
Bring things your way.
View GitHub Profile
@ShivamJoker
ShivamJoker / Useful bash commands.md
Last active November 17, 2024 19:19
Some of the useful bash commands which I use everyday

Rename all files extension recursively eg. .js to .jsx

find . -name '*.js' -exec sh -c 'mv "$0" "${0%.js}.jsx"' {} \;

Convert all images in a specific format (eg .png or .jpg to webp)

for i in *; do convert $i "${i%.*}.webp"; done   
@ShivamJoker
ShivamJoker / benchmark
Created December 5, 2021 11:11
nodejs stream benchmarks
❯ autocannon -c 5 -a 5 --timeout 1000000 'http://143.110.241.172/stream?limit=100000'
Running 5 requests test @ http://143.110.241.172/stream?limit=100000
5 connections
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Stat β”‚ 2.5% β”‚ 50% β”‚ 97.5% β”‚ 99% β”‚ Avg β”‚ Stdev β”‚ Max β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Latency β”‚ 14475 ms β”‚ 14588 ms β”‚ 15197 ms β”‚ 15197 ms β”‚ 14666.8 ms β”‚ 270.1 ms β”‚ 15197 ms β”‚
@ShivamJoker
ShivamJoker / GoogleLogin.js
Created December 29, 2020 16:23
Login to your google account with puppeteer
import puppeteer from "puppeteer-extra";
import StealthPlugin from "puppeteer-extra-plugin-stealth";
puppeteer.use(StealthPlugin());
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
const navigationPromise = page.waitForNavigation();
await page.goto("https://accounts.google.com/");
@mkczyk
mkczyk / .git-plugin-bash.sh
Last active May 13, 2025 21:07
Git aliases for bash (based on Oh My Zsh Git plugin)
#!/bin/bash
# To ~/.bashrc file add line:
# source ~/.git-plugin-bash.sh
# Based on Oh My Zsh Git plugin (without zsh functions):
# https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh
# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
#
@yomeshgupta
yomeshgupta / linkedin-connections-processing.js
Last active February 23, 2021 07:05
Accept or Reject all connection requests on LinkedIn
// Go to https://www.linkedin.com/mynetwork/invitation-manager/ and run the following code
// For more amazing content, visit -- https://bit.ly/devtools-yt
var ACCEPT_BTN_SELECTOR = ".invitation-card__action-btn:nth-of-type(2)";
var REJECT_BTN_SELECTOR = ".invitation-card__action-btn:nth-of-type(1)";
var DELAY = 2000; // in miliseconds | 2 seconds delay between each request accept
var ACCEPT = true; // set to false if you want to reject all connections
function sleep() {
🌞 Morning 111 commits β–ˆβ–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 12.0%
πŸŒ† Daytime 256 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 27.6%
πŸŒƒ Evening 352 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 37.9%
πŸŒ™ Night 209 commits β–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 22.5%
@carlynorama
carlynorama / SVGWriterTest.js
Created January 1, 2018 22:28
Write SVG to file in Javascript
let centerX = 15
let centerY = 15
let radius = 10
let style = "fill:rgb(200,200,255);"
const fs = require('fs')
let svg = ""
svg += '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
svg += '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'
@julienroubieu
julienroubieu / npm-install-all.sh
Created November 1, 2017 16:32
Run npm install in all subdirectories
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm install" \;
@gkhays
gkhays / DrawSineWave.html
Last active March 4, 2025 13:49
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;
@junzis
junzis / lowpass.py
Last active December 6, 2022 08:16
Python Lowpass Filter
# https://stackoverflow.com/questions/25191620/
# creating-lowpass-filter-in-scipy-understanding-methods-and-units
import numpy as np
from scipy.signal import butter, lfilter, freqz
from matplotlib import pyplot as plt
def butter_lowpass(cutoff, fs, order=5):
nyq = 0.5 * fs