Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am squaresmile on github.
  • I am squaresmile (https://keybase.io/squaresmile) on keybase.
  • I have a public key ASDnDG5vmY7bF-8GwqbLqgbtqkF5tvlVE-cuSJ5TsMXlkQo

To claim this, I am signing this object:

@squaresmile
squaresmile / HorribleSubs.tracker
Created December 9, 2017 12:08
HorribleSubs autodl-irssi .tracker file
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
#!/bin/bash
#probably needed to be run as plex user
export LD_LIBRARY_PATH="/usr/lib/plexmediaserver"
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
arg=$1
rtorrent_tv="/rtorrent/tv/"
union_tv="/union/tv/"
import os
from urllib.parse import quote_plus
from urllib.request import urlopen, Request
PREPEND = "/home/user/rtorrent/downloads/My Music/Anime/"
ORIGINAL_PLAYLIST_LOCATION = PREPEND
PLEX_TOKEN = "plextoken"
SECTION_ID = "30"
SERVER_URL = "localhost:32400"
url = "http://{}/playlists/upload?sectionID={}&path={}&X-Plex-Token={}"
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
import sys
import os, getopt, struct
import imghdr
def get_image_type(imgname, imgdata=None):
imgtype = imghdr.what(imgname, imgdata)
@squaresmile
squaresmile / Discord.css
Last active May 12, 2021 02:28
CSS for PowerCord
::placeholder,
body,
button,
input,
select,
textarea {
font-family: 'Fira Sans', sans-serif;
font-weight: 300;
}
@squaresmile
squaresmile / hide_reddit_sidebar
Created April 18, 2020 00:45
Hide Reddit Sidebar Userstyles
@-moz-document domain("reddit.com") {
@namespace url(http://www.w3.org/1999/xhtml);
/* To change the maximum size of the window where the sidebar hides itself
change max-width */
@media (max-width: 1500px) {
.side:not(:hover){
/* You can change the width of the sidebar when hidden */
width: 30px ;
height: 100%;
display: block;
@squaresmile
squaresmile / DumpAZW6_py3.py
Created April 21, 2020 00:57
Dump images in Kindle's AZW6 (.azw.res) file (Python3 version of this script: https://www.mobileread.com/forums/showpost.php?p=3114050&postcount=1145)
import argparse
import imghdr
import os
import struct
def get_image_type(imgname, imgdata=None):
imgtype = imghdr.what(imgname, imgdata)
# horrible hack since imghdr detects jxr/wdp as tiffs
@squaresmile
squaresmile / kazemai.py
Created May 20, 2020 02:20
A small script to extract fgo master data from kazemai
import lzstring
import requests
KAZEMAI_DATA = "https://kazemai.github.io/fgo-vz/common/js/master.js"
print("Downloading master.js")
r = requests.get(KAZEMAI_DATA)
master_data = r.text.splitlines()[0][65:-4]
with open("master.txt", "w", encoding="utf-8") as fp:
fp.write(master_data)
#!/data/data/com.termux/files/usr/bin/env python
import platform
from pathlib import Path
import httpx
NAME = "Cereal"
BASE_PATH = "/data/data/com.termux/files/home/storage/pictures/"
TO_BE_UPLOADED_FOLDER = "Screenshots"