Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View primaryobjects's full-sized avatar

Kory Becker primaryobjects

View GitHub Profile
@primaryobjects
primaryobjects / CommonManager.cs
Created December 17, 2023 23:21
Advent of Code 2023, Day 3 Solution https://adventofcode.com/2023/day/3
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Net.Mime;
using System.Dynamic;
using System.Linq.Expressions;
namespace Managers
{
@primaryobjects
primaryobjects / advent2.md
Created December 17, 2023 05:08
Advent of Code 2023, Day 2 Solution https://adventofcode.com/2023/day/2
title author date output
Advent of Code 2023 Day 2
Kory Becker
`r Sys.Date()`
html_document
knitr::opts_chunk$set(echo = TRUE)
@primaryobjects
primaryobjects / advent1.md
Last active December 17, 2023 04:29
Advent of Code 2023, Day 1 Solution https://adventofcode.com/2023/day/1
title author date output
Advent of Code 2023 Day 1
Kory Becker
`r Sys.Date()`
html_document
knitr::opts_chunk$set(echo = TRUE)
@primaryobjects
primaryobjects / index.html
Last active December 15, 2023 02:55
ID generator in Javascript, React component https://jsbin.com/goximuyovo/edit?html,css,js,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
const busyStudent = (startTime, endTime, queryTime) => {
let count = 0;
// Iterate through the length of startTime.
for (i in startTime) {
// Increment count for each matching pair where startTime >= queryTime <= endTime.
count += queryTime >= startTime[i] && queryTime <= endTime[i] ? 1 : 0;
}
return count;
const removeDigit = (number, digit) => {
let max = 0;
index = number.indexOf(digit);
while (index != -1) {
left = number.substring(0, index);
right = number.substring(index+1);
value = left + right;
const n = BigInt(value);
class Solution:
def maxTurbulenceSize(self, arr: List[int]) -> int:
# O(n)
max_length = 1
is_greater = None
cur_length = 1
for i in range(len(arr) - 1):
# Compare the current and next array values.
s0 = arr[i]
class Solution:
def alternatingSubarray(self, nums: List[int]) -> int:
# Combination search O(n^2).
max_length = -1
for i in range(len(nums) - 1):
cur_length = 0
is_odd = True
# Check the subarray of values from i to the end of the array.
@primaryobjects
primaryobjects / index.html
Last active December 10, 2023 03:22
FDIC Bank Failures by Year in Python using Flask, pandas, requests, sqlite3 https://pandas-numpy-practice.primaryobjects.repl.co
<!DOCTYPE html>
<html>
<head>
<title>Bank Failures by Year</title>
<!-- Include Bulma CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css">
</head>
<body>
<section class="section">
<div class="container">
@primaryobjects
primaryobjects / ff2-auto-key.au3
Last active December 3, 2023 19:39
AutoIt script to automatically level up a magic spell in Final Fantay II on PSX (PS1) in the psxfin emulator.
;
; AutoIt script to automatically level up a magic spell in Final Fantay II on PSX (PS1).
;
#include <Constants.au3>
Opt("SendKeyDownDelay", 20)
$count = 10
; Wait for the window to become active.
If WinActivate("pSX v1.13") Then