Skip to content

Instantly share code, notes, and snippets.

View Roms1383's full-sized avatar
😊
I might not be available to respond, but I'll do my best !

Rom's Roms1383

😊
I might not be available to respond, but I'll do my best !
  • Chiang Mai, Thailand
View GitHub Profile
@Roms1383
Roms1383 / Core.swift
Last active May 9, 2024 19:31
Lifecycle 2.12a
module Audioware
public static func E(msg: String) -> Void { ModLog(n"🌱", AsRef(msg)); }
public static func F(msg: String) -> Void { E(s"[ERROR] \(msg)"); }
public static func D(msg: String, self: wref<IScriptable>) -> Void { E(s"[\(ToString(self.GetClassName()))] \(msg)"); }
public abstract class CoreScriptableService extends ScriptableService {
private cb func OnLoad() { D("on load", this); }
private cb func OnReload() { D("on reload", this); }
private cb func OnInitialize() {
@Roms1383
Roms1383 / gist.rs
Created January 9, 2024 04:35
High and low bits concatenation in bitflags context
trait SetBytes {
fn set_low(&mut self, value: u32);
fn set_high(&mut self, value: u32);
}
trait FullBytes {
fn convert(&mut self) -> u32;
}
impl SetBytes for u64 {
@Roms1383
Roms1383 / README.md
Last active August 1, 2023 03:06
Tim McNamara's video on Ring Buffer
@Roms1383
Roms1383 / url.md
Created June 4, 2023 04:05
Find all my merged PR, excluding my own repositories

Find all my merged PR, excluding my own repositories:

is:merged is:pr author:Roms1383 -user:Roms1383 
# or
https://github.com/pulls?q=is%3Amerged+is%3Apr+author%3ARoms1383+-user%3ARoms1383+

useful when asked, e.g. during job application process, to show one's open-source contributions.

@Roms1383
Roms1383 / notes.md
Last active April 16, 2023 05:25
development process for inkatlas-utils

Development process for inkatlas-utils

Create Adobe project

When developping with inkatlas-utils, you first have to create an Adobe Project with a Photoshop Plugin from Adobe Console.

Build plugin

Then, run npm run build from local inkatlas repo.

@Roms1383
Roms1383 / pubspec.lock
Created December 15, 2022 12:41
For debug : updating FRB
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "47.0.0"
@Roms1383
Roms1383 / main.dart
Created September 10, 2022 08:07
using DateTime constructor
void main() {
print('equivalent in Rust: 1974-10-04 20:39:12.153154 UTC (ms 150151152153154)');
final ms = 150151152153154;
final millis = (ms / 1000).round();
final micros = ms % 1000;
print('ms: $ms millis: $millis micros: $micros');
final date = DateTime(1970,1,1,0,0,0,millis,micros);
print('date: $date micros since epoch: ${date.microsecondsSinceEpoch} micros: ${date.microsecond}');
final d = DateTime(1970,1,1,0,0,0,0,ms);
print('date: $d micros since epoch: ${d.microsecondsSinceEpoch} micros: ${d.microsecond}');
@Roms1383
Roms1383 / main.dart
Last active September 10, 2022 08:04
using DateTime.utc constructor
void main() {
print('equivalent in Rust: 1974-10-04 20:39:12.153154 UTC (ms 150151152153154)');
final ms = 150151152153154;
final millis = (ms / 1000).round();
final micros = ms % 1000;
print('ms: $ms millis: $millis micros: $micros');
final date = DateTime.utc(1970,1,1,0,0,0,millis,micros);
print('date: $date micros since epoch: ${date.microsecondsSinceEpoch} micros: ${date.microsecond}');
final d = DateTime.utc(1970,1,1,0,0,0,0,ms);
print('date: $d micros since epoch: ${d.microsecondsSinceEpoch} micros: ${d.microsecond}');
@Roms1383
Roms1383 / main.dart
Last active September 10, 2022 16:35
dart conversion from different size
void main() {
smallest_int();
print('----------------');
smaller_int();
print('----------------');
is_it_a_bug_or_a_feature();
}
void smallest_int() {
print('equivalent in Rust: 1970-01-01 00:02:30.151152 UTC (ms 150151152)');
@Roms1383
Roms1383 / main.dart
Last active September 10, 2022 16:35
lossy conversion ?
void main() {
final past_ms = -150151152153154;
final future_ms = 150151152153154;
final past = DateTime.fromMicrosecondsSinceEpoch(past_ms, isUtc: true);
print('$past (ms ${past.microsecondsSinceEpoch})');
final future = DateTime.fromMicrosecondsSinceEpoch(future_ms, isUtc: true);
print('$future (ms ${future.microsecondsSinceEpoch})');
}