Skip to content

Instantly share code, notes, and snippets.

View thewh1teagle's full-sized avatar
💭
coding

thewh1teagle

💭
coding
  • localhost
  • The martian
View GitHub Profile
@thewh1teagle
thewh1teagle / README.md
Created March 31, 2024 19:11
Play with dmg file on macos

Sign with ad-hoc identity

codesign -f -s - ./name.app

Check signature

codesign -dv ./name.app

Inspect dmg and create new one

  1. Click on the dmg
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.

Cargo.toml

[package]
name = "app_name"
version = "0.2.8"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""

Tauri updated fork thewh1teagle/tauri#app

Cargo.toml

[dependencies]
tauri = { git = "https://github.com/thewh1teagle/tauri", branch = "app", features = [
    "unstable",
    "devtools",
    "force-ipc-v1-protocol",
] } 
@thewh1teagle
thewh1teagle / README.md
Last active February 24, 2024 00:06
Configure GPG commit signing windows

Install https://www.gpg4win.org/

Add to %appdata%\gnupg\gpg.conf to disable GUI asking password

code %appdata%\gnupg\gpg.conf

pinentry-mode loopback
default-cache-ttl 2592000