Skip to content

Instantly share code, notes, and snippets.

View Cyclingbob's full-sized avatar

Cyclingbob

View GitHub Profile
@obstruse
obstruse / barTest.py
Created August 19, 2022 01:57
I2C on the HDMI port
#!/usr/bin/python3
import os
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame.time as time
import i2cVC
import random
random.seed()
@EvelynSubarrow
EvelynSubarrow / td.py
Created December 9, 2021 15:21
Network Rail TD demo
#!/usr/bin/env python3
import logging
from time import sleep
import json
# dependencies are:
# stomp.py, termcolor
from termcolor import colored
@z0gSh1u
z0gSh1u / __dirname-in-python.py
Last active March 3, 2025 05:57
Node.js __dirname equivalent in Python
import os.path as path
# dirname__ will be the absolute directory that current .py file is in
dirname__ = path.dirname(path.abspath(__file__))
@pinkhominid
pinkhominid / index.js
Created September 24, 2019 10:15
Upload a file with node-fetch and form-data
const fs = require('fs');
const fetch = require('node-fetch');
const FormData = require('form-data');
const filePath = `path/to/file.ext`;
const form = new FormData();
const stats = fs.statSync(filePath);
const fileSizeInBytes = stats.size;
const fileStream = fs.createReadStream(filePath);
form.append('field-name', fileStream, { knownLength: fileSizeInBytes });
@fourohfour
fourohfour / smh-api.md
Created November 6, 2016 13:25
Information about the Show My Homework API

Show My Homework API


File detailing what I've worked out so far from investigating the Show My Homework API.

API Requests

API requests are made in the form of a HTTPS GET request to the SMH API endpoint.

https://api.showmyhomework.co.uk/api/{request}

@ssskip
ssskip / ISO3166-1.alpha2.json
Last active March 7, 2026 19:34
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",