Skip to content

Instantly share code, notes, and snippets.

@alexcmgit
alexcmgit / TampermonkeyLeetCodeUtils.js
Last active October 6, 2025 15:24
Tampermonkey LeetCode Utils
// ==UserScript==
// @name LeetCode Utils
// @namespace http://tampermonkey.net/
// @version 2025-02-11
// @description try to take over the world!
// @author You
// @match https://leetcode.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
// @grant GM_openInTab
// @grant GM_registerMenuCommand
import os
CONFIG_FILE_NAME = 'l10n.yaml'
def find_config_file_path(top: str = os.path.dirname(__file__)) -> str | None:
for dirpath, dirnames, filenames in os.walk(topdown=True, top=top):
for filename in filenames:
if filename == CONFIG_FILE_NAME:
return os.path.join(dirpath, filename)
import { useState, useEffect, useCallback } from "react";
import {
COLOR_SCHEME_PREFERENCE_CHANGE_EVENT,
ColorSchemePreference,
THEME_CHANGE_EVENT,
ThemeKey,
getColorSchemePreference,
getCurrentTheme,
setColorSchemePreference,
} from "../theme";
@alexcmgit
alexcmgit / README.md
Last active May 22, 2023 17:46
Nodejs script to run exiftool recursively in a directory from the windows explorer right-click context menu.
@alexcmgit
alexcmgit / sample.dart
Created March 17, 2023 12:26
Why you should prefer getter for state objects in Flutter.
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@alexcmgit
alexcmgit / discord-timezones.js
Last active March 8, 2023 23:31
Tampermonkey extension that parses almost any text string in the specific format: TZ(+1) to UTC, so you can see what is the timezone of your friend living in mars,
// ==UserScript==
// @name Annotate Discord user timezones
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://discord.com/*
// @icon https://icons.duckduckgo.com/ip3/discord.com.ico
// @grant none
// ==/UserScript==
@alexcmgit
alexcmgit / canvas-export.js
Last active March 5, 2023 16:03
Tampermonkey script to download any HTML canvas element as png.
// ==UserScript==
// @name Canvas Export
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @alexrintt
// @match https://*/*
// @icon data:image/svg+xml,%3Csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v12h2v2h-2v2h-2v-2H9v-2h2V4zM7 14v2h2v-2H7zm0 0v-2H5v2h2zm10 0v2h-2v-2h2zm0 0v-2h2v2h-2z' fill='%23808080'/%3E%3C/svg%3E
// @grant none
// ==/UserScript==
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@alexcmgit
alexcmgit / download-playstore-apk.md
Last active February 13, 2023 23:30
How to download PlayStore apks without PlayStore.

Disclaimer

The integrity of these apks is not guaranteed by PlayStore (neither I). It's up to you trust apkpure servers, do your checks before installing.


Send a GET request to this URL:

url = 'https://d.apkpure.com/b/APK/?version=latest'
const target = 200
const each = 10
const repetitions = Math.ceil(target / each)
const remainingHours = 8
const remainingMinutes = remainingHours * 60
const interval = Math.ceil(remainingMinutes / repetitions)
console.log(`${each} each ${interval} minutes`)