Skip to content

Instantly share code, notes, and snippets.

View npanuhin's full-sized avatar
☄️
There is no «Exception» in this library

Nikita Panuhin npanuhin

☄️
There is no «Exception» in this library
  • Constructor University
  • Bremen, Germany
  • LinkedIn in/npanuhin
View GitHub Profile
@npanuhin
npanuhin / VKClicker.js
Last active June 6, 2021 06:32
VK chat bot clicker
var clicker_button = document.getElementsByClassName("Keyboard")[0].getElementsByClassName("Button")[0],
clicker_count = 100000,
clicker_delay = 2000;
function botClick() {
clicker_button.click();
if (--clicker_count) {
setTimeout(botClick, clicker_delay);
}
}
@npanuhin
npanuhin / reset_commit_date.cmd
Last active February 17, 2024 10:46
Reset git CommitDate (for all commits in current branch)
set FILTER_BRANCH_SQUELCH_WARNING=1
git filter-branch -f --commit-filter "GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE";GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME";GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL";git commit-tree "$@";" HEAD
or
git filter-branch -f --commit-filter "GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE";GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME";GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL";git commit-tree -S "$@";" HEAD
@npanuhin
npanuhin / recursive_git_gc.cmd
Last active July 15, 2021 18:04
Run "git gc" recursively
@echo off
set ROOT_PATH="."
set COMMAND=git gc
FOR /R "%ROOT_PATH%" %%F IN (.) DO (
IF EXIST "%%F/.git" (
echo Handling "%%F"...
cd %%F
%COMMAND%
@npanuhin
npanuhin / vk_remove_documents.js
Last active June 6, 2021 06:28
Script for automatically removing all documents from your VK account
// Run on vk.com/docs page:
for (let item of document.getElementsByClassName("docs_delete_row")) item.click();
@npanuhin
npanuhin / lazy_load.js
Last active June 18, 2021 20:30
Lazy loading fonts and styles (JS)
function loadFont(name, local=[],
eot=undefined, woff=undefined, woff2=undefined, ttf=undefined,
font_weight="normal", font_style="normal", font_display="auto") {
name = `font-family:'${name}';`;
let eot_sep = (eot == undefined ? '' : `src:url('${eot}');`);
paths = [];
for (let path of local) paths.push(`local('${path}')`);
@npanuhin
npanuhin / convert_base.py
Last active September 23, 2022 20:37
Base converter on Python 3
from string import ascii_uppercase, digits
alphabet = digits + ascii_uppercase
def convert_base(n: str, from_base: int = 10, to_base: int = 10) -> str:
if isinstance(n, str):
n = int(n, from_base)
if n < to_base:
@npanuhin
npanuhin / PS_resize_to_fit.js
Last active December 25, 2021 21:09
Resize Photoshop image to specified resolution
// These are values for the end result width and height (in pixels) of our image
//
// Common values:
// Vk.com max photo size: 2560 x 2160
var target_width = 1920;
var target_height = 1080;
// ========================================================================================
@npanuhin
npanuhin / remove_submodule.cmd
Created August 19, 2021 22:10
Remove Git Submodule
set submodule_path=%1
git submodule deinit -f "%submodule_path%"
rmdir /S /Q ".git/modules/%submodule_path%"
git rm -f "%submodule_path%"
@npanuhin
npanuhin / strava_post_finder.js
Last active December 25, 2021 12:56
Strava: find all your posts in club
var name = "Name Surname";
function update() {
for (let post of document.querySelectorAll("#discussion-topics > li")) {
if (post.querySelector(".topic > .post-container > .post > .post-header > .post-info > a.str-click-name-js > strong").innerText == name) {
console.log(post.querySelector(".topic > .post-container > .post > .post-content .post-body > a").href);
}
post.remove();
}
@npanuhin
npanuhin / VkusVill_mango.js
Last active March 27, 2022 09:20
VkusVill mango promocode cheat
var layout = document.getElementById("app").getElementsByClassName("grid")[0];
var cards = layout.getElementsByClassName("card");
function next() {
var found = false;
for (var i = 0; i < cards.length; ++i) {
for (var j = 0; j < i && !found; ++j) {
if (
cards[i].getElementsByClassName("card__img")[0].src == cards[j].getElementsByClassName("card__img")[0].src &&
!cards[i].classList.contains("card--flipped") && !cards[j].classList.contains("card--flipped")