Skip to content

Instantly share code, notes, and snippets.

View vwillcox's full-sized avatar
🏠
Working from home

Vincent Willcox vwillcox

🏠
Working from home
View GitHub Profile
@vwillcox
vwillcox / main.py
Last active November 16, 2024 09:51
A Simple script in my journey to allow me to Cross post between BlueSky and Mastodon. (Repost)
#!/usr/bin/env python3
from atproto import Client, client_utils
import requests, argparse
import apis
accountname = apis.masto_account_name
accessToken = apis.masto_accessToken
bskyaccount = apis.bsky_account_name
bskypassword = apis.bsky_account_password
@vwillcox
vwillcox / code.py
Created September 24, 2024 19:17
Some code to allow me to Control Farm Together 2 with the Keybow2040 from Pimoroni
# SPDX-FileCopyrightText: 2021 Sandy Macdonald
#
# SPDX-License-Identifier: MIT
# A simple example of how to set up a keymap and HID keyboard on Keybow 2040.
# You'll need to connect Keybow 2040 to a computer, as you would with a regular
# USB keyboard.
# Drop the `pmk` folder
@vwillcox
vwillcox / weather2.py
Last active December 2, 2023 18:52
A Threaded weather and clock display for the #Pimoroni #GlacticUnicorn
import urequests as requests
import json
import network
import secrets
from picographics import PicoGraphics, DISPLAY_GALACTIC_UNICORN as DISPLAY
from galactic import GalacticUnicorn
import jpegdec, math, ntptime, time
import _thread
blink=0
@vwillcox
vwillcox / weather.py
Created February 5, 2023 12:09
Galactic Unicorn Current Weather Display
try:
import urequests as requests
except:
import requests
try:
import ujson as json
except:
import json
@vwillcox
vwillcox / mastocloud.py
Last active February 4, 2023 11:09
Quick and dirty Wordcloud tool for Mastodon Account profiles.
import requests
import json
import time, argparse
import matplotlib.pyplot as py
from wordcloud import WordCloud,STOPWORDS
from PIL import Image
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument("-a", "--account", help="Handle to use", required=True)
@vwillcox
vwillcox / main.py
Last active September 7, 2022 20:58
Scroll the current people aboard the ISS on a Raspberry Pi Pico W With a Pimoroni Unicorn Pack Attached.
# Based on
# Scroller Demo
# Kevin McAleer May 2022
# Additional code by Vincent Willcox September 2022
import network
import secrets
import time
import urequests
from scroller import Scroller
@vwillcox
vwillcox / wordcloud.py
Last active April 19, 2022 18:42
Quick and Dirty Word cloud in Python!
import tweepy
import time
import matplotlib.pyplot as py
from wordcloud import WordCloud,STOPWORDS
from PIL import Image
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--twittername", help="Twitter handle to use", required=True)
@vwillcox
vwillcox / rpilocator.py
Created April 18, 2022 14:39
Show RSS feed from RPILocator RSS - simple display
from bs4 import BeautifulSoup
import requests
import re
headers = {
'User-Agent': 'your-user-agent-here'
}
class ReadRss:
@vwillcox
vwillcox / speedtest_pg_h_round.py
Created February 16, 2022 19:35
A quick gauge showing the percent complete of a speedtest..net speed test running on a Raspberry Pi on a HyperPixel Round Display.
import subprocess
import json
import sys
import time
import pygame
import pygame.gfxdraw
import math
from pygame.locals import *
class Gauge:
@vwillcox
vwillcox / speedtest2.py
Created January 7, 2022 20:38
Speedtest.net Python
import subprocess
import json
import sys
import time
proc = subprocess.Popen(['/home/pi/speedtest -p -f json'], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
for i in proc.stdout:
output = proc.stdout.readline()