codesign -f -s - ./name.appcodesign -dv ./name.app- Click on the dmg
| use eyre::{bail, Context, Result}; | |
| use privilege::user::privileged; | |
| use rand::distributions::Alphanumeric; | |
| use rand::{thread_rng, Rng}; | |
| use std::path::PathBuf; | |
| pub fn temp_path(prefix: &str, suffix: &str, rand_len: usize) -> PathBuf { | |
| let random_string: String = thread_rng() | |
| .sample_iter(&Alphanumeric) | |
| .take(rand_len) |
| use std::sync::mpsc::{sync_channel, SyncSender}; | |
| use screencapturekit::sc_stream::SCStream; | |
| use screencapturekit::{ | |
| cm_sample_buffer::CMSampleBuffer, | |
| sc_content_filter::InitParams::Display, | |
| sc_content_filter::SCContentFilter, | |
| sc_error_handler::StreamErrorHandler, | |
| sc_output_handler::{SCStreamOutputType, StreamOutput}, |
| from datetime import timedelta, datetime | |
| import sqlite3 | |
| # Create database with table | |
| path = 'data.db' | |
| conn = sqlite3.connect(path) | |
| cur = conn.cursor() | |
| cur.execute('CREATE TABLE IF NOT EXISTS data (id INTEGER PRIMARY KEY, date TEXT)') | |
| # Create mock data from latest 30 days |
| import serial | |
| import threading | |
| import time | |
| import sys | |
| class STM: | |
| def __init__(self, port: str, baudrate: str) -> None: | |
| self.ser: serial.Serial = None | |
| self.port = port | |
| self.baudrate = baudrate |
| [ | |
| { | |
| "date": "2024-02-29 20:17:19", | |
| "speed": 82.30914189627686 | |
| } | |
| ] |
| use std::collections::HashMap; | |
| use tao::{ | |
| event::{ElementState, Event, KeyEvent, WindowEvent}, | |
| event_loop::{ControlFlow, EventLoop}, | |
| window::{Window, WindowBuilder}, | |
| }; | |
| fn main() { | |
| env_logger::init(); | |
| let event_loop = EventLoop::new(); |
| async fn eval_with_event(webview: Webview, event_name: &str, script: &str, timeout: Duration) -> anyhow::Result<Value> { | |
| let (sender, receiver): (Sender<String>, Receiver<String>) = channel(); | |
| let id = webview.listen(event_name, move |event| { | |
| let value = event.payload().to_string(); | |
| let result = sender.send(value); | |
| if let Err(err) = result { | |
| log::error!("failed to get result from callback {}", err); | |
| } | |
| }); | |
| let result = webview.eval(&script); |
| error: failed to select a version for `zvariant_utils`. | |
| ... required by package `zbus_macros v4.0.0` | |
| ... which satisfies dependency `zbus_macros = "=4.0.0"` of package `zbus v4.0.0` | |
| ... which satisfies dependency `zbus = "^4.0"` of package `ashpd v0.8.0` | |
| ... which satisfies dependency `ashpd = "^0.8"` of package `rfd v0.14.0` | |
| ... which satisfies dependency `rfd = "^0.14"` of package `tauri-plugin-dialog v2.0.0-beta.1 (https://github.com/thewh1teagle/plugins-workspace?branch=v2#dc6d3321)` | |
| ... which satisfies git dependency `tauri-plugin-dialog` of package `now_deeply v0.2.8 (/Users/user/Documents/tapx/tapx1/src-tauri)` | |
| versions that meet the requirements `=1.1.0` are: 1.1.0 | |
| all possible versions conflict with previously selected packages. |