Skip to content

Instantly share code, notes, and snippets.

import asyncio
from pyrogram import Client
api_id = int()
api_hash = str()
chat_id = int()
async def main():
async with Client("pyrogram_client", api_id, api_hash) as app:
async for message in app.get_chat_history(chat_id):
[].forEach.call(document.querySelectorAll('a'),
function(link){
if(link.attributes.target) {
link.attributes.target.value = '_self';
}
});
window.open = function(url) {
location.href = url;
};
@sandro010
sandro010 / eip1193.js
Created June 14, 2024 23:41
web3provider, window.ethereum, eip1193
// FUNCTIONS
async function request(){
if(arguments.length > 2) return;
const method = arguments[0]
const params = arguments[1] || [];
const response = await chrome.runtime.sendMessage(chrome.runtime.id, {method: method, params: params});
return response;
}
const Parser = require('rss-parser');
const parser = new Parser();
let refreshToken = 'eyJhbGciOiJFUzI1NksifQ.eyJzY29wZSI6ImNvbS5hdHByb3RvLnJlZnJlc2giLCJzdWIiOiJkaWQ6cGxjOmd2cnkzM3lqY3BhZ3N6ZjdtZGc2bTVpNSIsImF1ZCI6ImRpZDp3ZWI6YnNreS5zb2NpYWwiLCJqdGkiOiJqOG93SEdoeDRGODc0Qis5ekVRVjdaWFVCSnY5Y2E0MGJSSGM2R2Z6VkhBIiwiaWF0IjoxNzE4MDMzOTk1LCJleHAiOjE3MjU4MDk5OTV9.uwlH1ldBhtP3OKNiXo1sK1Mlm5Y5jMnJVkMyow2eZ4yNzWA7fUIQwrLU0fD3T7LOVlNNKJGH2a9WSYOBG_KmVQ'
let accessToken = 'eyJhbGciOiJFUzI1NksifQ.eyJzY29wZSI6ImNvbS5hdHByb3RvLmFjY2VzcyIsInN1YiI6ImRpZDpwbGM6Z3ZyeTMzeWpjcGFnc3pmN21kZzZtNWk1IiwiaWF0IjoxNzE4MDMzOTk1LCJleHAiOjE3MTgwNDExOTUsImF1ZCI6ImRpZDp3ZWI6Y2hhZ2EudXMtd2VzdC5ob3N0LmJza3kubmV0d29yayJ9.mtNIzD0yUpdIjyxC_WwnHcdHaEelWMmZfve2GwOJlAkcVknr6P6K_kF3FFgOFEZP2hxLA-UDYrCGndyozDO81Q';
const links = [];
async function getFeed() {
-- variables
local num = 1 -- number
local str = 'Hello world!' -- string
local bool = false -- boolean
local null = nil -- null
local func = print -- function
local table = {} -- table
-- function
function main()
for i in $(objdump -D $1 | grep "^ " | cut -f2);
do echo -n '\x'$i;
done;
echo -e '';
@sandro010
sandro010 / vcf_generator.py
Created June 6, 2024 17:34
VCF generator
import sys
def create_vcf_file(input_file, output_file):
with open(input_file, 'r') as numbers_file:
with open(output_file, 'w') as vcf_file:
for line in numbers_file:
phone_number = line.strip()
vcf_file.write(f"BEGIN:VCARD\nVERSION:3.0\nFN:\nN:;;;;\nTEL;TYPE=CELL:{phone_number}\nCATEGORIES:myContacts\nEND:VCARD\n")
create_vcf_file(sys.argv[1], sys.argv[2])
echo -n "Hello world!" | base6
curl -L -A $(echo 'SGVsbG8gd29ybGQhCg==' | base64 -d) $(echo 'SGVsbG8gd29ybGQhCg==' | base64 -d) &> /dev/null
__import__('zlib').decompress(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('SGVsbG8gd29ybGQhCg==')[0]))
bash <(echo 'SGVsbG8gd29ybGQhCg==' | base64 -d)
@sandro010
sandro010 / platform.py
Created June 6, 2024 17:15
Python platform
import platform
if platform.system().lower() == 'windows':
if '10' in platform.release():
pass
elif '8' in platform.release():
pass
elif '7' in platform.release():
pass
else:
@sandro010
sandro010 / replace_newline.py
Created June 6, 2024 17:11
Replace new line
import sys
def replace_newline(input_file, output_file):
with open(input_file, 'r') as file:
content = file.read()
content = content.replace('\\n', '\n')
with open(output_file, 'w') as file:
file.write(content)