Skip to content

Instantly share code, notes, and snippets.

# Сначала примеры на реальных данных
/tmp
❯ wget -q https://cve.mitre.org/data/downloads/allitems-cvrf.xml

/tmp 53s
❯ ls -ahl allitems-cvrf.xml      
-rw-r--r-- 1 sergey sergey 345M Jul 26 12:45 allitems-cvrf.xml

/tmp
// programmatic view controller
/*
usage:
override func viewDidLoad() {
super.viewDidLoad()
let newViewController = NewViewController(string: "Hello")
addChildViewController(newViewController, in: view)
}
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@toxirovvv
toxirovvv / phone_number regex
Created May 18, 2024 06:55
Regex Uzbekistan phone nuber
r"^998([378]{2}|(9[013-57-9]))\d{7}$"
100% works in all Uzbekistan to phone numbers
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@Obydux
Obydux / Fabric-Quilt-Server-Optimization.md
Last active May 18, 2024 06:43
Fabric/Quilt Server Optimization

Fabric/Quilt Server Optimization

This has updated for 1.20.4, all of the optimization mods mentioned here are compatible with each other and don't affect vanilla behaviour by default.

Mods

Lithium - A mod designed to drastically improve the general performance of Minecraft without breaking things.

VMP - A mod designed to improve general server performance at high playercount.

@mirzax11
mirzax11 / Visual Studio 2022 Product Key
Created May 18, 2024 06:40 — forked from pablotolentino/Visual Studio 2022 Product Key
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J