- Install https://github.com/michaellw/Obsidian-Canvas-Style-Menu into your vault
- Copy mindmap_helpers.json to
vault/.obsidian/plugins/canvas-style-menu/packages/mindmap_helpers.json
- Copy mindmap_helpers.css to `vault/.obsidian/snippets
- Enable "Mindmap Helpers" in Canvas Style Menu settings
- Enable snippets in Appearance settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adapted from https://gitlab.com/manzhara157/nanobelts/-/blob/main/example.pas | |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"math" | |
"os" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The goal: swap White and Black knights: | |
+-+ | |
A |W| | |
+-+-+ | |
B | | | | |
+-+-+-+ | |
C | |W| | | |
+-+-+-+-+ | |
D |B| |B| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max_precise = 10 ** Float::DIG | |
last_best = 10 | |
2.upto(256) do |base| | |
total = base | |
bits = 0 | |
power2 = 1 | |
chars = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] }} |
NewerOlder