Skip to content

Instantly share code, notes, and snippets.

View neo's full-sized avatar
😊
stay safe stay sane

Wenchen Li neo

😊
stay safe stay sane
View GitHub Profile
@tg-bomze
tg-bomze / prompt_parser.py
Created October 6, 2023 16:47
Compel prompt splitter and embedder
import torch
def parse_prompt_attention(text):
import re
re_attention = re.compile(r"""
\\\(|
\\\)|
\\\[|
\\]|
\\\\|
@mandrewstuart
mandrewstuart / introPython.py
Last active January 12, 2020 16:41
This is a 20-minute introduction to the Python programming language for a talk given at Lighthouse Labs in 2016.
#http://bit.ly/28VdHva
##########
#VARIABLES
##########
#numbers
a = 3 #float, int, and long
#strings
b = 'ha '
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@mattdesl
mattdesl / modules.md
Last active August 16, 2022 10:14
my favourite modules.
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 7, 2024 09:29
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k