Skip to content

Instantly share code, notes, and snippets.

View Ophuscado's full-sized avatar

Ophuscado Ophuscado

View GitHub Profile
@sonofsparda757
sonofsparda757 / torrent-file-size.py
Created December 7, 2022 22:35
get sizes of all torrents in a given directory
import os
import sys
import bencodepy
import humanize
import argparse
def total_size_files_torrent(file_name):
try:
parsed = bencodepy.decode_from_file(file_name)
except bencodepy.exceptions.DecodingError as e:
@rojnwa
rojnwa / fix_codium.py
Created August 2, 2020 00:50
Reverts to the old marketplace in VSCodium
import json
file_path = "/usr/share/vscodium-bin/resources/app/product.json"
with open(file_path, "r") as f:
config = json.load(f)
config["extensionsGallery"]["serviceUrl"] = "https://marketplace.visualstudio.com/_apis/public/gallery"
config["extensionsGallery"]["cacheUrl"] = "https://vscode.blob.core.windows.net/gallery/index"
config["extensionsGallery"]["itemUrl"] = "https://marketplace.visualstudio.com/items"
@Auke1810
Auke1810 / wpa-clean-header.php
Last active February 25, 2025 22:05
create a clean wordpress header and remove unnecessary clutter.
<?php
/*
Plugin Name: wordpress assist clean header
Plugin URI: http://www.wordpressassist.nl/
Description: Remove shortlink hook
Version: 1.0
Author: AukeJomm
Author URI: http://www.aukejongbloed.nl
*/
@tylermakin
tylermakin / Multipart MIME Email.md
Last active December 17, 2024 13:32
Multipart MIME Email Guide

Multipart MIME Email Guide

This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.

// Example Multipart Email:
From: [email protected]
To: [email protected]
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"
@neroanelli
neroanelli / shadowsocks
Last active April 12, 2021 21:11
shadowsocks for tomato firmware.
#!/bin/sh
BIN=shadowsocks
RUN_D=/var/run
ss_local_PID_FILE=$RUN_D/ss-local.pid
ss_redir_PID_FILE=$RUN_D/ss-redir.pid
ipset_blacklist="/opt/etc/ipset/blacklist"
ipset_whitelist="/opt/etc/ipset/whitelist"
file="/opt/etc/config/shadowsocks"
COND=$1
@andphe
andphe / gist:3232343
Created August 2, 2012 01:41
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'