Skip to content

Instantly share code, notes, and snippets.

// BUG: on chrome, new Intl.DateTimeFormat().resolvedOptions().locale does not report the correct browser locale
// see https://issues.chromium.org/issues/40070535
// for now, manually set default locale
// see https://stackoverflow.com/a/79146962/4274918
Settings.defaultLocale = Intl.DateTimeFormat(navigator.language).resolvedOptions().locale;
@aravindanve
aravindanve / bypass-disable-devtool.md
Last active April 20, 2025 17:34
Bypass disable-devtool

(Working as of 2025-02-09)

There are websites that use disable-devtool to prevent you from opening or using devtools. They typically prevent you from right clicking or using the keyboard shortcut to open devtools. Even if you successfully do so, they detect it and redirect you elsewhere. You can bypass this by using one of the following ways.

Opening devtools

If the shortcut F12 on Windows or Option + ⌘ + I on Mac do not work. Press the three vertically aligned dots in the top right corner of your Google Chrome or Microsoft Edge window. Under the section "More Tools", you'll see the option to select "Developer Tools" which opens the toolkit in your window.

@aravindanve
aravindanve / PayoneHostedTokenizationInput.tsx
Last active April 17, 2024 13:47
Custom input for payone hosted tokenization for antd form and step form
import Script from "next/script";
import { useCallback, useEffect, useRef, useState } from "react";
import { PayoneHostedTokenization } from "src/types/payoneHostedTokenization";
import styles from "./styles.module.css";
import { Button, Flex, Space, Spin, Typography, theme as antdTheme } from "antd";
import { CheckCircleFilled, CloseCircleFilled } from "@ant-design/icons";
import { apiClient } from "src/clients/apiClient";
import { useLocalize } from "src/plugins/locale/react/useLocalize";
const DIV_PAYONE_HOSTED_TOKENIZATION_ID = "payone-hosted-tokenization";
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View, useWindowDimensions } from "react-native";
import {
RenderHTML,
Document,
Node,
NodeWithChildren,
isDomElement,
} from "react-native-render-html";
import { parseDocument } from "htmlparser2";
package main
// This script reads a modified fit file (source.fit) and computes the correct
// crc16 value and writes the output to a new file (output.fit)
import (
"encoding/binary"
"encoding/hex"
"fmt"
"io"
@aravindanve
aravindanve / unsaveAllInstagramPosts.js
Last active December 12, 2024 15:07
Unsaved all saved instagram posts
/*
* unsaveAllInstagramPosts.js
* usage: visit https://instagram.com and run in the browser console (you must be logged in)
* version: 2021-03-07
* issues: does not unsave sponsored posts
*/
unsaveAllInstagramPosts = async () => {
const baseUrl = 'https://www.instagram.com';