Skip to content

Instantly share code, notes, and snippets.

View RelativisticMechanic's full-sized avatar

Siddharth Gautam (सिद्धार्थ गौतम) RelativisticMechanic

  • Hyderabad, IN
View GitHub Profile
@RelativisticMechanic
RelativisticMechanic / FlintSpec.txt
Last active August 8, 2023 20:25
Flint Specification 0.0.1
Flint: A tiny alternative to excel for visualization and computation.
File Format:
---
ZIP -> sheet1.csv
sheet1.fl
Language
---
@RelativisticMechanic
RelativisticMechanic / python_webcrawler_cu_screenshot.py
Created December 29, 2022 20:13
A Web Crawler in Python That Takes Screenshots and Saves it (Uses Selenium and BSIV)
# implement a web crawler in python
import requests
import bs4
import selenium.webdriver
# URL
source_url = 'https://bhagvad-gita.github.io/'
# Which folder to save screenshots in
folder = './screenshots/'
# How many levels to traverse?
unsigned int test_int = 0;
static int audio_interface_callback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
uint16_t* out = (uint16_t*)outputBuffer;
uint16_t* data = (uint16_t*)((uintptr_t)userData + test_int * sizeof(uint16_t));
int audio_interface_play_sound(int channels, int sample_rate, int len, uint16_t* data)
{
PaStream* stream;
PaError err = Pa_OpenDefaultStream(&stream, 0, 1, paInt16, sample_rate, 256, audio_interface_callback, data);
if(err != paNoError)
{
fprintf(stderr, "stdgfx: error opening audio stream %s\n", Pa_GetErrorText(err));
return -1;
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>
#include <SDL/SDL.h>
#include "c8_cpu.h"