Skip to content

Instantly share code, notes, and snippets.

View Mte90's full-sized avatar
Creating new open source stuff that you will like

Daniele Scasciafratte Mte90

Creating new open source stuff that you will like
View GitHub Profile
Mte90 /
Last active January 25, 2022 11:27
Insultatore del server Discord dei redditor italiani
#!/usr/bin/env python3
from random import random, randint, choice, shuffle
import discord
from discord.ext import tasks
TOKEN = 'pensavichelomettessianchequavero?'
file = open('insulti.txt', 'r')
Mte90 / reddit.js
Last active February 18, 2022 11:33
Hide Youtube video from Reddit
// ==UserScript==
// @name Hide Youtube video from Reddit
// @namespace Mte90
// @match*
// @match*
// @grant none
// @version 1.0
// @author -
// @description As per title
// ==/UserScript==
Mte90 /
Created December 20, 2021 10:48
Convert mIRC trivia.txt to LakeYS/Discord-Trivia-Bot
#!/usr/bin/env python3
import yaml
with open('trivia.txt', mode="r", encoding="latin-1") as f:
lines = f.readlines()
questions = {}
count = 0
for line in lines:
count += 1
Mte90 /
Last active March 7, 2023 10:14
Calcolo buste paghe da PDF generati da Zucchetti
#!/usr/bin/env python3
from io import StringIO
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFParser
import sys
import os
Mte90 / webhook-getter.php
Created April 16, 2021 13:36
Webhook deployer for static websites from GitHub/GitLab
// This script require to be added in the Webhook section of you repo
// It will download the repository defined in the url in the path defined in the url
// For safety reasons is required a token in the url and will check the repo owner
// Note GitHub/GitLab generate zip files with a folder on it so it isn't enough to decomrpess them
// You need to get that content and a temporary folder is required to mvoe those files
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
Mte90 / woo-iva.php
Last active March 24, 2021 17:17
Esempio plugin per WooCommerce che aggiunge una colonna
* Plugin Name: WooCommerce Colonna IVA
* Description: Aggiunge una colonna nei prodotti WooCommerce
* Version: 1.0.0
* Author: LUGRieti
* Author URI:
* Requires at least: 4.9
* Tested up to: 4.9
#!/usr/bin/env bash
# This script injects a file into the current Apache2 environment temporarily
# in order to check its syntax.
# sed -i "2i ServerName" /etc/apache2/sites-available/000-default.conf
# Require adding this line to the example conf
Mte90 / rss.opml
Last active May 26, 2022 08:36
My RSS feed
<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
<dateCreated>Thu, 26 May 2022 08:36:15</dateCreated>
<outline text="Altro">
<outline text="FuturoProssimo" type="rss" xmlUrl="" htmlUrl="" description="il domani quotidiano."/>
<outline text="MGMT Magazine" type="rss" xmlUrl="" htmlUrl="" description=""/>
Mte90 / gitlab-ci.yml
Last active April 24, 2023 09:46
GitLab CI version for WPBP
image: jakzal/phpqa:alpine
- vendor/
- Code Quality
Mte90 /
Created July 7, 2020 14:17
Backup to webdav files and WordPress DB
today=$(date +"%Y-%m-%d")
path=$(date +"%Y/%m/%d")
rm -rf ./backups
mkdir ./backups
tar --exclude='./public_html/cgi-bin' --exclude='*.zip' --exclude='./public_html/wp-content/cache' -zcvf ./backups/$today.tar.gz ./public_html > /dev/null
./wp db export --add-drop-table --path=./public_html/ - | gzip > "./backups/$today.sql.gz"
curl --user "user:pass" -T "./backups/$today.tar.gz" "$path/domain-$today.tar.gz"