Skip to content

Instantly share code, notes, and snippets.

@jbasko
jbasko / konva_drag_drop.html
Created April 12, 2020 16:36
Konva Drag&Drop with dedicated drop areas
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/[email protected]/konva.min.js"></script>
<meta charset="utf-8" />
<title>Konva Drop</title>
<style>
body {
margin: 0;
@jbasko
jbasko / locijumi.py
Created November 4, 2021 20:58
Termina visu locījumu izdabūšana laukā no tezaurs.lv
"""
Dabūt laukā visus terminu locījumus no tezaurs.lv
"""
from typing import List
import requests
import dataclasses
API = "https://api.tezaurs.lv/v1/inflections/"
@jbasko
jbasko / indesign-generate-index.jsx
Last active November 8, 2021 22:39
Ģenerējam primitīvu jēdzienu rādītāju InDesign
/**
* Generate index based on multiple inflections of the same term.
* Requires http://underscorejs.org/ (with export statement removed) to be placed in the specified path.
*
*/
#target indesign;
#include "/path/to/underscore.js"
var _ = this._;
@jbasko
jbasko / koalicijas2022.py
Created October 6, 2022 10:32
Koalīciju rēķinātājs
import itertools
frakcijas = [
("JV", 26),
("ZZS", 16),
("AS", 15),
("NA", 13),
("S!", 11),
("LPV", 9),
("PRO", 10),
@jbasko
jbasko / fix_paragraphs.vb
Last active November 28, 2022 11:35
Clear character formatting in Word except for italics and superscript (macro)
Sub ResetFindParameters(oRng As Range)
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False