Skip to content

Instantly share code, notes, and snippets.

@albertopasqualetto
albertopasqualetto / gh_release_redirect.user.js
Last active February 24, 2025 23:37
GitHub Release Redirect Userscript
// ==UserScript==
// @name GitHub Release Redirect
// @namespace albertopasqualetto
// @version 1.1
// @description Redirect from specific GitHub release pages to the main releases page, unless coming from there
// @author albertopasqualetto
// @match *://github.com/*
// @icon https://github.githubassets.com/pinned-octocat.svg
// @grant none
// @downloadURL https://gist.github.com/albertopasqualetto/4d00d83794d3fff1039cb86680242633/raw/gh_release_redirect.user.js
@albertopasqualetto
albertopasqualetto / Dockerfile
Created October 16, 2024 23:25
Move files received from telegram api docker container to another volume
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# Copy the current directory contents into the container
COPY . .
RUN mkdir /origin && mkdir /destination
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
@albertopasqualetto
albertopasqualetto / n8n_clean_mstodo_completed_tasks.json
Created October 13, 2024 18:10
n8n Clean MS To Do completed tasks Workflow
{
"name": "Clean MS To Do completed tasks",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"weeksInterval": 2,
@albertopasqualetto
albertopasqualetto / n8n_todoist_to_mstodo.json
Last active October 13, 2024 18:09
n8n Todoist -> MS To Do Workflow
{
"name": "Todoist -> MS To Do",
"nodes": [
{
"parameters": {
"dataType": "string",
"value1": "={{ $json[\"body\"][\"event_name\"] }}",
"rules": {
"rules": [
{
@albertopasqualetto
albertopasqualetto / OneNoteBackupScript.ps1
Last active October 9, 2024 21:10
Backup di OneNote on Google Drive using Rclone
$TAB = "`t"
# ****** BACKUP OF ONENOTE TO GOOGLE DRIVE USING RCLONE ******
Write-Host "****** RClone OneNote backup on Google Drive ******"
# ****** BACKUP TO UNI DRIVE ******
Write-Host "Backup on Uni Drive..."
Write-Host "$TAB Upload..."
rclone copy "C:\Users\alber\AppData\Local\Microsoft\OneNote\16.0\Backup\Primo Semestre - Quarto anno" "GDrive Uni:_Backup OneNote/Primo Semestre - Quarto anno"
rclone copy "C:\Users\alber\AppData\Local\Microsoft\OneNote\16.0\Backup\Secondo Semestre - Quarto anno" "GDrive Uni:_Backup OneNote/Secondo Semestre - Quarto anno"
@albertopasqualetto
albertopasqualetto / remove reddit translation.user.js
Last active October 6, 2024 13:28
Remove translation parameter from Reddit url userscript
// ==UserScript==
// @name Reddit remove translation
// @namespace albertopasqualetto
// @version 1.0.0
// @description Remove translation parameter from Reddit url
// @author albertopasqualetto
// @match *://sh.reddit.com/*
// @match *://*.reddit.com/*
// @exclude *://new.reddit.com/*
// @exclude *://old.reddit.com/*
@albertopasqualetto
albertopasqualetto / SetPowerSchemeFromHDMI.ps1
Last active July 17, 2024 12:46
Set Power Scheme based on HDMI monitor connected or not, to be used with scheduler
# Define the GUIDs for the power schemes
$HDMIScheme = "10c2d095-ea2f-46c9-8f8f-ce1e5a2d2e4d"
$normalScheme = "381b4222-f694-41f0-9685-ff5bb260df2e"
# Function to set the power scheme
function Set-PowerScheme {
param (
[string]$schemeGuid
)
powercfg -setactive $schemeGuid
@albertopasqualetto
albertopasqualetto / serve_pdf.py
Created May 7, 2024 06:25
Server which serves a pdf file
from flask import Flask, send_file
app = Flask(__name__)
@app.route('/')
def index():
return send_file('main.pdf')
if __name__ == '__main__':
app.run(debug=True)
@albertopasqualetto
albertopasqualetto / wait-for-grid.sh
Created February 16, 2024 15:56
Wait selenium grid until is up
#!/bin/bash
# wait-for-grid.sh
set -e
cmd="$@"
sleep 2
while ! curl -sSL "localhost:4444/wd/hub/status" 2>&1 \
@albertopasqualetto
albertopasqualetto / re-enable dragging shreddit.user.js
Last active February 10, 2024 15:14
Re-enable dragging on shreddit userscript
// ==UserScript==
// @name Re-enable dragging on sh.reddit
// @namespace albertopasqualetto
// @version 1.0.5
// @description Re-enable dragging on sh.reddit instead of embed/share button
// @author albertopasqualetto
// @match *://sh.reddit.com/*
// @match *://*.reddit.com/*
// @exclude *://new.reddit.com/*
// @exclude *://old.reddit.com/*