This gist shows a quick overview of calling Rust in a Swift project, with Swift Package Manager configured.
Let's go ahead and create a folder containing all our sources:
mkdir swift-rs && cd $_
package main | |
import ( | |
"context" | |
"fmt" | |
"net" | |
"net/http" | |
"os" | |
"os/exec" | |
"os/signal" |
import Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
flat = { | |
'some.nested.keys': 'flat' | |
}; | |
nested = { | |
some: { | |
nested: { |
import Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
flat = { | |
'some.nested.keys': 'flat' | |
}; | |
nested = { | |
some: { | |
nested: { |
/*******************************************/ | |
/* Version 1.0.0 */ | |
/* License MIT */ | |
/* Copyright (C) 2022 Devin Weaver */ | |
/* https://tritarget.org/cdn/simple-dom.js */ | |
/*******************************************/ | |
/** | |
* This micro lib is a compact and simple method to interact with the DOM. It | |
* facilitates the query mechanisms that querySelector and querySelectorAll use |
Main problem of showing progress bar in Blender UI is that while a script is running the UI is frozen. So the simplest (?) solution is to break execution whenever the progress status should be updated. For this you can use either timers or modal operators. The last one can't be switched on during all time of Blender execution and has some starting costs.
import bpy
from functools import partial
window.IDE.appControllers.helloworld = function() { | |
time = new Date().toString().match(/(\d\d:\d\d:\d\d)/)[0]; | |
view = new KDCustomHTMLView({ | |
tagName: 'h2', | |
partial: 'HELLO WORLD APP LOADED at ' + time + ' !!!' | |
}); | |
return view; | |
} |
var k = '3dsaAdas2dAAASdasdasDŞ321ĞİÜEQWEWQ098"**?_Ü;SDA!22'; | |
k.replace(/\D/g, ''); |
class FlipCounterView extends KDView | |
constructor : (options = {}, data = {}) -> | |
options.style ?= "dark" | |
options.from ?= 5000 | |
options.to ?= 10000 | |
options.interval ?= 1000 | |
options.step ?= 1 | |
options.autoStart ?= yes | |
options.direction = if options.from < options.to then "up" else "down" | |
options.digits ?= if options.direction is "up" then options.to.toString().length else options.from.toString().length |
class FlipCounterView extends KDView | |
constructor : (options = {}, data = {}) -> | |
options.style ?= "dark" | |
options.from ?= 5000 | |
options.to ?= 10000 | |
options.interval ?= 1000 | |
options.step ?= 1 | |
options.autoStart ?= yes | |
options.direction = if options.from < options.to then "up" else "down" | |
options.digits ?= if options.direction is "up" then options.to.toString().length else options.from.toString().length |