Skip to content

Instantly share code, notes, and snippets.

View inactivist's full-sized avatar
💭
fixing things

Michael Curry inactivist

💭
fixing things
View GitHub Profile
@Akxe
Akxe / PortAwareSharedWorker.ts
Last active December 2, 2024 14:31
PortAwareSharedWorker, shared worker that know who is still connected and who is not
/// <reference lib="webworker" />
type SharedWorkerPort = MessagePort | DedicatedWorkerGlobalScope;
class PortAwareSharedWorkerPort<T extends SharedWorkerPort = SharedWorkerPort, D = any> {
private readonly weakRef: WeakRef<T>;
private disconnected = false;
constructor(
port: T,
onMessage: (eventData: D) => void,
# Create this file in /etc/udev/rules.d/51-android.rules (root owned, bitmask 0644)
# Reload udev (udevadm control --reload-rules)
#
# It will allow members of the `adbusers` group to access the phone over usb without being root
# You should create a new unprivileged user who is a member of this group, then run `adb` as said user
#
# To add a new device, plug in the device and run `lsusb` to determine its device id then add it in, eg:
# $ lsusb
# Bus 002 Device 063: ID 18d1:4ee7 Google Inc. Nexus/Pixel Device (charging + debug)
@atomgomba
atomgomba / Polymaker PolyFlex 95A.ini
Last active December 29, 2024 14:19
Filament settings for Polymaker PolyFlex 95A (Prusa Slic3r)
# generated by PrusaSlicer 2.3.0+linux-x64 on 2021-01-29 at 10:18:59 UTC
bed_temperature = 50
bridge_fan_speed = 100
compatible_printers =
compatible_printers_condition = nozzle_diameter[0]>0.35 and printer_model!="MK2SMM" and printer_model!="MINI" and num_extruders==1 && ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK3.*/ and single_extruder_multi_material)
compatible_prints =
compatible_prints_condition =
cooling = 1
disable_fan_first_layers = 5
end_filament_gcode = "; Filament-specific end gcode"
@VioletGiraffe
VioletGiraffe / install.sh
Last active March 10, 2024 17:23 — forked from adduc/install.sh
My installation of tortoisehg on Ubuntu 20.04 and newer
#!/bin/bash
TARGET_DIR=~/Downloads/repos/third-parties
TORTOISEHG_VERSION=${5:-stable}
prepare() {
sudo apt-get -y update
sudo apt-get -y install \
curl \
@pschatzmann
pschatzmann / Springs.ipynb
Last active March 3, 2025 22:13
3D Printed Springs in OpenSCAD
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
interface ChooseFileSystemEntriesOptionsAccepts {
description?: string;
mimeTypes?: string[];
extensions?: string[];
}
interface ChooseFileSystemEntriesOptions {
type?: 'openFile' | 'saveFile' | 'openDirectory';
multiple?: boolean;
accepts?: ChooseFileSystemEntriesOptionsAccepts[];
@adduc
adduc / install.sh
Last active August 24, 2021 09:23
My installation of mercurial, tortoisehg, and hg-git on Ubuntu 20.04 and newer
#!/bin/bash
TARGET_DIR=/opt/repos/third-parties
HG_GIT_VERSION=${1:-default}
HG_RELEASE_VERSION=${2:-5.5.2}
HG_REPO_VERSION=${3:-stable}
TORTOISEHG_VERSION=${4:-stable}
update() {
# Update packages
@seanavery
seanavery / rtsp_scanner.py
Created May 23, 2020 05:52
RTSP Scanner
import subprocess
# grab subnet address
ps = subprocess.Popen('ifconfig', stdout=subprocess.PIPE, shell=True)
output = subprocess.check_output(('grep', 'inet'), stdin=ps.stdout)
ps.wait()
elements = output.decode('utf8').split()
broadcast_ip = elements[elements.index('broadcast') + 1]
print('broadcast_ip: {}'.format(broadcast_ip))
subnet = broadcast_ip[:-4]
@rengler33
rengler33 / scrape_with_logs.py
Last active February 8, 2025 04:09
How to Capture Network Traffic When Scraping with Selenium & Python
# see rkengler.com for related blog post
# https://www.rkengler.com/how-to-capture-network-traffic-when-scraping-with-selenium-and-python/
import json
import pprint
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
capabilities = DesiredCapabilities.CHROME
@sonicprod
sonicprod / RPi4.MAME.Appliance.md
Last active April 4, 2025 04:47
How to make a dedicated MAME Appliance on a Raspberry Pi 4B | Comment réaliser un système MAME dédié sur un Raspberry Pi 4/Pi 400

How to make a dedicated MAME Appliance on a Raspberry Pi 4/Pi 400

Note: the following steps are written in French. Feel free to translate to English.

However, please take notice that if you copy the scripts on this page from the version translated into English by Google Translate, it is possible that extra characters may appear within some scripts (this is caused by Google Translate), resulting in corruption of the impacted scripts. Consequently, it is better to copy the scripts from the original French version of this page.

Comment réaliser un système MAME dédié sur un Raspberry Pi 4/Pi 400