Skip to content

Instantly share code, notes, and snippets.

View leonid-shevtsov's full-sized avatar
🇺🇦
Help Ukraine Win

Leonid Shevtsov leonid-shevtsov

🇺🇦
Help Ukraine Win
View GitHub Profile
engines:
- name: prom
engine: xpath
shortcut: prom
disabled: false
search_url: https://prom.ua/ua/search?search_term={query}&page={pageno}
results_xpath: //div[@data-qaid="product_block"]
content_xpath: .//span[@data-qaid="product_presence"] | .//div[@data-qaid="product_price"] | .//div[@data-qaid="company_link"]
url_xpath: .//a[@data-qaid="product_link"]/@href
title_xpath: .//span[@data-qaid="product_name"]
// Javascript for Mac Automation (JXA)
function run(input, parameters) {
let currentTab = Application("Safari").windows[0].currentTab;
let issueText = String(currentTab.name()).replace(/^\[(.+)\]/, '$1:').replace(/- JIRA$/,'' )
let app = Application.currentApplication();
app.includeStandardAdditions = true;
app.displayNotification(issueText, { withTitle: "📋 Copied to clipboard" });
app.setTheClipboardTo(issueText);
}
let writerReadySemaphore = DispatchSemaphore(value: 0)
let frameWrittenSemaphore = DispatchSemaphore(value: 0)
let isFinished = Atomic<Bool>(false)
let queue = DispatchQueue(label: "gif_convertor")
videoWriterInput.requestMediaDataWhenReady(on: queue) {
while !isFinished.load(ordering: .sequentiallyConsistent),
videoWriterInput.isReadyForMoreMediaData
{
writerReadySemaphore.signal()
frameWrittenSemaphore.wait()
// adapted from https://gitlab.com/manzhara157/nanobelts/-/blob/main/example.pas
package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
# translated from https://gitlab.com/manzhara157/nanobelts/-/blob/main/example.pas
import math
import os
import numpy
from contextlib import suppress
def clean_files():
with suppress(FileNotFoundError):
# translated from https://gitlab.com/manzhara157/nanobelts/-/blob/main/example.pas
import array
import math
import random
import os
from contextlib import suppress
n0 = 200000
The goal: swap White and Black knights:
+-+
A |W|
+-+-+
B | | |
+-+-+-+
C | |W| |
+-+-+-+-+
D |B| |B| |
max_precise = 10 ** Float::DIG
last_best = 10
2.upto(256) do |base|
total = base
bits = 0
power2 = 1
chars = 1
require 'json'
canvas = JSON.parse(STDIN.read, symbolize_names: true)
all_ids = canvas[:nodes].map { |n| n[:id] }
dest_ids = canvas[:edges].map {|e| e[:toNode] }.uniq
root_ids = all_ids - dest_ids
nodes_by_id = canvas[:nodes].to_h {|n| [n[:id],n] }
graph = canvas[:edges].group_by {|e| e[:fromNode] }.transform_values { |vv| vv.map {|v| v[:toNode] }}
@leonid-shevtsov
leonid-shevtsov / README.md
Created June 20, 2024 08:44
Mindmap helpers for Obsidian Canvas Style Menu
  1. Install https://github.com/michaellw/Obsidian-Canvas-Style-Menu into your vault
  2. Copy mindmap_helpers.json to vault/.obsidian/plugins/canvas-style-menu/packages/mindmap_helpers.json
  3. Copy mindmap_helpers.css to `vault/.obsidian/snippets
  4. Enable "Mindmap Helpers" in Canvas Style Menu settings
  5. Enable snippets in Appearance settings