Skip to content

Instantly share code, notes, and snippets.

View jessielw's full-sized avatar
🖥️
Coding

Jessie Wilson jessielw

🖥️
Coding
View GitHub Profile
@jessielw
jessielw / gist:c26957eb30f0dc8c9c401b7b3e1ae200
Created January 19, 2026 00:08 — forked from hest/gist:8798884
Fast SQLAlchemy counting (avoid query.count() subquery)
def get_count(q):
count_q = q.statement.with_only_columns([func.count()]).order_by(None)
count = q.session.execute(count_q).scalar()
return count
q = session.query(TestModel).filter(...).order_by(...)
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ...
print q.count()
@jessielw
jessielw / progress.py
Created December 2, 2024 17:14 — forked from vladignatyev/progress.py
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#
@jessielw
jessielw / ParallaxEffect.cs
Last active September 7, 2024 04:05
Unity 2D Parallax Effect script with Cinemachine
using UnityEngine;
using Cinemachine;
public class ParallaxEffect : MonoBehaviour
{
public Camera cam;
public Transform subject;
Vector2 startPosition;
float startZ;
:48(user.AvatarByEmailHash)
2023/12/12 14:12:36 ...eb/routing/logger.go:102:func1() [I] router: completed GET /jlw_4049/BHDStudio-Site/packages for 192.168.1.1:0, 200 OK in 33.4ms @ repo/packages.go:23(repo.Packages)
2023/12/12 14:12:37 ...eb/routing/logger.go:102:func1() [I] router: completed GET /jlw_4049/-/packages/container/bhdstudio/latest for 192.168.1.1:0, 200 OK in 19.6ms @ user/package.go:168(user.ViewPackageVersion)
2023/12/12 14:12:37 ...eb/routing/logger.go:102:func1() [I] router: completed GET /avatars/28582f3b8388844e28b9b9fcf2d2d01a56e7561eaa98e938e2f340c7ae7976a9?size=200 for 192.168.1.1:0, 200 OK in 1.2ms @ web/base.go:22(avatars)
2023/12/12 14:12:50 ...eb/routing/logger.go:102:func1() [I] router: completed GET /jlw_4049 for 192.168.1.1:0, 200 OK in 12.1ms @ user/home.go:706(user.UsernameSubRoute)
2023/12/12 14:12:50 ...eb/routing/logger.go:102:func1() [I] router: completed GET /avatars/28582f3b8388844e28b9b9fcf2d2d01a56e7561eaa98e938e2f340c7ae7976a9?size=512 for 192.168.1.1:0, 304 Not Modifi
{
"dovi_profile": 8,
"header": {
"rpu_nal_prefix": 25,
"rpu_type": 2,
"rpu_format": 18,
"vdr_rpu_profile": 1,
"vdr_rpu_level": 0,
"vdr_seq_info_present_flag": true,
"chroma_resampling_explicit_filter_flag": false,
@jessielw
jessielw / auto_ogm_chapters.py
Created January 3, 2023 19:02
Script to convert 'tagged' or incorrectly numbered chapters to correctly numbered chapters
from pathlib import Path
from typing import Union
from pymediainfo import MediaInfo
def generate_chapters(mode: str, mode_input: Union[Path, str] = None):
"""
Generate proper chapters with existing timestamps
@jessielw
jessielw / VapourSynth_Batch_Encoder_CLI.py
Last active February 20, 2023 00:55
Python CLI script to batch deinterlace and encode a directory of MKV files
import os
import sys
from pathlib import Path
from subprocess import Popen, run, PIPE
from shutil import rmtree
import argparse
def get_args():
parser = argparse.ArgumentParser()
@echo off
setlocal EnableDelayedExpansion
REM ##########################################################
REM ## Path's to executable files MUST BE QUOTED! ##
REM ## To get path's easily, hold "Left Shift" and "Right Click" on the exe, and select "Copy as Path"
REM ## Then you can paste after the = (no spaces)
REM ##
set dovi_tool_path="D:\Python Stuff\HDR10Plus-Parser-Tool\Apps\dovi_tool\dovi_tool.exe"
set mkvmerge_path="C:\Users\jlw_4\Desktop\mkvtoolnix\mkvmerge.exe"
@echo off
setlocal EnableDelayedExpansion
REM ##########################################################
REM ## Path's to executable files MUST BE QUOTED! ##
REM ## To get path's easily, hold "Left Shift" and "Right Click" on the exe, and select "Copy as Path"
REM ## Then you can paste after the = (no spaces)
REM ##
set dovi_tool_path="D:\Python Stuff\HDR10Plus-Parser-Tool\Apps\dovi_tool\dovi_tool.exe"
set ffmpeg_path="C:\FFMPEG\bin\ffmpeg.exe"
@jessielw
jessielw / TV Series FFMPEG + AviSynth encoding batch script
Created February 17, 2022 22:09
TV Series FFMPEG + AviSynth encoding batch script
@echo off
setlocal EnableDelayedExpansion
REM YOU MUST HAVE AviSynthPlus_3.7.0_20210111.exe and
REM AviSynthPlus_3.7.0_20210111_vcredist.exe insatlled
REM You can get both of those from https://github.com/AviSynth/AviSynthPlus/releases/