Skip to content

Instantly share code, notes, and snippets.

View championswimmer's full-sized avatar

Arnav Gupta championswimmer

View GitHub Profile
@championswimmer
championswimmer / arnaveval-prompt.txt
Created March 7, 2025 23:44
Prompt for ArnavEval 1.0
Build me a website which will be a personal financial tracker that helps create plan for future income and expenses and plan for goals in life.
Basic Details and Tech Stack to be used
Tech Stack
- Framework: React
- Language: Typescript
- Styling: Tailwind
- Icons: Lucide
@championswimmer
championswimmer / thoughts.txt
Created January 23, 2025 03:42
DeepSeek R1 Chain of Thought (Urinal Placement Optimiser)
`Okay, let's tackle this problem. So, the task is to determine the best position to place a new person in an 8-stall urinal configuration such that the total comfort score is maximized. The input is a string of 8 digits (0s and 1s), and we have to output the 1-indexed position to place the new person and the resulting comfort score.
First, I need to understand how the comfort score is calculated. From the description, for each person (each '1' in the final configuration), we add points based on the adjacent empty slots. The rules are:
- For each person, check their left and right.
- If one side is empty (adjacent slot is 0), add +1. If both sides are empty, add +2.
- Additionally, check two slots away. If there are two empty slots on either side (i.e., two consecutive 0s), add another +1. If both sides have two empty slots, add +2.
@championswimmer
championswimmer / commands.sh
Created June 20, 2023 17:31
Useful Commands
# Download portion of video
yt-dlp -4 -f "mp4" -S "res:1080" --write-thumbnail --download-section "*30:52-31:54" "https://www.youtube.com/watch?v=8Kazdjpf7oI"
# Download Twitter Thread
ttm -f -t -q -a --assets-path images -p posts --filename mobile-app-pms-india-2023 https://twitter.com/championswimmer/status/1622946183881564160
# Speed up a video
ffmpeg -i trainer.mp4 -filter:v "setpts=1/1.1*PTS" -filter:a "atempo=1.1" trailer.mp4
@championswimmer
championswimmer / ascii
Last active June 3, 2022 13:17
refactor-intro-code
██████╗░███████╗███████╗░█████╗░░█████╗░████████╗░█████╗░██████╗░
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗
██████╔╝█████╗░░█████╗░░███████║██║░░╚═╝░░░██║░░░██║░░██║██████╔╝
██╔══██╗██╔══╝░░██╔══╝░░██╔══██║██║░░██╗░░░██║░░░██║░░██║██╔══██╗
██║░░██║███████╗██║░░░░░██║░░██║╚█████╔╝░░░██║░░░╚█████╔╝██║░░██║
╚═╝░░╚═╝╚══════╝╚═╝░░░░░╚═╝░░╚═╝░╚════╝░░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝
@championswimmer
championswimmer / AsyncTaskExample.java
Created December 17, 2021 05:58
AsyncTaskExample.java
class MyTask extends AsyncTask {
void onPreTask() {
// step 1: this runs on main thread
}
void onTastExecute() {
// step 2: this runs on a separate background thread
@championswimmer
championswimmer / runtime-annotation-kotlin.md
Last active July 29, 2023 12:50
Runtime @annotation Processing using Reflection in Kotlin

Runtime @Annotation Processing using Reflection in Kotlin

Let us take a look at Annotations in Kotlin, and start with a simple example of processing annotations at runtime using JVM's reflection framework.

NOTE: This is shown in Kotlin, but is specific to how Kotlin/JVM works, and is not applicable to Kotlin/JS or Kotlin/Native.

Creating an Annotation

First of all, we create annotations in Kotlin using the keywords annotation class.

@championswimmer
championswimmer / MainActivity.kt
Created August 4, 2019 18:22
Android Async Handler Difference
package com.codingblocks.handlerasync
import android.annotation.SuppressLint
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
@championswimmer
championswimmer / MainActivity.kt
Created August 4, 2019 18:22
Android Async Handler Difference
package com.codingblocks.handlerasync
import android.annotation.SuppressLint
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
const express = require('express')
const app = express()
let todos = []
app.use(express.json())
app.use(express.urlencoded({extended: true}))
app.get('/todos', (req, res) => {
@championswimmer
championswimmer / index.html
Created October 3, 2018 11:31
IEEE NSIT Game Dev Workshop 2018
<html>
<!-- Mozilla Developer Network (mdn) -->
<!-- Upload to app.netlify.com/drop -->
<!-- Submit to [email protected] -->
<!-- Subject: IEEE Game Dev Assignment -->
<head>
<style>
#game {
height: 400px;