Skip to content

Instantly share code, notes, and snippets.

View Mortafix's full-sized avatar
🍑
Smashing the Keyboard

Moris Doratiotto Mortafix

🍑
Smashing the Keyboard
  • Università degli Studi di Milano
  • Paderno Dugnano (MI)
View GitHub Profile
@Mortafix
Mortafix / bot.py
Last active July 21, 2021 09:52
AutoConv real example
import sys
import warnings
from re import match
from uuid import uuid4
from autoconv.utils.persistence import AutoconvPersistence
from config import Config
from funcs import emz, pprint_media, pprint_trailers
from pymortafix.telegram import error_handler, standard_message
from states import STATE, states_handler
@Mortafix
Mortafix / resultBuilder.swift
Created May 17, 2021 10:30
Example of resultBuilder in Swift 5.4
struct Person {
var name: String
var surname: String
init(_ fullname: String) {
name = String(fullname.prefix(upTo: fullname.firstIndex(of: ",")!))
surname = String(fullname.suffix(from: fullname.index(fullname.firstIndex(of: " ")!, offsetBy: 1)))
}
func stampa(){ print("Person: \(name) \(surname)") }
@Mortafix
Mortafix / python-forever.md
Last active May 19, 2021 20:36
Tutorial to host a Python script forever

Run a Python script forever

Original Post

Features

  • Automatically start when the machine boot.
  • Automatically restart when it crashes/exits for whichever reason.

Installation

@Mortafix
Mortafix / example.sublime-project
Last active February 27, 2023 14:40
Sublime Text 4 project configuration file with build system in venv [Terminus]
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["__pycache__","venv"],
"file_exclude_patterns": [".gitignore", "LICENSE"]
}
],
"build_systems":