<GridView
Width="Auto"
Height="Auto"
ItemsSource="{x:Bind Chessboard}">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid MaximumRowsOrColumns="8" Orientation="Horizontal" />
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import gzip | |
import logging | |
from pathlib import Path | |
import piexif | |
from PIL import Image | |
# ─── Configuration ───────────────────────────────────────────────────────────── | |
EXTRACT_STEALTH_METADATA = False # Extract stealth metadata from embedded bits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before running the script, put it in the directory you want it to convert PNGs into WebPs | |
# Then run it, it will go through every image in the same directory the script is in (no single image mode sorry, too lazy) | |
# and save it in a subdirectory. It will skip any existing WebPs so if you want to replace the existing webps with new ones | |
# like with stealth enabled this time, if you had it disabled before, then youll have to delete the existing webps. | |
# There are some boolean values you can change as well as some other stuff in the "Configuration" part | |
# like a save as animated webp option which is useful for sharing the webp with a1111 style metadata in usercomment over discord | |
# because discord won't remove the metadata if it detects the webp as animated webp | |
# What this script doesn't do: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import CLIPTokenizer | |
# Load the tokenizer from the local directory | |
tokenizer = CLIPTokenizer.from_pretrained("openai/clip-vit-large-patch14") | |
# Your input text | |
text = input("Input text:\n") | |
# Tokenize the text | |
tokens = tokenizer(text, return_tensors="pt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define path | |
$downloadsPath = "$env:USERPROFILE\Downloads" | |
$user = "$env:USERNAME" | |
$identity = "$env:USERDOMAIN\$user" | |
# Get current ACL | |
$acl = Get-Acl $downloadsPath | |
# Remove all existing rules to start clean | |
$acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import torch | |
from PIL import Image | |
from transformers import AutoModelForCausalLM, AutoProcessor | |
device = "cuda:0" if torch.cuda.is_available() else "cpu" | |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32 | |
model_id = r"microsoft/Florence-2-base" # can also use path/to/huggingface/hub/florence2-repo-name/snapshots/hash or something like that | |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch_dtype, trust_remote_code=True).to(device) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
class GreenOutput: | |
# regex pattern to match URLs, IP and ports | |
url_pattern = re.compile( | |
r'((http|https|ftp|ftps):\/\/' # protocol | |
r'(\d{1,3}\.){3}\d{1,3}' # ip | |
r'(?::\d+)?' # port number if existing | |
r'(?:[\/\w.,@?^=%&:/~+#-]*)?' # rest of URL | |
r'|' # OR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import tkinter as tk | |
from tkinter import filedialog | |
import piexif | |
import piexif.helper | |
from PIL import Image | |
class PNGtoJPGConverterApp: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--sidebar-w-collapsed: 36px; /*used for collapsable sidebar*/ | |
--sidebar-h-extended: 240px; | |
--memberlist-collapsed: 62px; | |
--memberlist-expanded: 240px; | |
--memberlist-transition: 0.35s ease-in-out; | |
} | |
/*vc text is correct with channel sidebar and main chat margin*/ | |
.chat_f8f70f { margin-left: 0px !important; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_PNG_files | |
// tEXt chunk: text that can be represented in ISO/IEC 8859-1. | |
// use exif package instead for jpeg, etc | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
import 'package:png_chunks_extract/png_chunks_extract.dart' as pngExtract; // i thank that this exists. | |
void main() { | |
File file = File('path/to/image.png'); | |
final data = file.readAsBytesSync(); |
NewerOlder