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 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*
@Kenya-West
Kenya-West / script.js
Last active May 4, 2024 12:33
InoReader copy cover image - copy cover image of the post you selected in article list view
// ==UserScript==
// @name InoReader copy cover image
// @namespace http://tampermonkey.net/
// @version 0.0.2
// @description Copy cover image of the post you selected in article list view
// @author Kenya-West
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*
// @match https://*.inoreader.com/folder*
// @match https://*.inoreader.com/starred*
@Kenya-West
Kenya-West / script.js
Last active May 3, 2024 07:53
InoReader autoplay video in card view - autoplays Telegram video generated by RSS-Bridge feed when user chooses "card view" (press `4`)
// ==UserScript==
// @name InoReader autoplay video in card view
// @namespace http://tampermonkey.net/
// @version 0.0.2
// @description Autoplays Telegram video generated by RSS-Bridge feed when user chooses "card view" (press `4`)
// @author Kenya-West
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*
// @match https://*.inoreader.com/folder*
// @match https://*.inoreader.com/starred*