Skip to content

Instantly share code, notes, and snippets.

import cmath
import math
from IPython.display import HTML as html_print
from IPython.display import display
import matplotlib.pyplot as plt
def loop_length(loop):
length = 0
last_p = loop[0]
@jmons
jmons / full-body-stash.xyz
Created November 17, 2021 11:51
XYZ files for 3d fractals
X Y Z R G B
0.000000 25.000000 0.000000 0 0 0
1.000000 25.000000 0.000000 0 0 0
2.000000 25.000000 0.000000 0 0 0
3.000000 25.000000 0.000000 0 0 0
4.000000 25.000000 0.000000 0 0 0
5.000000 25.000000 0.000000 0 0 0
6.000000 25.000000 0.000000 0 0 0
7.000000 25.000000 0.000000 0 0 0
8.000000 25.000000 0.000000 0 0 0
import pygame
from pygame.time import Clock
import cv2
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
cap = cv2.VideoCapture(2)
alive = True
pygame.init()
@jmons
jmons / tracking1.py
Created July 21, 2021 06:52
Satellite Tracking
import sys
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from beyond.io.tle import Tle
from beyond.dates import Date, timedelta
# BAMScript - Bad Assed Machines v1
# A sequence of 1s pass across
-- BEGIN PRIVATE --
0: # netural state
1-\d+ 1 # if the left hand machine is 1, go to 0
1:
0-\d+ 0 # if the left hand machine is 0, go to 1
-- BEGIN GENERAL --
@jmons
jmons / Notes
Created February 26, 2021 15:47
These are all python jupyter notebooks
@jmons
jmons / Complex_grapher.py
Created January 10, 2021 14:44
Mandlebrot Fractal Example Snippets
import numpy as np
import matplotlib.pyplot as plt
# especially on jupyter
def draw_data(data, circle_size=2, line=False):
fix, ax = plt.subplots()
last_point = None
for point in data:
credits = "Image from Nick Stone @Typejunky"
my_text = """Might release a new series of Lost in a Landscape prints, including this one. Scottow - 'The waste in the fever and heat'. Have a read >>> https://invisibleworks.co.uk/lost-landscape-scottow/"""
path = "test1.jpg"
from PIL import Image, ImageFont, ImageDraw
import math
font = ImageFont.truetype("dogica.ttf", 28)
font_b = ImageFont.truetype("Fall-in-Autumn-Regular.ttf", 72)
from poliastro.examples import Earth
from poliastro.twobody import Orbit
from poliastro.maneuver import Maneuver
from poliastro.util import time_range
from poliastro.plotting.porkchop import porkchop
from astropy import time, units as u
from tletools import TLE
import plotly.io as pio
@jmons
jmons / Spritedex.py
Created August 23, 2020 21:41
Spritedex
import pygame
import json
class Spritedex(object):
sheets = {}
register = {}
images = {}
def __init__(self):