Skip to content

Instantly share code, notes, and snippets.

View AdventureBear's full-sized avatar

Suzanne Atkinson AdventureBear

View GitHub Profile
@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
@AdventureBear
AdventureBear / index.html
Created November 2, 2016 14:30
Rhino Crunch - with bind.js
<img class="logo" src="http://www.teamrhinotraining.com/wp-content/uploads/2013/05/icon1.png" width="200px">
<h1><a href="http://www.teamrhinotraining.com/app/">Rhino Crunch</a></h1></div>
<div class="grid-25">
Some Options here if needed
<div class="config-options">
<label><input type="checkbox" id="download"> Download</label>
@AdventureBear
AdventureBear / kona2012results.json
Created January 19, 2016 03:42
Kona 2012 Results JSON file
This file has been truncated, but you can view the full file.
[
{
"Last Name":"Jacobs",
"First Name":"Pete",
"Country":"AUS",
"Gender":"M",
"Category":"Pro",
"Category Place":"1",
"Gender Place":"1",
"Overall Place":"1",
[
{
"Time":"36:50",
"Place":1,
"Seconds":2210,
"Name":"Marco Pantani",
"Year":1995,
"Nationality":"ITA",
"Doping":"Alleged drug use during 1995 due to high hematocrit levels",
"URL":"https://en.wikipedia.org/wiki/Marco_Pantani#Alleged_drug_use",
@AdventureBear
AdventureBear / repIt.js
Created May 25, 2015 16:31
Pivot Object into new Arrays Dynamically via @ekojsalim @free Code Camp
var obj = [
{
"name": "Free Code Camp",
"cost": 0,
"weeks": 18,
"location": "online"
},
{
"name": "Costly Code Camp",