Skip to content

Instantly share code, notes, and snippets.

View anthony-y's full-sized avatar
🌍

Anthony Baynham anthony-y

🌍
View GitHub Profile
@anthony-y
anthony-y / switcher.py
Created September 9, 2021 00:05
Script I wrote to change my system theme automatically throughout the day.
#!/bin/python
import datetime as dt
import time
import os
SUNSET = 20 # switch to dark mode at 8PM
SUNRISE = 6 # day starts at 6AM
DAY_WP = "/home/ant/Pictures/wallpapers/day"
NIGHT_WP = "/home/ant/Pictures/wallpapers/night"
#include <stdio.h>
#include <stdlib.h>
typedef struct _Animal { void (**vtable)(); } Animal;
typedef struct _Dog { Animal base; } Dog;
typedef struct _Cat { Animal base; } Cat;
// To strings
void animal_to_string(Animal *this) { printf(" Base animal\n"); }

Keybase proof

I hereby claim:

  • I am anthony-y on github.
  • I am anthonyybayn (https://keybase.io/anthonyybayn) on keybase.
  • I have a public key ASAU28S6RUQwDPiabKYUago-v0NiHd0GVaWOEHODLNsoCwo

To claim this, I am signing this object:

@anthony-y
anthony-y / consolecalc.py
Last active March 31, 2016 17:55
A very simple yet functional calculator in ~20 lines.
# calc.py
# Simple calculator.
from os import system as s
nextNum = None
operations = []
def getNextNumber():
nextNum = input(">> ")
@anthony-y
anthony-y / generatecoords.py
Last active October 18, 2017 11:15
A simple python program to generate pseudo-random coordinates.
import random
class generatecoords:
def __init__(self, maxX, maxY, maxCoords):
self.maxX = maxX
self.maxY = maxY
self.maxCoords = maxCoords
def gen(): # Call this function to generate co-ords in your script.