Skip to content

Instantly share code, notes, and snippets.

View hitrust's full-sized avatar

hitrust hitrust

View GitHub Profile
@hitrust
hitrust / stablediffusionwalk.py
Created August 17, 2022 02:24 — forked from karpathy/stablediffusionwalk.py
hacky stablediffusion code for generating videos
"""
draws many samples from a diffusion model by slerp'ing around
the noise space, and dumps frames to a directory. You can then
stitch up the frames with e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i out/frame%04d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p test.mp4
THIS FILE IS HACKY AND NOT CONFIGURABLE READ THE CODE, MAKE EDITS TO PATHS AND SETTINGS YOU LIKE
THIS FILE IS HACKY AND NOT CONFIGURABLE READ THE CODE, MAKE EDITS TO PATHS AND SETTINGS YOU LIKE
THIS FILE IS HACKY AND NOT CONFIGURABLE READ THE CODE, MAKE EDITS TO PATHS AND SETTINGS YOU LIKE
@hitrust
hitrust / extractdocx.py
Created September 30, 2022 15:20 — forked from etienned/extractdocx.py
Simple function to extract text from MS XML Word document (.docx) without any dependencies.
try:
from xml.etree.cElementTree import XML
except ImportError:
from xml.etree.ElementTree import XML
import zipfile
"""
Module that extract text from MS XML Word document (.docx).
(Inspired by python-docx <https://github.com/mikemaccana/python-docx>)
@hitrust
hitrust / s3_client_sync_download_folder.py
Created May 15, 2023 00:34 — forked from a-canela/s3_client_sync_download_folder.py
Directory download (sync) through boto3 supporting include-only pattern
import os
import boto3
from fnmatch import fnmatch
from botocore.config import Config
from traceback import format_exc
from multiprocessing import Process, Queue, Pipe
from concurrent.futures import ThreadPoolExecutor
class DownloadException(Exception):
@hitrust
hitrust / pagination_macros.html
Created May 18, 2024 07:09 — forked from allhailwesttexas/pagination_macros.html
Flask/Jinja2 macro for rendering pagination in a template with Bootstrap components. Can center the component by wrapping in <nav class="text-center">.
{% macro render_pagination(pagination, endpoint) %}
<ul class="pagination">
{% if pagination.has_prev %}
<li>
<a href="{{ url_for(endpoint, page=pagination.prev_num) }}" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>