Skip to content

Instantly share code, notes, and snippets.

@portnov
portnov / NodeTree
Created April 12, 2024 17:46
Sverchok.v1.3.0-alpha | Blender.3.4.1 | NodeTree | 2024.04.12 | 22:46 | license: CC BY-SA
{
"export_version": "1.0",
"main_tree": {
"nodes": {
"Marching Cubes": {
"attributes": {
"location": [
98.79039001464844,
172.26422119140625
]
@portnov
portnov / NodeTree
Created April 12, 2024 17:46
Sverchok.v1.3.0-alpha | Blender.3.4.1 | NodeTree | 2024.04.12 | 22:46 | license: CC BY-SA
{
"export_version": "1.0",
"main_tree": {
"nodes": {
"Marching Cubes": {
"attributes": {
"location": [
98.79039001464844,
172.26422119140625
]
@portnov
portnov / NodeTree
Created April 12, 2024 17:02
Sverchok.v1.3.0-alpha | Blender.3.4.1 | NodeTree | 2024.04.12 | 22:02 | license: CC BY-SA
{
"export_version": "1.0",
"main_tree": {
"nodes": {
"A Number": {
"attributes": {
"location": [
155.0430908203125,
146.80162048339844
],
@portnov
portnov / NodeTree
Created April 12, 2024 17:02
Sverchok.v1.3.0-alpha | Blender.3.4.1 | NodeTree | 2024.04.12 | 22:02 | license: CC BY-SA
{
"export_version": "1.0",
"main_tree": {
"nodes": {
"A Number": {
"attributes": {
"location": [
155.0430908203125,
146.80162048339844
],
@portnov
portnov / test.py
Created January 12, 2024 13:21
Matrix rotations
>>> from mathutils import Matrix, Vector
>>> axis = Vector((1,1,2))
>>> m1 = Matrix.Rotation(1.2, 4, axis)
>>> m1
Matrix(((0.46863141655921936, -0.6547330021858215, 0.5930507779121399, 0.0),
(0.8672804236412048, 0.46863141655921936, -0.16795594990253448, 0.0),
(-0.16795594990253448, 0.5930507779121399, 0.7874525189399719, 0.0),
(0.0, 0.0, 0.0, 1.0)))
@portnov
portnov / DefaultLayouts.hs
Created January 1, 2024 17:21
Default layouts
module DefaultLayouts where
import Control.Monad
import qualified Data.Set as S
import qualified Data.Map as M
import XMonad
import qualified XMonad.Util.ExtensibleState as XS
import XMonad.Utils
create table tst_array(
id int primary key generated always as identity,
ts int not null,
value int[] not null
);
insert into tst_array (ts, value)
select
(i / 20)::int,
array(
@portnov
portnov / 1 - repro.sql
Last active September 24, 2023 05:27
Dumping functions that reference other schmas
create schema portnov;
create schema s1;
set search_path = "$user", s1, public;
create domain s1.mytype as text;
create or replace function portnov.my_value(id int) returns mytype as $$
declare
var mytype;
-- portnov@localhost:5432/portnov
-- 15 сент. 2023 г. 10:16:11
create table merchant (
id int generated always as identity primary key,
name text not null,
mcc text not null,
notes text
);
@portnov
portnov / test-eav.sql
Created September 14, 2023 20:58
operations EAV
-- portnov@localhost:1521/TXPDB
-- 14 сент. 2023 г. 15:40:23
create table tst_operation (
id int8 generated always as identity primary key,
date datetime not null,
amt numeric not null
);