Skip to content

Instantly share code, notes, and snippets.

@acaburaz
acaburaz / microbtcminer.py
Created March 7, 2024 16:53
MicroPython BTC Miner for esp devices
import socket
import json
import hashlib
import binascii
import urandom # Alternative to the random module in Micropython
import network
import machine
@acaburaz
acaburaz / rpi-display.py
Last active March 5, 2024 15:28
Raspberry PI pimono LCD, RX6, Sound on RF Device Push
#!/usr/bin/env python3
import time
import json
import subprocess
import RPi.GPIO as GPIO
import os
from PIL import Image, ImageDraw, ImageFont
import ST7735
from rpi_rf import RFDevice
@acaburaz
acaburaz / ValidateOrgNumber.cs
Created April 24, 2023 21:53
Swedish Orgnummer Validator C#
using System.Linq;
using System.Text.RegularExpressions;
public bool ValidateOrgNumber(string value)
{
// Check if the input has the correct format (6 digits followed by optional '-' and 4 more digits)
if (!Regex.IsMatch(value, @"^\d{6}-?\d{4}$")) return false;
// Remove any non-digit characters (e.g., '-')
value = Regex.Replace(value, @"\D", "");