Skip to content

Instantly share code, notes, and snippets.

View guillaumefalvet's full-sized avatar
:shipit:
Refactoring

Guillaume guillaumefalvet

:shipit:
Refactoring
View GitHub Profile
@guillaumefalvet
guillaumefalvet / url.py
Created August 21, 2025 08:44
HMI DETECTION URL
import subprocess
import re
def get_node_server_url():
# Execute the command to find processes listening on ports
result = subprocess.run(['lsof', '-i', '-P', '-n'], stdout=subprocess.PIPE, text=True)
output = result.stdout
# Search for Node.js processes and extract the port number
matches = re.findall(r'node.*:(\d{5}) \(LISTEN\)', output)
# source ~/powerlevel10k/powerlevel10k.zsh-theme
PATH=$PATH:$HOME/.local/bin
export ZSH="$HOME/.oh-my-zsh"
# set by `omz`
ZSH_THEME="robbyrussell" # set by `omz`
# ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(git zsh-autosuggestions)
alias ffs="sudo sysctl fs.inotify.max_user_watches=131070"
source $ZSH/oh-my-zsh.sh
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
@guillaumefalvet
guillaumefalvet / espanso.yml
Created August 20, 2025 16:08
HMI_espanso
# espanso match file
# For a complete introduction, visit the official docs at: https://espanso.org/docs/
# You can use this file to define the base matches (aka snippets)
# that will be available in every application when using espanso.
# Matches are substitution rules: when you type the "trigger" string
# it gets replaced by the "replace" string.
global_vars:
@guillaumefalvet
guillaumefalvet / settings.json
Created July 17, 2025 14:10
post css order
"postcssSorting.config": {
"order": [
"custom-properties",
"dollar-variables",
"declarations",
"at-rules",
"rules"
],
"properties-order": [
// Layout & Positioning
@guillaumefalvet
guillaumefalvet / HMI_TS_SNIPPETS.ts
Last active July 8, 2025 06:28
HMI_TS_SNIPPETS.ts
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@guillaumefalvet
guillaumefalvet / coding_style.ts
Last active June 3, 2025 07:34
HMI comment coding style
// - Listener
// - Talker
// - Angular Material
// - Modules
// - Guards
// - Services -- // Managers
// - Directives
// - Components
// - Models
// - Utils
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",

sudo apt install cifs-utils -y # Install CIFS utilities if not already installed

sudo mount -t cifs -o username=Admin,password=forssea_robotics,dir_mode=0777,file_mode=0777 //192.168.3.77/plugins /mnt/windows-share

//192.168.3.77/plugins /mnt/windows-share cifs username=Admin,password=forssea_robotics,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

3. Persistent Mount (Optional)

import { performance } from 'perf_hooks';
const ITERATIONS = 10_000_000;
const TEST_KEY = '5000000'; // Middle key for lookup/delete operations
// Benchmark Record
const record: Record<string, number> = {};
let start = performance.now();
for (let i = 0; i < ITERATIONS; i++) {
record[i.toString()] = i;

Installation of bindings & usage

In order to use the bindings, you need to register them inside the angular.json file.

"architect": {
  "build": {
    "builder": "@angular-devkit/build-angular:browser",
    "options": {
 "externalDependencies": [