Skip to content

Instantly share code, notes, and snippets.

View Kenya-West's full-sized avatar
💻
Windows

Innokenty Ivanov Kenya-West

💻
Windows
View GitHub Profile
@Kenya-West
Kenya-West / README.md
Created July 3, 2025 06:51
Copy usernames from X/Twitter dialog "List members"

Copy usernames from X/Twitter dialog "List members"

  1. First, open Lists you have setup to track cohorts of people
  2. Then open list members

Paste this code in browser DevTools (F12) below. It will give youi

@Kenya-West
Kenya-West / Copy-FileToPattern.ps1
Created May 27, 2025 16:57
Copy file by pattern
<#
.SYNOPSIS
Copies a file to multiple destinations matching a wildcard path pattern.
.DESCRIPTION
This script copies a specified source file to multiple target directories defined
by a wildcard-based destination pattern. Use '*' in any folder segment to match
any directory name. Existing files are not overwritten unless you use -Force.
.PARAMETER SourcePath
@Kenya-West
Kenya-West / README.md
Created April 12, 2025 10:48
MacroDroid push messages templates

MacroDroid push messages templates

This gist resolves newline symbol missing in Macrodroid HTTP GET searchParams.

This is a template created for dedicated purpose - to copy them raw and paste without modifications to Macrodroid HTTP GET searchParams modal window. By pasting as raw without any modification, you will get a message with newlines, preserved for HTTP GET method.

Cloudflare Workers URL Proxy

This is a simple URL proxy script that forwards requests to a target URL specified by the url query parameter. If no URL is provided or if the URL is invalid, the script returns a 400 error.

Features

  • Proxy Requests: Forwards incoming HTTP requests to a target URL.
  • Error Handling: Returns a 400 error if the URL parameter is missing or invalid.
  • Flexible Request Handling: Supports GET, HEAD, and other HTTP methods.
@Kenya-West
Kenya-West / .env
Created March 2, 2025 19:17
Monitor cron jobs with custom script that wraps your cron job's script and send metrics to PushGateway
PUSHGATEWAY_URL= # PushGateway server URL
PUSHGATEWAY_USER= # Basic auth username to PushGateway server
PUSHGATEWAY_PASS= # Basic auth password to PushGateway server
INSTANCE= # Your string to name host instance. For the sake of readability, should be unique
TIMEOUT= # Dunno what is this for, no clear description of it
@Kenya-West
Kenya-West / README.md
Created February 2, 2025 11:26
Automatically download mongo-tools files from MongoDB website (only for Ubuntu)

Mongo-tools downloader

The problem

Let's assume I do not like to set and maintain MongoDB GPG keys and their repsitory lists in my Ubuntu host. I just need to download binaries and they should work.

The solution

This script only download a .tgz archive that contains requested binaries, to directory this script was run from.

@Kenya-West
Kenya-West / download_asset.sh
Last active December 15, 2024 09:49
Download specific asset using GitHub API, `curl` and `jq`
#!/bin/bash
# This script downloads specific asset that may be not included in the latest release
# but could be found in some other tag (version).
# You can set DEBUG=true ./download_asset.sh comnmand to enable debug messages.
# Requires curl, jq and head installed.
# You can set GitHub Personal Access token in $GITHUB_TOKEN to avoid API rate limiting. Look below.
# Constants (replace with your repo details)
OWNER="repo-owner-account" # GitHub username or organization
@Kenya-West
Kenya-West / split-and-join.ps1
Created November 28, 2024 07:28
Split long vertical image by sections and join them side-by-side (horisontally) via Powershell
# Requires ImageMagick to be installed: winget install -e --id ImageMagick.ImageMagick --source winget --accept-source-agreements --accept-package-agreements
# Ask the user for the input file path
$imagePath = Read-Host "Enter the path to the image file"
# Ask the user for the number of horizontal splits
$numParts = [int](Read-Host "Enter the number of horizontal parts to split the image into")
# Validate inputs
if (!(Test-Path $imagePath)) {
Write-Host "The file does not exist. Exiting." -ForegroundColor Red
@Kenya-West
Kenya-West / get-more-beatiful-nubmers.js
Created October 6, 2024 15:47
A ChatGPT snippet to output and sort the best (in terms of beauty) phone number to pick
// Helper function to check if all characters in a string are the same
function allSame(str) {
return str.split('').every(char => char === str[0]);
}
// Helper function to check if a string is a palindrome
function isPalindrome(str) {
return str === str.split('').reverse().join('');
}
@Kenya-West
Kenya-West / script.js
Last active October 6, 2024 15:46
Inoreader get Habr stats - shows comments and rating counter for Habr articles
// ==UserScript==
// @name InoReader get Habr stats
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Shows comments and rating counter for Habr articles
// @author Kenya-West
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*