Skip to content

Instantly share code, notes, and snippets.

View cambiata's full-sized avatar

Jonas Nyström cambiata

View GitHub Profile
@cambiata
cambiata / deno.json
Created December 18, 2024 13:28
BlackmagickSpeedEditorDeno.ts - A Deno-fied version of https://github.com/Haavard15/SpeedEditorHID
{
"nodeModulesDir": "auto",
"tasks": {
"dev": "deno run --watch main.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1",
"node-hid": "npm:node-hid@^3.1.2"
}
}
@cambiata
cambiata / DoricoWebsocketClient.ts
Last active December 17, 2024 21:31
DoricoWebsocketClient.ts
const clientName = 'DoricoWebsocketClient';
const connect = (): Promise<WebSocket> =>
new Promise(function (resolve, reject) {
const server = new WebSocket('ws://127.0.0.1:4560');
server.onopen = function () {
console.log('Connected');
resolve(server);
};
@cambiata
cambiata / Discriminated unions in Solid.js.tsx
Last active May 30, 2024 18:29
Displays a way to deal with discriminated union types in Solid-js, jsx view as well as store
import styles from './App.module.css';
import { For, Match, Switch, type Component } from 'solid-js';
import { createStore, SetStoreFunction } from 'solid-js/store';
type Todo = { id: number, text: string, done: boolean };
type TodosStateItems = { s: "Todos", todos: Todo[] };
type TodosState =
| { s: 'Empty' }
| { s: 'Loading' }
| TodosStateItems;

DaVinci Resolve Scripting Documentation

Updated as of 08 March 2019


In this package, you will find a brief introduction to the Scripting API for DaVinci Resolve Studio. Apart from this README.txt file, this package contains folders containing the basic import modules for scripting access (DaVinciResolve.py) and some representative examples.

Overview

As with Blackmagic Design Fusion scripts, user scripts written in Lua and Python programming languages are supported. By default, scripts can be invoked from the Console window in the Fusion page, or via command line. This permission can be changed in Resolve Preferences, to be only from Console, or to be invoked from the local network. Please be aware of the security implications when allowing scripting access from outside of the Resolve application.

@cambiata
cambiata / SimpleSvg.fuse
Last active October 9, 2023 17:09
SimpleSvg - Proof of concept Fuse for displaying Svg
-- SimpleSvg.Fuse
-- Proof of concept Fuse for displaying Svg content using the fuse drawing api
-- This file should be put in the Fustion/Fuses folder
-- (On windows, something like C:\ProgramData\Blackmagic Design\Fusion\Fuses)
require('SimpleSvgGraphics')
FuRegisterClass("SimpleSvg", CT_SourceTool, {
REGS_Name = "SimpleSvg",
//================================================================
#[derive(Debug)]
pub struct SomeCloneables<T>
where
T: Clone,
{
items: Vec<Option<T>>,
}
//----------------------------------------------------------------
use std::collections::HashMap;
static GLOBAL_COUNTER: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
#[derive(Hash, Eq, PartialEq, Debug)]
struct TypeA {
a: usize,
id: usize,
}
@cambiata
cambiata / Rust Image Viewer - Cargo.toml
Last active June 15, 2023 15:51
Rust image viewer from scratch: Matt Davies - https://www.youtube.com/watch?v=1yofBPRx864
[package]
name = "testwinit"
version = "0.1.0"
edition = "2021"
authors = ["Matt Davies"]
description = "Rust image viewer from scratch - https://www.youtube.com/watch?v=1yofBPRx864"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
type LoadingState =
| { type: 'empty' }
| { type: 'loading', progress: number }
| { type: 'success', result: number }
| { type: 'error', msg: string }
const loadingMachine = createMachine({
id: 'machine',
initial: 'active',
import { createMachine, interpret, send, sendParent, assign } from 'xstate';
type Child1Context =
| { type: 'empty' }
| { type: 'data', value: number }
| { type: 'error', msg: string }
const child1Machine = createMachine<Child1Context>({
id: 'timer',
initial: 'active',