Skip to content

Instantly share code, notes, and snippets.

View techtide's full-sized avatar

Arman Bhalla techtide

View GitHub Profile
@techtide
techtide / bulk_pdf_to_md.py
Created December 3, 2023 19:16
Bulk converter from PDF to Markdown
import os
import subprocess
from PyPDF2 import PdfReader
def convert_pdf_to_markdown(pdf_path, output_dir):
with open(pdf_path, 'rb') as pdf_file:
pdf_reader = PdfReader(pdf_file)
text_content = ""
for page_num in range(len(pdf_reader.pages)):
text_content += pdf_reader.pages[page_num].extract_text()
@techtide
techtide / telegram_to_obsidian.py
Created December 3, 2023 16:27
Parse exported/saved messages from Telegram into Markdown for Obsidian or Roam Research
import json
import jsonschema
import os
from datetime import datetime
schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"type": {"type": "string"},
""" expected directory structure
├── input
│   ├── input01.txt
│   ├── ...
├── output
│   ├── output01.txt
│   ├── ...
├── tester.py
└── two_sat.py
"""
#include <Arduino.h>
#include <stdint.h>
#include "SCMD.h"
#include "SCMD_config.h" //Contains #defines for common SCMD register names and values
#include "Wire.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1327.h>
#include "Adafruit_VL53L1X.h"
SCMD driver;
/* CMSC 31400 Final Project
* Arman Bhalla & Matthew Asir >> Cloud Test
* 29.11.2022
* Version: v5, 04.12.2022
*/
#include <Servo.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Wire.h>
@techtide
techtide / darboux_sums.py
Last active October 15, 2021 10:53
Compute Darboux Integral (Upper and Lower Riemann Sums)
from sympy import *
import numpy as np
from scipy import misc
from sympy.parsing.sympy_parser import parse_expr
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
init_printing(use_unicode = True)
// Adapted from https://forum.unity.com/threads/locatable-camera-in-unity.398803/
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.XR.WSA.Input;
using UnityEngine.XR.WSA.WebCam;
public class PhotoQuadNew : MonoBehaviour
{
GestureRecognizer m_GestureRecognizer;
/*
* Pig.java
* A game for AP CS.
* By Max and Arman.
*/
public class Pig {
private static int currentPlayer = 1;
private static int player1Score = 0 ;
@techtide
techtide / phylo.py
Created January 27, 2019 15:09
my work in progress script to generate a phylogenetic tree from DNA sequences of species
# Phylogenetic Tree Generator
# By techtide
print "How many species: "
species_count = int(raw_input())
sequences = []
for i in range(0, species_count):
print "Sequence " + str(i+1) + ": "
@techtide
techtide / Robot.java
Last active January 21, 2019 16:04
how to use ultrasonic
/* wot is the ultrasonic sensor
* sends ultrasonic pulses
* https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2013/11/How-ultrasonic-sensor-works.jpg?resize=700%2C470&ssl=1
* this is sample subsystem
*/
import edu.wpi.first.wpilibj.Ultrasonic;
Ultrasonic ultra = new Ultrasonic(1,1); // c ultrasonic sensor which uses DOut 1