Skip to content

Instantly share code, notes, and snippets.

View yezz123's full-sized avatar
🦀
Rusty

Yasser Tahiri yezz123

🦀
Rusty
View GitHub Profile
import re
from logging import CRITICAL, DEBUG, ERROR, INFO, NOTSET, WARNING, Formatter, LogRecord
from typing import Dict, Optional
import colorama
class Colors:
"""Available colors for log formatter."""
  • Compile the Rust code to a shared library:
rustc --crate-type cdylib lib.rs

the Rust code defines a simple function perform_calculation that multiplies an input integer by 2.

The Rust code is compiled into a shared library, and then the Python script loads and calls this Rust function using ctypes.

@yezz123
yezz123 / script.js
Created March 17, 2023 13:04
Just back to code some JS
// Constants
const API_KEY = "sk-xxxx";
const MODEL_TYPE = "gpt-3.5-turbo"; //chatGPT model
// Creates a custom menu in Google Docs
function onOpen() {
DocumentApp.getUi().createMenu("ChatGPT")
.addItem("Generate Prompt", "generatePrompt")
.addItem("Generate Tweets Post", "generateIdeas")
.addToUi();
@yezz123
yezz123 / check.py
Created December 29, 2022 09:09
A script that check if the Github account that open an issue is new or old
import requests
import datetime
# Replace {OWNER} and {REPO} with the owner and repository where the issue is located
# Replace {ISSUE_NUMBER} with the number of the issue you want to tag
# Replace {TOKEN} with a personal access token with the necessary permissions
url = "https://api.github.com/repos/{OWNER}/{REPO}/issues/{ISSUE_NUMBER}/labels"
headers = { "Authorization": "Bearer {TOKEN}" }
# Get the account that created the issue
@yezz123
yezz123 / GraphQuery.js
Created March 8, 2022 20:24
github top users
const axios = require('axios');
const util = require('./util');
var mongo = require('mongodb').MongoClient;
const assert = require('assert');
module.exports = class GraphQuery {
constructor(cities, key, records, url) {
process.stdout.write(cities[0].toLowerCase() + ' ');
this.jsonAr = [];
@yezz123
yezz123 / Deploy.sh
Created February 23, 2022 13:57
Deploy a Website in Tor
#!/bin/bash
install_destination=/opt/epicyon-onion
username='epicyon-onion'
if [[ "$1" == 'remove' ]]; then
echo 'Removing Epicyon onion instance'
systemctl stop tor
rm /etc/torrc.d/epicyon
rm -rf /var/lib/tor/hidden_service_epicyon
systemctl restart tor
@yezz123
yezz123 / Model.py
Created February 15, 2022 14:43
A simple way to test Twilio SMS Sender
from django.db import models
# Used in the Test
class OutgoingSMS(models.Model):
sms_sid = models.CharField(max_length=34, default="", blank=True)
account_sid = models.CharField(max_length=34, default="", blank=True)
from_number = models.CharField(max_length=30)
to_number = models.CharField(max_length=30)
to_parsed = models.CharField(max_length=30, default="", blank=True)
body = models.TextField(max_length=160, default="", blank=True)
@yezz123
yezz123 / android.py
Created January 6, 2022 14:24
Setup your Termux as a Hacking machine with different tools
import os
def menu():
print("""
████████╗ ██████╗ ██████╗ ██╗ ███████╗
╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██╔════╝
██║ ██║ ██║██║ ██║██║ ███████╗
██║ ██║ ██║██║ ██║██║ ╚════██║
██║ ╚██████╔╝╚██████╔╝███████╗███████║
did:3:kjzl6cwe1jw14ak12wswxvz7ta38xdi5z1nqzkbj7p525zom88ewda6egovca4c
@yezz123
yezz123 / coroutine.py
Last active November 30, 2021 18:54
GDG Casablanca 2021 - Demo
import time
import asyncio
t1 = time.time()
async def loop(arg, name):
track = 1
print(name, "Started at", time.time() - t1)
for i in range(arg):