Skip to content

Instantly share code, notes, and snippets.

View the-bokya's full-sized avatar

Ayush Chaudhari the-bokya

View GitHub Profile
@the-bokya
the-bokya / bf.hs
Last active March 7, 2023 16:21
A Brainfuck interpreter in Haskell. (Note: It lacks the input ',' command). Pipe in the Brainfuck code through STDIN.
import Data.Char
-- Cmd is the tree containing the commands in sequence.
data Cmd = Cmd Char Cmd | Loop Cmd Cmd | Empty deriving Show
-- Brain is the main datatype that is processed throughout the program.
-- It has a strip of numbers with a pointer to point to the index on it
-- making it a Turing Machine. It also carries with it the output to be
-- piped out to standard output.
data Brain = Brain [Int] Int String deriving Show
@the-bokya
the-bokya / conway.py
Last active June 19, 2024 19:09
A parallel implementation of Conway's Game of Life in Python for the terminal (it makes those cute gliders sometimes!).
import os
import random
import time
import copy
# import threading
class Game:
def __init__(self, n: int):
@the-bokya
the-bokya / push-to-deploy.sh
Last active October 24, 2025 22:50
Git auto build and deploy latest changes
#!/bin/bash
# $1 should be the directory for the git repo
cd $1
git fetch
git_diff=$(git diff origin/main)
echo $git_diff
if [ -z "$git_diff" ]
@the-bokya
the-bokya / personal-stuff-mount.sh
Last active December 10, 2025 16:36
Private, encrypted disk volumes for general purpose usage
# set it up first using
# dd if=/dev/zero of=personal-stuff bs=1G count=1
#
# # you'll need to enter a password here
# cryptsetup luksFormat mg
#!/bin/bash
cryptsetup open /home/qwerty/personal-stuff personal-stuff
@the-bokya
the-bokya / wiki_philosophy.py
Last active May 9, 2026 13:20
Test the "you'll always eventually reach 'Philosophy' if you keep on clicking the first link" hypothesis
import requests
from bs4 import BeautifulSoup as bs4
import time
from itertools import pairwise
import json
import re
FILE_NAME = "links.gv"
ITERATIONS = 50