Skip to content

Instantly share code, notes, and snippets.

View akhildevelops's full-sized avatar
📺
Towards a greater vision

Akhil akhildevelops

📺
Towards a greater vision
View GitHub Profile
const std = @import("std");
// Cache requires a function (lambda) to be called when there's no cache hit and an other function(args_to_u64) that can compute args
// of the function to u64 that becomes the identifier to compare same arguments.
pub fn Cache(lambda: anytype, args_to_u64: fn (anytype) u64) type {
const lambda_info = @typeInfo(@TypeOf(lambda));
if (lambda_info != .@"fn") {
@compileError("lambda should be a function type");
}
const return_type = lambda_info.@"fn".return_type orelse @compileError("No return type");
@akhildevelops
akhildevelops / uninstall_ghostty.py
Created December 28, 2024 06:52
Uninstall ghostty
#!/usr/bin/env python3
# Licensed under the MIT license.
# See https://opensource.org/licenses/MIT for license details.
import sys
import os
from pathlib import Path
def main():
if len(sys.argv)>1:
#!/usr/bin/env python3
from pathlib import Path
import subprocess
import os
import sys
import json
STARTUP_SH="start.sh"
REFID="4501dd11ea6060740fd764b2f6006173c68b28ae"
WORKDIR=Path("/workspace")
@akhildevelops
akhildevelops / mp4stream.rs
Created November 30, 2024 13:48
Stream graphic art to browser
use image::{Rgb, RgbImage};
use minimp4::Mp4Muxer;
use openh264::{
encoder::Encoder,
formats::{RgbSliceU8, YUVBuffer},
};
use std::io::{Cursor, Read, Seek, SeekFrom};
use std::time::Duration;
const WIDTH: u32 = 512;
@akhildevelops
akhildevelops / PokemonData.csv
Created June 22, 2021 16:42
PokemonData.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
Name,Type,Total,HP,Attack,Defense,Sp. Atk,Sp. Def,Speed,url,icon
Bulbasaur,"['Grass', 'Poison']",318,45,49,49,65,65,45,https://pokemondb.net/pokedex/bulbasaur,https://img.pokemondb.net/sprites/sword-shield/icon/bulbasaur.png
Ivysaur,"['Grass', 'Poison']",405,60,62,63,80,80,60,https://pokemondb.net/pokedex/ivysaur,https://img.pokemondb.net/sprites/sword-shield/icon/ivysaur.png
Venusaur,"['Grass', 'Poison']",525,80,82,83,100,100,80,https://pokemondb.net/pokedex/venusaur,https://img.pokemondb.net/sprites/sword-shield/icon/venusaur.png
Charmander,"['Fire', '']",309,39,52,43,60,50,65,https://pokemondb.net/pokedex/charmander,https://img.pokemondb.net/sprites/sword-shield/icon/charmander.png
Charmeleon,"['Fire', '']",405,58,64,58,80,65,80,https://pokemondb.net/pokedex/charmeleon,https://img.pokemondb.net/sprites/sword-shield/icon/charmeleon.png
Charizard,"['Fire', 'Flying']",534,78,84,78,109,85,100,https://pokemondb.net/pokedex/charizard,https://img.pokemondb.net/sprites/sword-shield/icon/charizard.png
Squirtle,"['W
@akhildevelops
akhildevelops / hamilton-dataset.csv
Last active October 21, 2020 03:07
Hamilton-Lyrics-Table
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 3 in line 1.
title speaker lines
Alexander Hamilton BURR How does a bastard, orphan, son of a whore and a
Alexander Hamilton BURR Scotsman, dropped in the middle of a forgotten
Alexander Hamilton BURR Spot in the Caribbean by providence, impoveris...
Alexander Hamilton BURR Grow up to be a hero and a scholar?
Alexander Hamilton LAURENS The ten-dollar Founding Father without a father
apt-get update
echo "deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu xenial main" > /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu xenial main" > /etc/apt/sources.list
apt-get update
apt-get install gdal-bin python-gdal python3-gdal
git clone https://github.com/kscottz/PythonFromSpace.git
pip install -r requirements.txt
@akhildevelops
akhildevelops / files_extract.py
Created October 9, 2018 02:39
Extract FIlenames from a folder
import os
i=list(os.walk('.'))
k=i[0][2][1:]
k='\n'.join(k)
with open('files.txt','w') as file1:
file1.write(k)
print('done writing')