Skip to content

Instantly share code, notes, and snippets.

View taesiri's full-sized avatar
😎
Keep Hacking!

Mohammad Reza Taesiri taesiri

😎
Keep Hacking!
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<style>
.container {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
padding: 20px;
digraph G {
// Graph settings
rankdir=LR;
node [shape=circle, fontname="Arial"];
edge [fontname="Arial", fontsize=10];
// Edges with weights
F -> E [label="12"];
D -> K [label="5"];
Y -> S [label="4"];
@taesiri
taesiri / get-gpt-captions.py
Created May 19, 2024 22:07
get-captions-gpt
import openai
import os
import json
import base64
import argparse
from time import sleep
from openai import OpenAI
from tqdm import tqdm
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
#!/bin/bash
function generate_cert() {
if [ $# -ne 2 ]; then
echo "Usage: generate_cert <email> <domain>"
return 1
fi
local email=$1
local domain=$2
@taesiri
taesiri / config.json
Created June 7, 2023 17:54
v2ray-loadbalancer
{
"api": {
"services": [
"HandlerService",
"LoggerService",
"StatsService"
],
"tag": "api"
},
"inbounds": [
@taesiri
taesiri / speedy.py
Created April 10, 2023 05:10
SpeedTest.py
import requests
import time
def format_speed(speed_bytes):
"""
Formats download speed into a human-readable string.
:param speed_bytes: Download speed in bytes per second
:return: Formatted download speed string
@taesiri
taesiri / imagenet-labels.json
Created March 23, 2023 04:24
imagenet-labels.json
["tench",
"goldfish",
"great white shark",
"tiger shark",
"hammerhead shark",
"electric ray",
"stingray",
"cock",
"hen",
"ostrich",
@taesiri
taesiri / Dockerfile
Last active August 29, 2022 12:43
Dockerfile for JAX Cuda + PyTorch
FROM nvidia/cuda:11.6.1-cudnn8-devel-ubuntu20.04
# Install python3
RUN apt update && apt install -y python3-pip htop curl wget git
RUN ln -sf /usr/bin/python3 /usr/bin/python && \
ln -sf /usr/bin/pip3 /usr/bin/pip
RUN pip --no-cache-dir install --upgrade pip setuptools_rust
@taesiri
taesiri / index.html
Created February 25, 2022 03:31
Sketchfab set view
<div class="container">
<div class="iframe-container">
<iframe id="api-frame"></iframe>
</div>
<div class="explainer" id="explainer">
Set camera position example. The "Print view" button outputs camera information to the console.
</div>
<div class="controls" id="controls">
<button id="view1">View Poe</button>
<button id="view2">View Rey</button>
@taesiri
taesiri / install_xelatex_on_mac.txt
Created March 30, 2021 13:53 — forked from peterhurford/install_xelatex_on_mac.txt
How to install latex and xelatex on Mac so that Jupyter "Download as PDF" will work
brew install pandoc
brew tap homebrew/cask
brew cask install basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2020basic/bin/x86_64-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox