Skip to content

Instantly share code, notes, and snippets.

@MeexReay
MeexReay / update-discord.sh
Last active April 10, 2024 14:00
Bash file that updates discord from xbps-src (VOID LINUX) (with vencord)
#!/bin/sh
if [ "$(id -u)" -ne 0 ]; then sudo bash update-discord.sh >&2; exit 1; fi
rm -f -r -v void-packages
git clone https://github.com/void-linux/void-packages.git
chmod -R -v 777 "void-packages"
cd void-packages
sudo -u user ./xbps-src binary-bootstrap
echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
sudo -u user ./xbps-src pkg discord
xbps-install --repository hostdir/binpkgs/nonfree discord --yes
@themixray
themixray / pygame-template.py
Created April 3, 2022 17:09
Pygame template
import pygame
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("My Game")
clock = pygame.time.Clock()
run = True
while run:
@imDaniX
imDaniX / README Антимат.md
Last active October 23, 2024 12:06
Мат фильтр | Регулярка антимат

Регулярное выражение для нахождения русского мата в тексте. Использовать следует только для первичной модерации, ибо обходится нажатием в одну клавишу. Если вам требуется полноценный фильтра мата, советую прибегнуть к программному пути создания такового, найти третье API, или просто остановиться на ручной модерации.

Выражение писалось в первую очередь с оглядкой на регулярки Java - для других языков может потребоваться адаптация.

Основа регулярного выражения

\b(
((у|[нз]а|(хитро|не)?вз?[ыьъ]|с[ьъ]|(и|ра)[зс]ъ?|(о[тб]|п[оа]д)[ьъ]?|(.\B)+?[оаеи-])-?)?(
  [её](б(?!о[рй]|рач)|п[уа](ц|тс))|
  и[пб][ае][тцд][ьъ]
@cutiko
cutiko / Readme.md
Created November 22, 2019 18:24
Git delete last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

ORIGINAL did fork but search didn't helped me

@graywolf336
graywolf336 / BukkitSerialization.java
Last active February 16, 2025 15:51
Serialize and deserialize the player's inventory, including armor and content.
/**
* Converts the player inventory to a String array of Base64 strings. First string is the content and second string is the armor.
*
* @param playerInventory to turn into an array of strings.
* @return Array of strings: [ main content, armor content ]
* @throws IllegalStateException
*/
public static String[] playerInventoryToBase64(PlayerInventory playerInventory) throws IllegalStateException {
//get the main content part, this doesn't return the armor
String content = toBase64(playerInventory);