Go Broadcast, one channel send to many goroutines channel recieve
package main
import (
"fmt"
"time"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32d7", ATTR{idProduct}=="0001", TAG+="systemd", ENV{SYSTEMD_WANTS}="map-touchscreen.service" |
// filepath: /<project folder>/main.go | |
package main | |
import ( | |
"embed" | |
"net/http" | |
webview "github.com/webview/webview_go" | |
) |
#SingleInstance | |
#InstallKeybdHook | |
#Persistent | |
SetWorkingDir C:/ahk | |
; remap AJAZZ volume wheel to primary display brightness and screenshot on click | |
; remap to second display if shift is held | |
; original volume and pause mapping if Meta is held | |
; Temporarily disable Windows keys when other hotkeys are active |
//! channel capacity monitoring for profiling | |
func monitorChan[T any](ch chan T, name string) { | |
chanMonitorInterval := time.Second | |
for { | |
// if len(ch) == cap(ch) { | |
fmt.Printf("Channel: %s, Size: %d\n", name, len(ch)) | |
// } | |
time.Sleep(chanMonitorInterval) | |
} | |
} |
package main | |
import ( | |
"bytes" | |
"time" | |
"os" | |
"io/ioutil" | |
"github.com/ebitengine/oto/v3" | |
"github.com/youpy/go-wav" |
package main | |
import ( | |
"bufio" | |
"os" | |
"fmt" | |
// "foosoft.net/projects/jmdict" | |
"git.foosoft.net/alex/jmdict" | |
"encoding/json" | |
) |
import pickledb | |
import json | |
def convert_pickle_to_json(pickle_file, json_file): | |
# Load the pickle database | |
db = pickledb.load(pickle_file, False) | |
# Extract data from the database | |
data = {} | |
for key in db.getall(): |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.chrome.options import Options | |
import time | |
# Set the path to your chromedriver executable | |
url = 'http://10.0.0.55' | |
# Set up Chrome options for headless mode | |
chrome_options = Options() |