Skip to content

Instantly share code, notes, and snippets.

View gelin's full-sized avatar

Denis Nelubin gelin

View GitHub Profile

The Bobuk-Bacek method for calculating project deadlines

Figure 1

Experienced team

@gelin
gelin / commit-msg.sh
Last active September 18, 2024 09:27
Git hook to put Jira issue ID from branch name to commit message
#!/bin/sh
# Hook automatically adds Jira issue ID to the commit message
# from the branch name.
# For example, if you're working in a branch `JIRA-123_something`,
# each commit message will be prepended with `JIRA-123 `.
# Copy this file as `$YOUR_GIT_REPO/.git/hooks/commit-msg` and make it executable.
TICKETS=$(git rev-parse --abbrev-ref HEAD | grep -Eo '[A-Z]+-[0-9]+' | tac)
#echo "$TICKETS"
@gelin
gelin / dolphin-animation.py
Last active September 14, 2024 05:20
Converts Flipper Animation assets to video files
#!/usr/bin/env python3
# Converts Flipper Animation assets to video files.
# Typical usage: ./dolphin-animation.py ${FLIPPERZERO_FIRMWARE}/assets/dolphin/external/L2_Wake_up_128x64
# Dependencies: python3-pil, ffmpeg
# Font: https://www.fontsaddict.com/font/download/haxrcorp-4089-cyrillic-altgr-regular.ttf
import argparse
import enum
import os
@gelin
gelin / chatgpt.md
Last active March 18, 2023 20:13
LRU set created by ChatGPT

Could you suggest a collection implementation for Java/Kotlin? it must be a set of strings. But a set with a limited size. If a new element is added to the set which did not exists in it, the last recently accessed element is removed from the set keeping the size of the set constant.

A suitable collection for this use case would be a LinkedHashSet. This collection maintains the order of elements as they are added and provides constant time access to the most recently added or accessed element.

To implement the limited size constraint, you can create a subclass of LinkedHashSet and override the add method to remove the least recently accessed element when the size limit is reached.

Here is an example implementation in Kotlin:

class LimitedSizeSet(private val maxSize: Int) : LinkedHashSet<String>() {
@gelin
gelin / readme.md
Created September 19, 2021 07:11
Как установить свежий LineageOS на планшет Sony Xperia Z3 Tablet Compact

Устройство

Sony Xperia Z3 Tablet Compact SGP611

Инструменты и принадлежности

  • Приложение fastboot. Оно поставляется вместе с Android SDK.
  • USB кабель
  • Компьютер под управлением Linux, с установленным Android SDK, USB и доступом в Интернет
@gelin
gelin / blueprint.json
Last active June 7, 2020 10:34
Integromat scenario blueprint to send daily digest with Google Calendar events and today weather to Telegram
{
"name": "Daily Digest",
"flow": [
{
"id": 12,
"module": "builtin:BasicRouter",
"version": 1,
"mapper": null,
"metadata": {
"designer": {
@gelin
gelin / wacom-config
Created May 30, 2020 12:21
Small GUI script to configure some parameters of Wacom pen tablet
#!/usr/bin/env python3
from sh import xsetwacom
from easygui import buttonbox
# define for your device
PREFIX = 'Wacom One by Wacom S Pen '
INPUTS = [
'stylus',
'eraser',
@gelin
gelin / jsonb_set.md
Created February 20, 2020 15:51
jsonb_set example

What is the result of this?

SELECT jsonb_set('{}', '{test}', to_jsonb((SELECT 'test' LIMIT 0)::text));

SELECT to_jsonb((SELECT 'test' LIMIT 0)::text);
@gelin
gelin / add-chrome-app
Last active May 10, 2024 07:09
Adds any URL as the Chrome application to the main menu
#!/usr/bin/env python3
import argparse
import re
import tempfile
import os.path
import subprocess
import urllib.request
import urllib.parse
from PIL import Image
@gelin
gelin / install.sh
Created February 20, 2020 15:49
Installs Redmine Time Tracker to main menu
#!/bin/sh
# Adds Redmine Time Tracker to the main menu.
# https://www.redmine.org/plugins/redmine-time-tracking-software
set -e
jar=$(find $PWD/ -name "*.jar")
echo "Found '$jar'"