Skip to content

Instantly share code, notes, and snippets.

View robmcelhinney's full-sized avatar

Robert McElhinney robmcelhinney

View GitHub Profile
@robmcelhinney
robmcelhinney / clipboard_transmission.py
Last active August 17, 2025 03:19
clipboard to transmission
from transmission_rpc import Client
import time
import pyperclip
import re
import os
tc = Client(host=os.getenv('T_HOST'),
port=os.getenv('T_PORT'),
username=os.getenv('T_USERNAME'),
password=os.getenv('T_PASSWORD'))
@robmcelhinney
robmcelhinney / TickerTok.py
Last active May 6, 2022 18:22
Command line stock tracker using yahoo finance api
#!/usr/bin/env python
from rich.console import Console
from rich.table import Table
from rich import box
import sys, argparse, logging
import requests
import math
import time
import yaml
@robmcelhinney
robmcelhinney / epub-to-txt.py
Last active May 8, 2025 06:33
Convert epub to a .txt file
import os
from pathlib import Path
import ebooklib
from ebooklib import epub
from bs4 import BeautifulSoup
import argparse
# https://medium.com/@zazazakaria18/turn-your-ebook-to-text-with-python-in-seconds-2a1e42804913
blocklist = ['[document]', 'noscript', 'header', 'html', 'meta', 'head', 'input', 'script']
@robmcelhinney
robmcelhinney / morseCode.py
Created June 1, 2019 00:36
Simple python program to convert text to morse code and play audio Since it is using an inbuilt windows module to output the audio, this only works running a Windows OS.
#!/usr/bin/python3
import time
import winsound
freq = 550 # Hz
dotLength = 60 # milliseconds
dashLength = dotLength * 3
pauseWords = dotLength * 7
alphaToMorse = {'a': ".-", 'b': "-...", 'c': "-.-.", 'd': "-..", 'e': ".",
@robmcelhinney
robmcelhinney / RomanNumeralCalculator.java
Created June 1, 2019 00:33
Command line Roman Numeral Converter created in Java. It is an interview question I had been asked so decided to put my attempt online for anybody looking for help. Only works from 1 - 3,999 as there is no number for 5,000 or 0 in Roman Numerals.
import java.util.*;
public class RomanNumeralCalculator {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
while(true) {
System.out.print("Enter a number: ");
String input = reader.nextLine();
if(input.isEmpty()) {
System.out.println("Goodbye.");