Skip to content

Instantly share code, notes, and snippets.

View ProfAvery's full-sized avatar

Kenytt Avery ProfAvery

  • California State University, Fullerton
  • Fullerton, CA
View GitHub Profile
@ProfAvery
ProfAvery / apateDNS.exe.config
Created September 10, 2024 03:45
CPSC 458 - ApateDNS config to avoid installing .NET 3.5
<configuration>
<startup>
<supportedRuntime version="v4.0" />
</startup>
</configuration>
@ProfAvery
ProfAvery / weather.snapshot.test.tsx
Created July 17, 2024 23:55
Updated Listing 8-26 - Summer 2024 AMSE Bootcamp
/**
* @jest-environment jsdom
*/
import { act, render, fireEvent } from "@testing-library/react";
import PageComponentWeather from "../../../pages/components/weather";
describe("PageComponentWeather", () => {
test("renders correctly", async () => {
let component: any;
@ProfAvery
ProfAvery / [zipcode].ts
Last active October 8, 2024 17:42
Updated Listing 7-9 - Summer 2024 AMSE Bootcamp
import type {NextApiRequest, NextApiResponse, NextApiHandler} from "next";
import {findByZip} from "./../../../../mongoose/weather/services";
import dbConnect from "./../../../../middleware/db-connect";
async function handler(
req: NextApiRequest,
res: NextApiResponse
): Promise<NextApiResponse<WeatherDetailType> | void> {
let data = await findByZip(req.query.zipcode as string);
return res.status(200).json(data);
@ProfAvery
ProfAvery / albums-graphql.mjs
Last active October 8, 2024 17:42
REST vs. GraphQL - Summer 2024 AMSE Bootcamp
const query = `
query {
artists(where: {name: "Red Hot Chili Peppers"}) {
albums {
title
}
}
}
`;
@ProfAvery
ProfAvery / cart-redux.mjs
Last active June 28, 2025 03:23
Reducers without React - Summer 2025 AMSE Bootcamp
import { createStore } from 'redux'
const initialCartState = []
const CartTypes = {
ADD: 'ADD',
EMPTY: 'EMPTY',
REMOVE: 'REMOVE'
}
@ProfAvery
ProfAvery / createItems.mjs
Created July 1, 2024 22:43
PocketBase item population script - Summer 2024 AMSE Bootcamp
import PocketBase from 'pocketbase';
const pb = new PocketBase('http://127.0.0.1:8090');
const data = [
{
itemId: 'coffee',
imageId: 'coffee',
title: 'Coffee',
price: 0.99,
@ProfAvery
ProfAvery / latex-equation-cheat-sheet.ipynb
Created June 29, 2024 23:49
LaTeX Equation Cheat Sheet.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ProfAvery
ProfAvery / empirical_gradient.py
Last active October 8, 2024 17:43
California State University, Fullerton - CPSC 481 - Empirical gradient and gradient descent
#!/usr/bin/env python
def derivative(f, h=1e-5):
def df(x):
return (f(x + h) - f(x)) / h
return df
@ProfAvery
ProfAvery / mkclaims.py
Last active October 8, 2024 17:54
California State University, Fullerton - CPSC 449 - JWK and JWT generation
#!/usr/bin/env python
import os
import sys
import json
import datetime
def usage():
program = os.path.basename(sys.argv[0])
@ProfAvery
ProfAvery / zip.scm
Last active October 8, 2024 17:54
California State University, Fullerton - CPSC 439 - Exercise 8.10 in Scheme
(define PAIR cons)
(define HEAD car)
(define TAIL cdr)
(define ISEMPTY null?)
(define reverse
(lambda (l result)
(if (ISEMPTY l)
result
(reverse (TAIL l) (PAIR (HEAD l) result)))))