Skip to content

Instantly share code, notes, and snippets.

View ebadi's full-sized avatar

Hamid Ebadi ebadi

View GitHub Profile
@ebadi
ebadi / gist:bbe759f99f22f29cb46578fd7c95e93e
Created February 18, 2025 21:26
OpenScad code for bathroom hook
module line(point1, point2, width = 1, cap_round = true) {
angle = 90 - atan((point2[1] - point1[1]) / (point2[0] - point1[0]));
offset_x = 0.5 * width * cos(angle);
offset_y = 0.5 * width * sin(angle);
offset1 = [-offset_x, offset_y];
offset2 = [offset_x, -offset_y];
if(cap_round) {
translate(point1) circle(d = width, $fn = 24);
@ebadi
ebadi / checkchange.sh
Created February 22, 2022 18:47
Check a url for changes every x second
filename1="out.html"
filename2="tmp.html"
while true
do
curl -L 'https://blah' > "$filename1"
m1=($(md5sum "$filename1"))
m2=($(md5sum "$filename2"))
echo "$m1 & $m2"
@ebadi
ebadi / webchecker.py
Created July 26, 2018 14:37
Check a web page for updates
import requests
import json
import time
import os
# sudo apt install sox
# START https://curl.trillworks.com/
cookies = {
'xx': 'yy',
#
# Automatically generated file; DO NOT EDIT.
# LEDE Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_apm821xx is not set
# CONFIG_TARGET_ath25 is not set
# CONFIG_TARGET_ar71xx is not set