Skip to content

Instantly share code, notes, and snippets.

View jegor377's full-sized avatar

Igor Santarek jegor377

View GitHub Profile
@jegor377
jegor377 / remove_youtube_short.js
Last active January 4, 2023 20:22
Removes YouTube Shorts from YouTube page on current tab. No section, not Shorts button.
// ==UserScript==
// @name Completely remove YouTube Shorts from page
// @namespace https://github.com/hallzy
// @version 0.2
// @description Removes YouTube Shorts Videos from your current page.
// @author Steven Hall, Igor Santarek
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
@jegor377
jegor377 / main.py
Last active September 28, 2021 12:00
Generating spanning tree from grid, determining if a grid is a spanning tree, searching for cycle in grid.
edges = [[1, 2], [0, 2], [0, 1, 3], [0, 2]] # grid
vertices = [1, 2, 3, 4]
# edges = [[2], [2], [0, 1, 3], [2]] # spanning tree
# vertices = [1, 2, 3, 4]
visited = [False] * len(vertices)
spanning_tree_edges = [[] for x in range(len(vertices))]
def is_spanning_tree_dfs(node, source, _edges):
@jegor377
jegor377 / noita_seed.py
Created May 3, 2021 10:41
Noita seed changer script made in Python. If you want to use it then just install Python 3.6 or higher and set important variables inside the script. Then just run and that's it.
import os
import shutil
import subprocess
LOCAL_DIR = 'SPECIFY LOCAL DIR HERE' # your local dir noita path (f.e. %userprofile%\AppData\LocalLow\Nolla_Games_Noita\save00)
NOITA_DIR = 'SPECIFY NOITA DIR HERE' # your noita's game directory that contains noita.exe
def del_file_if_exists(path):
if os.path.exists(path):
extends Camera
var _duration = 0.0
var _period_in_ms = 0.0
var _amplitude = 0.0
var _timer = 0.0
var _last_shook_timer = 0
var _previous_x = 0.0
var _previous_z = 0.0
@jegor377
jegor377 / star generator.py
Created April 1, 2020 23:37
Little script for procedural generating parallax background sprite. I use it for generating a lot of little stars. You can adjust size of the image, amount of stars, star sample sprite, deviation in size (don't set 100%).
from PIL import Image
from random import randint
import math
def distance(a, b):
return math.sqrt(math.pow(b[0] - a[0], 2) + math.pow(b[1] - a[0], 2))
def is_near_other_star(star, stars, min_dist):
@jegor377
jegor377 / networking.gd
Last active October 7, 2022 16:43
Godot TCP API Client Code
extends Node
const BIG_ENDIAN = 'big'
const LITTLE_ENDIAN = 'little'
const INT_SIZE = 4
const ERROR_INDEX = 0
const DATA_INDEX = 1
const MAX_SIGNALS_COUNT = 255
onready var stream_peer = StreamPeerTCP.new()
if %1.go.==. goto :errorFileName
echo package %1>>%1.go
echo.>>%1.go
echo import "fmt">>%1.go
echo.>>%1.go
echo func main() {>>%1.go
echo fmt.Println("Hello World\n")>>%1.go
echo }>>%1.go
exit /b