Skip to content

Instantly share code, notes, and snippets.

@Kaligula0
Kaligula0 / YouTube_URLs.regexp
Last active April 24, 2024 07:30
A RegExp that matches all valid YouTube video URLs.
^(?:(?:https?:)?\/\/)?(?:(?:(?:www|m(?:usic)?)\.)?youtu(?:\.be|be\.com)\/(?:shorts\/|live\/|v\/|e(?:mbed)?\/|watch(?:\/|\?(?:\S+=\S+&)*v=)|oembed\?url=https?%3A\/\/(?:www|m(?:usic)?)\.youtube\.com\/watch\?(?:\S+=\S+&)*v%3D|attribution_link\?(?:\S+=\S+&)*u=(?:\/|%2F)watch(?:\?|%3F)v(?:=|%3D))?|www\.youtube-nocookie\.com\/embed\/)([\w-]{11})[\?&#]?\S*$
@bzvyagintsev
bzvyagintsev / README.md
Last active April 24, 2024 07:30
Шаблон README.md

Название проекта

Добавьте краткое описание проекта, опишите какую задачу он решает. 1-3 предложения будет достаточно. Добавьте бейджи для важных статусов проекта: статус разработки (в разработке, на поддержке и т.д.), статус билда, процент покрытия тестами и тд.

Содержание

@SunMarc
SunMarc / finetune_llama_gptq.py
Last active April 24, 2024 07:28
Finetune GPTQ model with peft and tlr
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
//...
public function register()
{
$this->app->singleton('command.migrate.fresh', function () {
return new FreshCommand();
});
}
//...
@Cyclize
Cyclize / minecraft-offline-uuid.sql
Created April 24, 2024 07:25 — forked from Wector11211/minecraft-offline-uuid.sql
Generate an offline minecraft UUID v3 based on the case sensitive player name
CREATE OR REPLACE FUNCTION generate_offline_uuid(
username_p VARCHAR(20)
) RETURNS VARCHAR(36) BEGIN
DECLARE uuid_bytes VARCHAR(36);
SELECT MD5(CONCAT('OfflinePlayer:', username_p)) INTO uuid_bytes;
SELECT INSERT(uuid_bytes, 13, 2, HEX(CONV(SUBSTR(uuid_bytes, 13, 2), 16, 10) & 0x0f | 0x30)) INTO uuid_bytes;
SELECT INSERT(uuid_bytes, 17, 2, HEX(CONV(SUBSTR(uuid_bytes, 17, 2), 16, 10) & 0x3f | 0x80)) INTO uuid_bytes;
RETURN (SELECT LCASE(CONCAT_WS('-',
SUBSTR(uuid_bytes, 1, 8),
SUBSTR(uuid_bytes, 9, 4),
@gwen001
gwen001 / ejs.sh
Last active April 24, 2024 07:25
onliner to extract endpoints from JS files of a given host
curl -L -k -s https://www.example.com | tac | sed "s#\\\/#\/#g" | egrep -o "src['\"]?\s*[=:]\s*['\"]?[^'\"]+.js[^'\"> ]*" | awk -F '//' '{if(length($2))print "https://"$2}' | sort -fu | xargs -I '%' sh -c "curl -k -s \"%\" | sed \"s/[;}\)>]/\n/g\" | grep -Po \"(['\\\"](https?:)?[/]{1,2}[^'\\\"> ]{5,})|(\.(get|post|ajax|load)\s*\(\s*['\\\"](https?:)?[/]{1,2}[^'\\\"> ]{5,})\"" | awk -F "['\"]" '{print $2}' | sort -fu
# using linkfinder
function ejs() {
URL=$1;
curl -Lks $URL | tac | sed "s#\\\/#\/#g" | egrep -o "src['\"]?\s*[=:]\s*['\"]?[^'\"]+.js[^'\"> ]*" | sed -r "s/^src['\"]?[=:]['\"]//g" | awk -v url=$URL '{if(length($1)) if($1 ~/^http/) print $1; else if($1 ~/^\/\//) print "https:"$1; else print url"/"$1}' | sort -fu | xargs -I '%' sh -c "echo \"\n##### %\";wget --no-check-certificate --quiet \"%\"; basename \"%\" | xargs -I \"#\" sh -c 'linkfinder.py -o cli -i #'"
}
# with file download (the new best one):
# but there is a bug if you don't provide a root url
[Interface]
Address = <...>
MTU = 1412
PrivateKey = <...>
DNS = <...>
PostUp = iptables -t nat -A POSTROUTING -o %i -j MASQUERADE; iptables -A FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
PostDown = iptables -t nat -D POSTROUTING -o %i -j MASQUERADE; iptables -D FORWARD -i %i -m state --state RELATED,ESTABLISHED -j ACCEPT; iptables -D FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
[Peer]
@rishavpandey43
rishavpandey43 / git-commit-styleguide.md
Last active April 24, 2024 07:24
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types

@ozzi-
ozzi- / confluence_export_rewrite.sh
Last active April 24, 2024 07:24
rewrites URLs in confluence xml export zip files and creates sensible named zips
#!/bin/bash
if ! [ -x "$(command -v zip)" ]; then
echo 'Error: zip is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v unzip)" ]; then
echo 'Error: unzip is not installed.' >&2
exit 1
fi
@kev-omniata-com
kev-omniata-com / style.xsl
Created February 18, 2014 01:00
xslt for content.xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ac="http://www.atlassian.com/schema/confluence/4/ac/"
xmlns:ri="http://www.atlassian.com/schema/confluence/4/ri/"
xmlns:acxhtml="http://www.atlassian.com/schema/confluence/4/"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xsl ac ri acxhtml">
<!-- Transform Confluence storage format to XHTML -->