Skip to content

Instantly share code, notes, and snippets.

View hu553in's full-sized avatar
🏡
Working remotely

Ruslan Khasanshin hu553in

🏡
Working remotely
View GitHub Profile
@hu553in
hu553in / extensions.txt
Last active June 3, 2025 12:58
VSCode settings
anysphere.cursorpyright
asciidoctor.asciidoctor-vscode
benjpas.close-all
charliermarsh.ruff
esbenp.prettier-vscode
github.vscode-github-actions
golang.go
grafana.grafana-alloy
mechatroner.rainbow-csv
mhutchie.git-graph
@hu553in
hu553in / Counters.java
Created April 4, 2025 06:53
Caffeine cache for Prometheus tagged counters in Spring Boot app
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics;
import java.time.Duration;
import org.springframework.stereotype.Component;
import static java.util.Arrays.asList;
@hu553in
hu553in / todoist-to-rss.go
Last active March 11, 2025 20:13
Yandex Cloud function to get RSS feed built from Todoist tasks with "rss" label
package main
import (
"context"
"encoding/json"
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"os"
@hu553in
hu553in / JdbcVersionPrinter.kt
Created March 11, 2025 14:11
Print JDBC version
package com.github.hu553in.jdbc_version_checker
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Repository
import javax.sql.DataSource
@Repository
class JdbcVersionChecker {
@Autowired
@hu553in
hu553in / guakify.sh
Created February 10, 2025 08:31
Guakify any app on Cinnamon (Linux Mint default)
#!/bin/bash
# This script checks if the given application is already running by looking for its window.
# If it is running (even if minimized), it brings that window to the front.
# Otherwise, it launches a new instance of the application.
#
# Requirements:
# wmctrl (install via: sudo apt-get install wmctrl)
#
# Customize these variables to match your application.
@hu553in
hu553in / ci.yml
Created January 1, 2025 21:59
GitHub Actions to build iOS app
variables:
APP_NAME: AlarmClock
name: CI
on:
push:
branches:
- main
tags:
@hu553in
hu553in / branches.txt
Last active November 19, 2024 04:09
Batch delete GitLab branches
feature/example1
bugfix/example2
@hu553in
hu553in / .zshrc
Last active November 7, 2024 00:51
Bash script to re-connect Bluetooth headphones on Linux via bluetoothctl and PulseAudio
hp() {
~/headphones.sh
}
@hu553in
hu553in / index.html
Created May 1, 2024 11:06
Simple redirection HTML page
<!DOCTYPE html>
<html lang="en" style="height: 100%; display: flex; flex-direction: column; justify-content: center">
<head>
<meta http-equiv="refresh" content="0; url=https://example.com/" />
</head>
<body style="margin: 0">
<p style="text-align: center">
Скоро вы будете перенаправлены на сайт.<br />
@hu553in
hu553in / ssh-login-notification.sh
Last active May 18, 2024 00:05
Send Telegram notification about SSH login
#!/bin/bash
# this file need to be stored in /etc/profile.d
# variables below must be initialized in order to make script working
CHAT_ID=""
BOT_TOKEN=""
DATE_EXEC="$(date "+%d %b %Y %H:%M")"