Skip to content

Instantly share code, notes, and snippets.

View Luigi-Pizzolito's full-sized avatar
🎓
In University

Luigi Pizzolito Luigi-Pizzolito

🎓
In University
View GitHub Profile
@Luigi-Pizzolito
Luigi-Pizzolito / 99-touch-screen.rules
Last active March 13, 2025 03:42
Arch Redirect 2nd Monitor Touchscreen
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32d7", ATTR{idProduct}=="0001", TAG+="systemd", ENV{SYSTEMD_WANTS}="map-touchscreen.service"
@Luigi-Pizzolito
Luigi-Pizzolito / main.go
Created January 19, 2025 17:11
Web App as Native in Go
// filepath: /<project folder>/main.go
package main
import (
"embed"
"net/http"
webview "github.com/webview/webview_go"
)
@Luigi-Pizzolito
Luigi-Pizzolito / AZVolumeWheelRemap.ahk
Created May 27, 2024 12:31
AHK Script to remap Volume Scroll Wheel of AK75Pro AJAZZ Keyboard, using AHK, ClickMonitorDDC and nircmd
#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
@Luigi-Pizzolito
Luigi-Pizzolito / Usage.md
Created March 19, 2024 13:09
Go Broadcast, one channel send to many goroutines channel recieve

BCast

Go Broadcast, one channel send to many goroutines channel recieve

Usage

package main

import (
  "fmt"
 "time"
@Luigi-Pizzolito
Luigi-Pizzolito / MonitorChannel.go
Created February 12, 2024 23:53
Monitor channel buffer size continously to determine optimum capacity.
//! 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)
}
}
@Luigi-Pizzolito
Luigi-Pizzolito / playWavStdin.go
Created February 11, 2024 20:18
Plays a raw wav file from stdin, mono, 16kHz.
package main
import (
"bytes"
"time"
"os"
"io/ioutil"
"github.com/ebitengine/oto/v3"
"github.com/youpy/go-wav"
@Luigi-Pizzolito
Luigi-Pizzolito / extractNrunWithSharedLibrary.go
Created February 11, 2024 20:03
Embeds the entire ./bin folder into the go executable. At run time, extracts ./bin to temporary directory and calls your_executable with any dynamic libraries in ./bin. Also provides method for passing input+\n to stdin.
package main
import (
"embed"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"bytes"
"fmt"
@Luigi-Pizzolito
Luigi-Pizzolito / KANJIDIC2json.go
Created February 10, 2024 22:02
Uses JMDict to convert KANJIDIC2.xml Kanji dictionary into a JSON file containing kanji and their most common Katakana pronounciation. See http://nihongo.monash.edu/kanjidic2/index.html
package main
import (
"bufio"
"os"
"fmt"
// "foosoft.net/projects/jmdict"
"git.foosoft.net/alex/jmdict"
"encoding/json"
)
@Luigi-Pizzolito
Luigi-Pizzolito / pickle2json.py
Created February 10, 2024 21:56
Convert a Python PickleDB into JSON format for using in other languages.
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():
@Luigi-Pizzolito
Luigi-Pizzolito / loginWifi.py
Created January 11, 2024 20:15
Automatic login to Wifi using Selenium
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()