Skip to content

Instantly share code, notes, and snippets.

View gazpachoking's full-sized avatar

Chase Sterling gazpachoking

View GitHub Profile
@gazpachoking
gazpachoking / logging_to_loguru.py
Last active December 12, 2019 21:05
Converts files from stdlib to loguru logging
import ast
import pathlib
import re
import subprocess
import sys
import astor
import pyupgrade
@gazpachoking
gazpachoking / config.yml
Created October 11, 2018 02:00
simple series from trakt
tasks:
get_my_shows:
rss: http://my.rss.feed
configure_series:
from:
trakt_list:
account: myaccount
list: My TV Shows
type: shows
deluge: yes # or transmission or download plugin, or whatever
@gazpachoking
gazpachoking / winenv.fish
Last active May 26, 2018 03:37
Allows easy use of Windows environment variables from within Windows subsystem for Linux (using fish shell.) Automatically translates variables that look like Windows paths to WSL paths.
function winenv --description "Echos windows environment variables from WSL."
for arg in $argv
set result (cmd.exe /c echo "%"$arg"%" | string trim)
if echo $result | grep -i "^[a-z]:\\\\" > /dev/null
for r in (echo $result|string split ";")
echo (wslpath $r)
end
else
echo $result
end
tasks:
episode_rss:
rss: some episodes
configure_series:
entry_list: following series
download:yes
archive: episodes
series to consider:
rss: some episodes
accept_all: yes
tasks:
get_movies:
rss: whatever
imdb:
score: 7.0
if:
- quality < '1080p':
list_add:
- movie_list: upgrades
upgrade_movies:
@gazpachoking
gazpachoking / config.yml
Last active September 18, 2017 17:28
Movie quality upgrade, and timeframe using FlexGet movie_list
tasks:
# This is where movies we want get added to lists
fill_list:
# Some input plugin here, or just --inject to this task
accept_all: yes
seen: local
list_add:
- movie_list: high qual
- movie_list: low qual
get_high_qual:

Changelog

This is the fg changelog.

1.2.472 (2016-03-04)

all commits

@gazpachoking
gazpachoking / imdblistedit.py
Last active February 23, 2016 04:10
Edit imdb lists programattically
import requests
from bs4 import BeautifulSoup
sess = requests.Session()
r = sess.get('https://www.imdb.com/ap/signin?openid.return_to=https%3A%2F%2Fwww.imdb.com%2Fap-signin-handler&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.assoc_handle=imdb_mobile_us&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0')
soup = BeautifulSoup(r.content, 'html5lib')
inputs = soup.select('form#ap_signin_form input')
data = dict((i.get('name'), i.get('value')) for i in inputs if i.get('name'))
data['email'] = 'your@email.com'
data['password'] = 'aoeu'
@gazpachoking
gazpachoking / trac2realms.py
Last active March 4, 2016 05:55
This was used to convent the FlexGet trac wiki to markdown suitable for the realms wiki engine. Git repo was prepared with https://github.com/hinnerk/Trac2Gollum but with the gollum markdown conversion stripped out and pathseps left in. Based on https://gist.github.com/gazpachoking/9540849 which was based on https://gist.github.com/sgk/1286682
"""Usage: trac2down <trac wiki dump path>"""
from __future__ import unicode_literals
import codecs
import os
import re
import sys
import path
def convert_wiki_link(link):
@gazpachoking
gazpachoking / 0_reuse_code.js
Last active August 29, 2015 14:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console