Skip to content

Instantly share code, notes, and snippets.

@mmontone
mmontone / mongo-rest.py
Created March 5, 2019 01:58
Simple MongoDB rest API with Python
from flask import Flask
from flask import jsonify
from flask import request
from flask_pymongo import PyMongo
from flask.json import JSONEncoder
from bson.objectid import ObjectId
from flask_cors import CORS
class CustomJSONEncoder(JSONEncoder):
@wkliwk
wkliwk / btt.sh
Last active March 24, 2025 22:10
BTT reset trial time
# BetterTouchTool reset trial time
# ** All preference will reset
echo "remove ~/Library/Preferences/com.hegenberg.BetterTouchTool.plist"
rm -rf ~/Library/Preferences/com.hegenberg.BetterTouchTool.plist
echo "Done"
echo "remove ~/Library/Application\ Support/BetterTouchTool/"
rm -rf ~/Library/Application\ Support/BetterTouchTool/
echo "Done"
# frozen_string_literal: true
describe Calendar::Icalendar do
subject :ical do
Calendar::Icalendar.new(account,
start: start,
stop: stop,
filter: filter&.params || {},
filter_name: filter&.name).get_items.to_ical
end
@JonnyWong16
JonnyWong16 / update_plex_movie_ratings.py
Last active November 15, 2024 19:29
Update Plex movie ratings from IMDB or Rotten Tomatoes
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
#
# Plex movie ratings script by /u/SwiftPanda16
#
# *** Use at your own risk! ***
# *** I am not responsible for damages to your Plex server or libraries. ***
#
#------------------------------------------------------------------------------
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active November 14, 2024 21:20
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@JonnyWong16
JonnyWong16 / update_all_metadata.py
Last active March 28, 2025 12:24
Updates all metadata in the Tautulli database after moving Plex libraries.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Updates all metadata in the Tautulli database after moving Plex libraries.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests
from plexapi.server import PlexServer
import requests
@itrion
itrion / echo_google_spreadsheet
Created July 12, 2017 14:41
calling google spreadsheet api using ruby client lib
#!/usr/bin/env ruby
SECRET_JSON_VARIABLE = 'GOOGLE_APPLICATION_CREDENTIALS'.freeze
raise 'please define an env variable GOOGLE_APPLICATION_CREDENTIALS pointing to your client_secrets.json' unless ENV[SECRET_JSON_VARIABLE]
raise 'please provide the spreadsheet id' if ARGV[0].nil?
require 'google/clients/spreadsheet_client'
require 'google/models/spreadsheet'
spreadsheet_id = ARGV[0]
spreadsheet = Google::Models::Spreadsheet.new(spreadsheet_id: spreadsheet_id)
@JonnyWong16
JonnyWong16 / add_label_recently_added.py
Last active December 4, 2024 23:47
Automatically add a label to recently added items in your Plex library
Updated script link:
https://github.com/blacktwin/JBOPS/blob/master/utility/add_label_recently_added.py
@blacktwin
blacktwin / notify_added_custom.py
Last active November 28, 2024 01:43
Send an email with what was added to Plex in the past week using PlexPy. Email includes title (TV: Show Name: Episode Name; Movie: Movie Title), time added, image, and summary.
"""
Send an email with what was added to Plex in the past week using PlexPy.
Email includes title (TV: Show Name: Episode Name; Movie: Movie Title), time added, image, and summary.
Uses:
notify_added_lastweek.py -t poster -d 1 -u all -i user1 user2 -s 250 100
# email all users expect user1 & user2 what was added in the last day using posters that are 250x100
notify_added_lastweek.py -t poster -d 7 -u all
# email all users what was added in the last 7 days(week) using posters that are default sized