Skip to content

Instantly share code, notes, and snippets.

View PathToLife's full-sized avatar
📖
Let's go together, to infinity, and beyond.

PathToLife PathToLife

📖
Let's go together, to infinity, and beyond.
  • Sean X
  • NZ
View GitHub Profile
@PathToLife
PathToLife / developer-console.js
Created February 22, 2024 23:59
Print Github Markdown File Page
document.body.appendChild(document.querySelector(".markdown-body"));document.querySelector("header").remove();document.querySelector(".application-main").remove();document.querySelector("footer").remove();window.print();
@PathToLife
PathToLife / nzh-nologin.js
Created August 20, 2021 15:44
nzh-nologin
// Run individually in console to not trigger redirect
$('.article-offer').style.display='none';
$$('.GIZOHyucobDOBz').forEach(e => e.style.display='block');
$$('.GIZOHyucobDOBz').forEach(e => e.style.opacity='1');
$$('.GIZOHyucobDOBz').forEach(e => e.style.color='black');
@PathToLife
PathToLife / cleansrt.py
Created March 9, 2021 14:05
reformats .srt file to be readable by IINA
import os
from typing import List
import shutil
dirs = os.listdir(os.getcwd())
srtpaths = [x for x in dirs if x[-4:] == '.srt']
class SrtLine:
num: int
timeStr: str
@PathToLife
PathToLife / clean_names.py
Last active January 9, 2021 16:57
cleans anime file and folder names - python 3
import os
# https://gist.github.com/PathToLife/0669d9fe89a70d43f52edcccc0531c03
# cleans anime file and folder names
# OLD: [Something] Some Anime [1080p].mkv
# NEW: Some Anime [1080p].mkv
def clean_name(name):
name = name.strip()
@PathToLife
PathToLife / threaded_downloader.py
Created April 17, 2020 18:14
Simple Python3 Multithreaded Downloading with auto directory creation and incomplete download file marking. Multiprocessing pools
import os
import requests
from time import time as timer
from typing import List, Tuple
from multiprocessing.pool import ThreadPool
import shutil
def download_file(entry: Tuple[str, str]):
path, uri = entry
@PathToLife
PathToLife / nyt-nologin.js
Last active January 7, 2021 12:00
nyt-nologin
// paste in chrome devtools console
$('.css-mcm29f').style.overflowY = 'scroll';
$('.css-1bd8bfl').style.display = 'none';
$('#gateway-content').style.display = 'none';
@PathToLife
PathToLife / keybase.md
Created October 14, 2019 00:30
keybase.md

Keybase proof

I hereby claim:

  • I am pathtolife on github.
  • I am pathtolife (https://keybase.io/pathtolife) on keybase.
  • I have a public key ASBsiNP1uZTiTFgBRHoHJ6uJ2Jw-y_xWahcJUrtTV--Dawo

To claim this, I am signing this object:

@PathToLife
PathToLife / fileserver.js
Last active June 7, 2019 10:11
simple local home static file / media server
/*
* Run these commands in the directory that will be exposed to the network:
* $optional: wget "http://gist raw of this js file"
* $npm i serve-static serve-index finalhandler ip
* $node fileserver.js
*/
var http = require('http'),
fs = require('fs'),
util = require('util'),
url = require('url'),