Skip to content

Instantly share code, notes, and snippets.

View archatas's full-sized avatar

Aidas Bendoraitis archatas

View GitHub Profile
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active October 28, 2025 02:53
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

@jschoormans
jschoormans / equirectangular.py
Created December 8, 2022 23:08
generate 3D panorama views with stable diffusion
# %%
import replicate
model = replicate.models.get("prompthero/openjourney")
version = model.versions.get("9936c2001faa2194a261c01381f90e65261879985476014a0a37a334593a05eb")
PROMPT = "mdjrny-v4 style 360 degree equirectangular panorama photograph, Alps, giant mountains, meadows, rivers, rolling hills, trending on artstation, cinematic composition, beautiful lighting, hyper detailed, 8 k, photo, photography"
output = version.predict(prompt=PROMPT, width=1024, height=512)
# %%
# download the iamge from the url at output[0]
import requests
@PaulleDemon
PaulleDemon / index.md
Last active June 17, 2024 10:39
gist for html to delta conversion for quill js

Code for converting Html to delta for Quill editor in python

some of the attributes maybe missing or not correct. If you find any please feel free to notify me and update this gist

Below is the code for converting

from bs4 import BeautifulSoup, NavigableString

def convert_html_to_delta(html_string):
    soup = BeautifulSoup(html_string, "html.parser")
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
</head>
<body style="height: 300vh">
<svg style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);"
width="655" height="209" viewBox="0 0 655 209" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M653 207V62C653 28.8629 626.228 2 593.091 2C519.318 2 391.639 2 292.675 2C270.583 2 252.717 19.9124 252.717 42.0038C252.717 63.5378 252.717 81.7221 252.717 81.7221C252.717 81.7221 252.717 81.7221 252.717 81.7221V167C252.717 189.091 234.808 207 212.717 207H2"
stroke="#EAECF0" stroke-width="4" stroke-linecap="round"/>
@zerolab
zerolab / README.md
Last active September 7, 2025 21:13
Wagtail: Ignore StreamFields in migrations

Changes to Wagtail StreamField definitions will generate new migrations. This is in line with Django's philosophy and helps with data migrations. For complex definitions, the generated migrations were quite big. Wagtail 6.2 improved the generated migrations, making them much smaller, but they are still required. Reference: wagtail/wagtail#4298

However, for cases where data migrations are not necessary and are in active development, the need for the Django migration files become an unnecessary burden. To disable that you can use a modified version of StreamField as seen in fields.py.

Dev notes:

  • Add fields.py to your app.
  • Replace usages of from wagtail.fields import StreamField with from your_app.fields import StreamField
import numpy as np
import sounddevice as sd
from scipy import signal
import time
def sacred_frequencies(duration=10, sample_rate=44100):
"""Generate sacred frequency harmonics with OM oscillation and 777 Hz"""
# Time array
t = np.linspace(0, duration, int(sample_rate * duration))
@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then