Skip to content

Instantly share code, notes, and snippets.

View aadishv's full-sized avatar
🛰️
pixelsat

Aadish Verma aadishv

🛰️
pixelsat
View GitHub Profile
@aadishv
aadishv / chinese_flash_gen.py
Last active February 7, 2025 06:28
new and improved utility for generating my Chinese flashcards!
# https://www.hskflashcards.com/downloads/ > Integrated Chinese, 3rd edition
# [above] > PlecoDict 2.0 > part 1
# * Download, save as "file.xml" in working directory
# * Run `yq -p=xml -o=json file.xml` (if not installed, `brew install yq`)
# * Save this script as "main.py" in working directory
# * Open a terminal in working directory and run `python3 main.py > output.txt`
# * Import "output.txt" into Fresh Cards (or any app supporting )
import json
data = json.load(open('file.json'))
for card in data['plecoflash']['cards']['card']:
@aadishv
aadishv / basic_calculator.swift
Last active December 1, 2024 21:02
made for a competition against my cousin where I proved swift's superiority over java :)
//
// ContentView.swift
// utilities
//
// Created by Aadish Verma on 11/7/24.
//
import SwiftUI
import Foundation
import Expression
@aadishv
aadishv / index.html
Last active December 12, 2024 19:20
used to be used to plan autons for 315P
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"
/>
<meta name="renderer" content="webkit" />
SAMPLE_ANS = 48
DATE = (2024, 3)
# MARK: - end constants for testing
import re
# MARK: - helper fns from previous problems
def int_grid_from_string(s):
grid = []
for line in s.splitlines():
if line != '':
grid.append([int(j) for j in line.split(' ') if j != ''])
@aadishv
aadishv / periodic.json
Last active February 19, 2025 04:31
condensed periodic table data
[{"type_localized": "Reactive Nonmetal", "melting": -259.16, "group": 1, "name": "Hydrogen", "density": "0.07099", "poster": "element_001_hydrogen/element_001_hydrogen_srp_th", "symbol": "H", "discoveredby": "Henry Cavendish", "number": 1, "period": 1, "boiling": -252.87, "mass": 1.00784, "english_name": "Hydrogen", "fun_fact": "Hydrogen is the most common element in the universe, making up about 75% of its mass.", "model": "element_001_hydrogen", "sticky": "H4sIAI6vEmAC_-OQUeLSz9U3MMqwTKqsMhJMzkjNzUxOzFFIzUnNTc0rKY5ic04sSsrPO8WIpO4Xo6AzTKErVOEiVqhKAIgDWEpTAAAA", "type": "Reactive Nonmetal", "line": 1, "discovery": "1766", "appearance": "colorless gas", "atomic_mass": 1.008, "boil": 20.271, "category": "diatomic nonmetal", "discovered_by": "Henry Cavendish", "melt": 13.99, "molar_heat": 28.836, "named_by": "Antoine Lavoisier", "phase": "Gas", "source": "https://en.wikipedia.org/wiki/Hydrogen", "bohr_model_image": "https://storage.googleapis.com/search-ar-edu/periodic-table/element_001_hydrogen/element_001_hyd
<div class="elements flex flex-col w-19/24">
<div class="flex flex-row">
<div
tabindex="1"
id="element-1"
class="flex flex-col font-mono pl-1 pr-1 rounded-xl border focus:border-2"
style="
font-size: calc(0.27 * (19 / 24) * 100vw / 18);
width: calc(0.9 * (19 / 24) * 100vw / 18);
height: calc(0.8 * (19 / 24) * 100vw / 18);
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct Garden {
ll x, y, t;
ll dist(Garden to) {
return abs(to.x - x)+abs(to.y - y);
}
bool reachable(Garden to) {
@aadishv
aadishv / ekudos.py
Created March 24, 2025 02:28
ekudos rule
from urllib.parse import quote
def generate_mailto_url(receiver_address: str, title: str, body: str) -> str:
"""
Generates a mailto URL with the specified sender, receiver, title, and body.
Args:
sender_address: The email address of the sender (not directly included in the URL,
but provided for context or potential future use).

HighStakes/src/autons.cpp

#include "autons.h"
#include "lemlib/chassis/chassis.hpp"
#include "pros/rtos.hpp"
#include "robot.h"
#include <vector>

using namespace robot::drive;
using namespace robot::intake;

Following is a description of an issue I am having. Use the following logic when reasoning about the issues: Part 1

  1. Attempt to identify the cause.
  2. If you are able to identify the cause, proceed to Part 2.
  3. If you are unable to identify the cause or if there are multiple options, instruct the user to gain more information. Give the user a step-by-step guide on how to obtain the information. Methods of obtaining information may include pasting in the contents of a particular file, running a terminal command, linking to documentation, etc. After the user responds with the extra information, go back to step 1.

Part 2

At this step, you now know the cause.