Skip to content

Instantly share code, notes, and snippets.

View itsmnthn's full-sized avatar
⛱️
Loving it

Manthankumar Satani itsmnthn

⛱️
Loving it
View GitHub Profile
@itsmnthn
itsmnthn / serializationOfBigInt.ts
Created October 24, 2024 05:40
BigInt JSON Serialize and Deserialize in browser.
const originalParse = JSON.parse
/**
* Monkey patch BigInt toJSON and JSON.parse to support BigInt
* @example
* monkeyPatchBigInt() // JSON.parse will support BigInt
*/
export function monkeyPatchBigInt() {
// browser only check
if (typeof window === 'undefined') {
@itsmnthn
itsmnthn / countdownString.ts
Created February 28, 2024 08:29
useCountdownString vue composable to count down time supports new Date(...).toISOString() input
import type { MaybeRef } from 'vue'
import { computed, onMounted, onUnmounted, ref, toValue, watch } from 'vue'
/**
* Keep track of the time left until a future timestamp string
*
* @param futureTimestampRef may be reactive `new Date().toISOString()` string
*/
export function useCountdownString(futureTimestampRef: MaybeRef<string>) {
// Calculates the initial difference in seconds
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
@itsmnthn
itsmnthn / linkedin-liker.js
Last active January 18, 2024 11:29
Linkedin Feed Post liker
/**
* @author Manthankumar Satani <satanimanthan@gmail.com>
* @version 1.5.0
*/
/** Interval enough to like 6 to 10 post per minute */
const batchInterval = 60000
const random = true
const waitBetweenLikes = true
@itsmnthn
itsmnthn / instagram-popup-liker.js
Last active January 23, 2021 16:41
Instagram hashtag or profile post popup liker
/**
* @author Manthankumar Satani <satanimanthan@gmail.com>
* @version 1.0.0
*/
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function getLikeBtns(xpf, xpath) {
@itsmnthn
itsmnthn / instagram-feed-discover-liker.js
Last active February 16, 2021 15:08
Instagram feed and discover post liker
/**
* @author Manthankumar Satani <satanimanthan@gmail.com>
* @version 1.1.0
*/
function getLikeButtons($x, xpath) {
var items = [];
$x(xpath).forEach(item => {
if (
@itsmnthn
itsmnthn / twitter-liker.js
Last active January 17, 2024 14:37
Like tweets based on passed intervals, increase the ms amount to slow it down between likes and page scroll
/**
* @author Manthankumar Satani <satanimanthan@gmail.com>
* @version 1.5.0
*/
/** Interval enough to like 6 to 10 post per minute */
const batchInterval = 60000
const random = true
const waitBetweenLikes = true
@itsmnthn
itsmnthn / theming-in-scss.scss
Last active May 9, 2020 18:21
How to use default variable if same variable is not there for dark theme
$themes: (
default: (
logo: url("../images/brand/logo_vertical.svg"),
bg: $bg--light,
text: $text--light,
),
dark: (
logo: url("../images/brand/logo_vertical--invert.svg"),
text: $text--dark,
),