Skip to content

Instantly share code, notes, and snippets.

@guysoft
guysoft / scrape.py
Created August 10, 2020 21:36
Scrape all electronics recycle places in Israel
#!/usr/bin/env python3
import json
from urllib.request import urlopen
link = "https://mai.org.il/weee_map_israel/"
f = urlopen(link)
data = f.read().decode()
# If you want to try a cache, uncomment this
SteamVR System Report created Mon Aug 23 14:59:08 2021
<Report>
SteamVR Version: 1.19.7 (1629236071)
SteamVR Date: 2021-08-18
Steam: Public
Steam Branch: beta
Steam AppID: 250820
Tracking: lighthouse
OS: Linux version 5.13.5-051305-generic (kernel@kathleen) (gcc (Ubuntu 10.3.0-6ubuntu1) 10.3.0, GNU ld (GNU Binutils for Ubuntu) 2.37) #202107251335 SMP Sun Jul 25 13:38:50 UTC 2021
'''
MicroPython pH sensor Eduponics mini - demo
https://github.com/STEMinds/micropython-eduponics
MIT License
Copyright (c) 2020 STEMinds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@guysoft
guysoft / timezone_bot.y
Created August 10, 2017 14:51
A telegram bot that lets you pick a timezone
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A telegram bot that lets you pick and a timezone
@author Guy Sheffer (GuySoft) <guysoft at gmail dot com>
"""
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import ConversationHandler, RegexHandler
@guysoft
guysoft / reminders.py
Created December 31, 2018 10:05
Get google calendar reminder api
#!/usr/bin/env python3
## How to use
##
## 1. enter http://calendar.google.com/
## 2. press ctrl+alt+J in chrome to ender the developer tools and select the "network" tab. In firefox ctrl+shift+elif
## 3. refresh and make sure "reminders" is checked.
## 4. search for "reminder" in url filters and look for a url of the form: https://reminders-pa.clients6.google.com/v1internalOP/reminders/list?key=
## 5. Copy the key and the followind headers and cookies below:
## For mor info see: https://issuetracker.google.com/issues/36760283
#!/usr/bin/env python3
"""
Play a file continously, and exit gracefully on signal
Based on https://github.com/steveway/papagayo-ng/blob/working_vol/SoundPlayer.py
@author Guy Sheffer (GuySoft) <guysoft at gmail dot com>
"""
import signal
import time