Skip to content

Instantly share code, notes, and snippets.

View lgg's full-sized avatar
👑
Trying to make the world a better place

Fedor lgg

👑
Trying to make the world a better place
View GitHub Profile
@lgg
lgg / solution.md
Last active July 5, 2023 13:41
JetBrains intellij idea + NVM + nodejs + WebStorm

NVM + WebStorm

If you get error:

run npm command gives error "/usr/bin/env: node: No such file or directory

in file watcher

@lgg
lgg / clicker.js
Last active January 27, 2021 16:20
Своя игра online auto-clicker
clickerActivated = false;
function autoClicker(e) {
try {
if (e.currentTarget.children[0].classList.contains('tableBorder')) {
if (window.getComputedStyle(document.getElementById('table').children[0], null)['border-color'] === "rgb(255, 230, 130)") {
document.getElementById('playerButtonHost').children[0].click();
console.log('CLICKED')
@lgg
lgg / js-function arguments-parse.js
Created November 29, 2019 18:35
JS Function arguments parsing visual explaination
//JS Function arguments parsing visual explaination
let i = {
p0: 0,
p1: 0,
p2: 0,
p3: 0,
pa: 0
};
@lgg
lgg / README.md
Last active February 2, 2024 17:55
Telegram save all media from chat/user/channel

Quick tip. It is possible to download media with small python script.

Goto https://my.telegram.org and generate api id and api hash Install Telethon library with pip3 install telethon Run saveAllMedia.py (replace api_id, api_hash and username with your values).

If you need proxy install https://github.com/Anorov/PySocks pip install PySocks

This code downloads all media from the dialog with username user/chat/channel in current directory.

@lgg
lgg / index.js
Created January 30, 2018 00:30
create links list for opening
var links = [
];
var html ="";
for(var i =0; i< links.length; i++){
html += "<a href='" +links[i] + "'>" + links[i]+ "</a><br><br>";
}
@lgg
lgg / index.php
Created October 30, 2017 20:11
[VK] Move photos from saved to another album
<?php
/*
1. git clone https://github.com/fdcore/vk.api
2. mv vk.api/src/vk.php ./vk.php
3. edit file index.php below
*/
include __DIR__ . '/vk.php';
$user_id = 1; //YOUR VK USER ID
@lgg
lgg / vk_music.js
Created October 24, 2017 23:31
node js load music from vk
var querystring = require('querystring');
var https = require('https');
var iconv = require('iconv-lite');
const readline = require('readline-sync');
var my_id = parseInt(readline.question("Enter your ID: "));
var COOKIE = readline.question("Enter your cookies: ");
var USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36';
@lgg
lgg / readme.md
Last active May 2, 2024 20:14
Keepass file format explained

Keepass file format explained

I’m currently working (I’m just at the beginning, and I’m quite slow) on a personal project that will use Keepass files (kdb and kdbx).
I tried to find some documentation about .kdb and .kdbx format, but I didn’t find anything, even in the Keepass official website. I you want to know how these file formats are structured, you must read Keepass’s source code. So I wrote this article that explains how Keepass file format are structured, maybe it will help someone.

@lgg
lgg / js.js
Created September 5, 2016 20:44
МРКО генератор дат
// noprotect
//выводит столбец дат для
//уроков для планирования МРКО
window.onload = function () {
var el = document.getElementById('wrap');
//даты первых уроков
//в формате месяц-день-год
var dates = [