Skip to content

Instantly share code, notes, and snippets.

@Bolukan
Bolukan / rainbarrel.py
Last active July 7, 2024 18:17
Python script to transfer AJ-SR04M Waterproof Ultrasonic Sensor to MQTT
# !/usr/bin/python
# encoding:utf-8
# Waterproof Ultrasonic Module AJ-SR04M
import RPi.GPIO as GPIO
import time
import paho.mqtt.client as mqtt
timeout = 1 # seconds wait for signal
@Bolukan
Bolukan / windingnumber.scad
Last active July 30, 2023 14:59
Winding Number Algorithm - Openscad
$fa = 12; // minimum angle
$fs = 2; // minimum size
$fn = $preview ? 24 : 64; // number of fragments
micron = 0.001; // for showing nice on screen OpenSCAD
print_margin = 0.3; // print_margin for plastic expansion and some free room
// inside or outside: https://en.wikipedia.org/wiki/Point_in_polygon#Winding_number_algorithm
// radius vs distance to polygon: https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
@Bolukan
Bolukan / d1mini_kicad.py
Last active October 23, 2020 10:26
Create outline (cut edges and silk) of d1 mini
# execfile(r'[ENTER YOUR PATH]\d1mini_kicad.py')
import os
import sys
import pcbnew
# Cut the Edges of a typical d1 mini board
board = pcbnew.GetBoard()
aLayerCuts = board.GetLayerID('Edge.Cuts')
aSilkFront = board.GetLayerID('F.SilkS')
aSilkBack = board.GetLayerID('B.SilkS')
@Bolukan
Bolukan / platformio.php
Last active May 17, 2020 08:48
Document libraries in platformio.ini
<!doctype html><html lang="en">
<head>
<title>Platformio Library comments</title>
</head>
<body>
<?php
// use: platformio.php?id=999
// Comments for platformio.ini on any library from platformio.org
function LibraryComments($id)
@Bolukan
Bolukan / rootcertificate.ino
Created May 4, 2020 22:38
Root Certificate Example for Brian
#if !defined(ESP8266)
#error This file is for ESP8266 only
#endif
#define COMPDATE __DATE__ " " __TIME__
#define APPNAME "Root Certificate Example"
#define VERSION "V0.0.2"
#include <Arduino.h>
#include <ESP8266WiFi.h> // Arduino library - https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFi.h
@Bolukan
Bolukan / myled.h
Created April 24, 2020 21:47
myled.h - Library to blink led
#pragma once
#include <Arduino.h>
#include <Ticker.h>
class MyLed
{
public:
// * Custom led
MyLed(uint8_t led)
@Bolukan
Bolukan / Aliexpress Total Price Script.user.js
Created June 27, 2019 21:13
Show Total Price on Aliexpress
// ==UserScript==
// @name Aliexpress Total Price Script
// @namespace https://bolukan.nl
// @description Show Total Price on Aliexpress
// @version 0.1
// @author Bolukan
// @match *://*.aliexpress.com/wholesale*
// @match *://*.aliexpress.com/w/wholesale*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@Bolukan
Bolukan / Aliexpress_items.user.js
Last active July 28, 2023 14:17
Aliexpress_items
// ==UserScript==
// @name Extract AliExpress Order Detail Pages
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Extract the contents from AliExpress order detail pages, while also removing all svg tags
// @author You
// @match https://www.aliexpress.com/p/order/detail.html*
// @grant none
// ==/UserScript==
@Bolukan
Bolukan / Social-Counter-YT.ino
Created March 14, 2019 18:25
David Watts - ESP-12 Social Media Counter Update - https://www.youtube.com/watch?v=m92fLt6ndIQ
/************************************************************************************
GxEPD_SPI_TestExample : test example for e-Paper displays from Dalian Good Display Co., Ltd.: www.good-display.com
based on Demo Example from Good Display, now available on http://www.good-display.com/download_list/downloadcategoryid=34&isMode=false.html
Author : J-M Zingg
modified by :
Version : 2.0
#include <MyLibrary.h>
MyLibrary::MyLibrary()
{}
void MyLibrary::begin(void)
{
Serial.print("MyLibrary text1: ");
Serial.println(text1);
Serial.print("MyLibrary text2: ");