Skip to content

Instantly share code, notes, and snippets.

View VityaSchel's full-sized avatar
😎
I'm no longer underage

Viktor Shchelochkov VityaSchel

😎
I'm no longer underage
View GitHub Profile
@VityaSchel
VityaSchel / teachers.js
Last active October 1, 2023 18:36
Парсер сайта колледжа связи https://ks.psuti.ru/ и https://lk.ks.psuti.ru/
if(window.location.href !== 'https://ks.psuti.ru/about/teachers.html') throw new Error('Перейдите на страницу https://ks.psuti.ru/about/teachers.html')
const table = document.querySelector('form[action="https://ks.psuti.ru/about/teachers.html"')
const limitField = table.querySelector('select[name="limit"]')
if(limitField.options[limitField.selectedIndex].text !== 'Все') throw new Error('Выберете "Все" в "Количество строк"')
const teachers = Array.from(table.querySelectorAll('tbody > tr > td:last-child > a')).slice(1)
const getTeacherInfo = (url) => {
@VityaSchel
VityaSchel / macos-widget-to-ring-samsung-phones.md
Last active September 29, 2023 17:46
MacOS widget to ring samsung phones, reverse engineering samsung's smartthings find

hello gays

today we have a list of things to do to develop a widget for macos to ring samsung phones like on smartthings find

since no one developed it yet and I don't want to do that I'm just gonna leave it there for anyone and wait for anyone to develop it or tell me it exists

UPDATE: I actually was so bored I developed and published it: https://github.com/VityaSchel/samsung-pinger

number 1

@VityaSchel
VityaSchel / preview.md
Last active August 29, 2023 06:29
Show all IDs on screen in At Dead of Night or any other webpage (oneliner)
We couldn’t find that file to show.
@VityaSchel
VityaSchel / README.md
Created August 22, 2023 20:20
Люди о войне

Скрипт для получения списков с сайта https://human-nonhuman.info/

Получите два списка: humans и nonhumans

@VityaSchel
VityaSchel / README.md
Created May 13, 2023 17:15
Reset Steam achievements on MacOS without SAM

This took me a while to figure out, so here's all you need to know:

  1. To clear achievement we'll use Steam's client secret console and achievement_clear command
  2. You will need game id (number) and achievement id (string) in order to lock this particular achievement
  3. Since there is no "clear all achievements" command, we will use keyboard simulation to paste a long list of commands to steam console

How to do?

  1. Go to https://steamdb.info/ and find your game (I will use Terraria), then go to https://steamdb.info/app/105600/stats/ and find a table of achievements
  2. Scrap all achievements codes from 1st column into text array. You can use my script, just paste into browser console on steamdb page:
@VityaSchel
VityaSchel / index.html
Created April 30, 2023 20:13
Sucklabs browser matrix generator
<!DOCTYPE html>
<html lang="ru" dir="ltr">
<head>
<meta charset="utf-8">
<title>Sucklabs browser matrix generator</title>
</head>
<body>
<form id='form' style='display: flex; flex-direction: column; width: 182px;'>
<textarea name="name" rows="8" cols="10" id='text'>chrome: 95 windows 11, 95 windows 10, 95 windows8 8.1, 95 mac 11.4, 95 linux *, 94 windows 11, 94 windows 10, 94 windows8 8.1, 94 mac 11.4, 94 linux *, 93 windows 11, 93 windows 10, 93 windows8 8.1, 93 mac 11.4, 93 linux *, 93 android 11, 93 android 10
opera: 80 windows 11, 80 windows 10, 80 windows8 8.1, 80 windows8 8, 80 mac 11.4, 80 linux *, 63 android 11, 63 android 10
@VityaSchel
VityaSchel / telegram-mtproto-entities-to-html.ts
Created January 8, 2023 18:39
Function that accepts clear text with Telegram Core API styled text message entities and converts it to HTML.
import { Api } from 'telegram'
// gram.js format
const insert = (text: string, start: number, substring: string) => {
return text.substring(0, start) + substring + text.substring(start, text.length)
}
export function styleEntitiesToHTML(text: string, entities: Api.TypeMessageEntity[]): string {
let html = text
const tags = {
@VityaSchel
VityaSchel / animated-svg-recorder.js
Last active September 19, 2022 07:23
Record animated SVG on websites (animated by lottie and similar tools)
let recordedChanges = []
let startRecordingSVG = () => { recordedChanges = [] }
let stopRecordingSVG = () => { console.log(JSON.stringify(recordedChanges)) }
let observer = new MutationObserver(mutationRecords => {
for(const record of mutationRecords) {
if(record.attributeName === 'd') {
recordedChanges.push(record.target.getAttribute('d'))
}
}
@VityaSchel
VityaSchel / README.md
Last active December 31, 2023 20:57
Example of reading another process memory in Go without knowing base address

You can find explanation here: https://stackoverflow.com/questions/71716646/golang-calculate-address-of-another-process-memory-based-on-process-handle-and-o/72674927#72674927 This is actually my answer posted by my friend because SO doesn't allow you to reclaim your own bounty :)

It's not perfect because I don't know Go and you can definetely replace windows.OpenProcess with kernel32.OpenProcess but I'm too tired to experiment. It just works!

Also keep in mind that this code only works if you have running TJoC:R game running, because I was writing it for my trainer . You should change process name and addresses if you know how to do that. Otherwise, feel free to copy any part of code and use it.

@VityaSchel
VityaSchel / README.md
Last active October 18, 2023 20:11
Youtube cutter (Node.js, cli)

Youtube cutter

Follow these steps:

  1. Install yt-dlp somewhere on your computer and make sure it's accessible via PATH
  2. create new folder anywhere on your computer
  3. download cut.js here
  4. download pacakge.json here
  5. run npm i in this folder (npm and node must be installed)
  6. (RECOMMEND) download cutyt.cmd into this folder, change path to cut.js to yours, go to windows settings and add path to the folder to Environmental variable PATH, then you can run this as: