Figure 1
#!/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" |
#!/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 |
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>() {
{ | |
"name": "Daily Digest", | |
"flow": [ | |
{ | |
"id": 12, | |
"module": "builtin:BasicRouter", | |
"version": 1, | |
"mapper": null, | |
"metadata": { | |
"designer": { |
#!/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', |
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);
#!/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 |
#!/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'" |