Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Alyetama's full-sized avatar
🏠
Working from home

Mohammad Alyetama Alyetama

🏠
Working from home
View GitHub Profile
@Alyetama
Alyetama / image_grid.py
Created January 15, 2024 17:18
Create an image grid in Python
import argparse
import math
from glob import glob
from PIL import Image
class MissingArgument(Exception):
pass
@charset "UTF-8";@import "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.css";code,pre{border-radius:4px}code,kbd{color:#c7254e;background-color:#f9f2f4;padding:2px 4px}kbd{color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0-1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;box-shadow:none}pre{display:block;margin:0 0 10px;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;overflow:auto}pre code,table{background-color:transparent}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}table{border-collapse:collapse;border-spacing:0}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th{padding:8px;line-height:1.4285714;border-top:1px solid #ddd}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td{padding:8px;line-height:1.4285714;vertical-align:top;border-top:1
@Alyetama
Alyetama / markdown_table_style.css
Created August 25, 2022 14:45
Markdown Table CSS
@charset "UTF-8";
@import 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.css';
code {
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px
}
@Alyetama
Alyetama / requirements.txt
Created August 18, 2022 06:19
Stable Diffusion Scraper
python-dotenv>=0.20.0
selenium>=4.3.0
@Alyetama
Alyetama / bot.py
Created August 18, 2022 03:59
Stable Diffusion Parasitic Bot
#!/usr/bin/env python
# coding: utf-8
import os
import tempfile
import time
import requests
from discord import File
from discord.ext import commands
@Alyetama
Alyetama / prepare_dataset.py
Last active August 17, 2022 06:54
Label Studio S3 to YOLOv5
#!/usr/bin/env python
# coding: utf-8
import argparse
import json
import os
import shutil
import signal
import sys
import textwrap
@Alyetama
Alyetama / words
Created July 21, 2022 13:53
/usr/share/dict/words
This file has been truncated, but you can view the full file.
A
a
aa
aal
aalii
aam
Aani
aardvark
aardwolf
Aaron
This file has been truncated, but you can view the full file.
➜ GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install .
Processing /Users/Alyetama/grpc
Preparing metadata (setup.py) ... done
Requirement already satisfied: six>=1.5.2 in /Users/Alyetama/miniforge3/lib/python3.10/site-packages (from grpcio==1.47.1) (1.16.0)
Building wheels for collected packages: grpcio
Building wheel for grpcio (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
#!/usr/bin/env python
# coding: utf-8
import re
import string
import sys
from pathlib import Path
class MissingNameArgument(Exception):
@Alyetama
Alyetama / auto_docstring.py
Last active May 25, 2022 19:09
Automatically generate elaborate high quality docstrings for your Python file
#!/usr/bin/env python
# coding: utf-8
import argparse
import os
import time
import openai
from tqdm import tqdm