Skip to content

Instantly share code, notes, and snippets.

View AdventureBear's full-sized avatar

Suzanne Atkinson AdventureBear

View GitHub Profile
@AdventureBear
AdventureBear / weather_report_generator.py
Created October 26, 2024 19:40
Python Daily National Weather Report Generator
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import pytz
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
from reportlab.platypus import Paragraph, Frame
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from io import BytesIO
@AdventureBear
AdventureBear / MeteoBookmarks.html
Created October 17, 2024 17:40
Meteorology Bookmarks 10/17/24
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1668055654" LAST_MODIFIED="1729185968" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>
@AdventureBear
AdventureBear / EventFilter.tsx
Created August 30, 2024 15:18
Radix UI for components, Tailwind for styling and react-select for multi-select & clearable select box
'use client'
import React, {useEffect, useState} from 'react'
import Select from "react-select";
import {EventType} from "@prisma/client"
import {useRouter} from "next/navigation";
import {Button, Flex} from "@radix-ui/themes";
const EventFilter = ({athleteList}:{athleteList: {name: string, id:number}[] }) => {
const router = useRouter()
@AdventureBear
AdventureBear / CollapsableReadme.tsx
Created August 4, 2024 04:13
React / NextJS Readme.md Component Viewer
"use client";
import React, {useState} from 'react';
import ReactMarkdown from 'react-markdown';
import "./CollapsibleReadme.css"
import { Flex, IconButton} from "@radix-ui/themes";
import {MoonIcon, SunIcon} from "@radix-ui/react-icons";
interface CollapsibleReadmeProps {
readmeContent: string;
@AdventureBear
AdventureBear / changes.txt
Created February 8, 2024 21:37
Schema before attempting migration
Changes i made to the "after" schema:
1) changed IntensityTypes enum to IntensityCategory
2) added model Intensity, RoundDetail, enum REcoveryType
3) updated model Round to include references to the models for the RoundDetail table as follows:
Intensity Intensity[]
Recovery Recovery[]
//This gist shows all the API endpoints for a single model.
//The model in this example is called "round".
//There are two files here, one is for the routes for "all" rounds
//(GET and POST) and the other file is for individual rounds that have a defined id. (GET PUT PATCH DELETE)
//NEW FILE
//api/round/route.ts
@AdventureBear
AdventureBear / gist:31153d6287c466922f154fb8a86a8d10
Last active December 9, 2023 04:59
React Brick Breaker fixes (sort of)
import React, {useState, useEffect, useRef, useCallback} from "react";
const BrickBreaker = () => {
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const ballPosition = useRef({ x: 200, y: 150 }); // Ref for ball position
const ballDirection = useRef({dx: 1, dy: -3}) //Ref for ball direction
// const [x, setX] = useState(200); // starting horizontal position of ball
// const [y, setY] = useState(150); // starting vertical position of ball
// const [dx, setDx] = useState(1); // amount ball should move horizontally
@AdventureBear
AdventureBear / david-index.html
Created May 4, 2017 03:26
index page for david's portfolio
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>A Pen by David Amanze</title>
<link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<link rel="stylesheet" href="css/style.css">
[
"aardvark",
"albatross",
"alligator",
"alpaca",
"ant",
"anteater",
"antelope",
"ape",
"armadillo",
@AdventureBear
AdventureBear / gist:80ead0d2fe57e9e3e8f860b6ab011f78
Created November 5, 2016 14:11
string returned from flickr api call via node.
jsonFlickrApi({"photos":{"page":1,"pages":27370,"perpage":100,"total":"2736997","photo":[{"id":"30460163700","owner":"134233271@N06","secret":"6e69ff379b","server":"5627","farm":6,"title":"Count on me","ispublic":1,"isfriend":0,"isfamily":0,"url_l":"https:\/\/farm6.staticflickr.com\/5627\/30460163700_6e69ff379b_b.jpg","height_l":"542","width_l":"1024"},{"id":"30715813446","owner":"88468856@N00","secret":"ca306bb23c","server":"5581","farm":6,"title":"DOGS","ispublic":1,"isfriend":0,"isfamily":0,"url_l":"https:\/\/farm6.staticflickr.com\/5581\/30715813446_ca306bb23c_b.jpg","height_l":"684","width_l":"1024"},{"id":"30625072262","owner":"59863270@N07","secret":"48108b7217","server":"5651","farm":6,"title":"Tasty Homegrown Cannabis - 2016","ispublic":1,"isfriend":0,"isfamily":0,"url_l":"https:\/\/farm6.staticflickr.com\/5651\/30625072262_48108b7217_b.jpg","height_l":"744","width_l":"1024"},{"id":"30101515203","owner":"131012412@N07","secret":"1ea8c9042d","server":"5608","farm":6,"title":"A day at the beach","ispub