Skip to content

Instantly share code, notes, and snippets.

View Fitzy1293's full-sized avatar

Fitzy1293

View GitHub Profile
@Fitzy1293
Fitzy1293 / texcomp
Last active September 11, 2020 04:46
#!/bin/bash
while :
do
if [ $1 == '-bib' ]
then
lualatex -interaction nonstopmode $2 > /dev/null
bibtex $2
lualatex -interaction nonstopmode $2 > /dev/null
#!/usr/bin/python3
'''
Converts files from the notetaking program I use to pdfs for sharing.
'''
import os, sys
import cairosvg
import img2pdf
from PIL import Image
#!/bin/env python3
import cv2
import os
vidcap = cv2.VideoCapture('norm.mp4')
success, image = vidcap.read()
dir = os.getcwd()
count = 0
<!doctype html>
<html>
<body style="background:rgba(255, 180, 108, 0.78)">
<div class="beginning" style="font-family:arial">
<svg width="1400" height="900" xmlns="http://www.w3.org/2000/svg" version="1.1">
#!/bin/sh
green='\e[0;32m'
cyan='\e[0;36m'
white='\e[0m'
blue='\e[1;34m'
echo "${cyan}Enter a package from pypi:${green}"
read package
@Fitzy1293
Fitzy1293 / pdfbib-citer
Last active August 29, 2021 06:22
Shell script to get BibTeX citations from PDF. For use in .bib files that you use to do references in LaTeX.
#!/bin/env bash
#https://gist.github.com/Fitzy1293/5c6019479456054b267764354df2a899
if [ $# -eq 0 ]; then
echo "Enter a pdf to create a bibtex citation for"
ls *.pdf | tr ' ' '\n'
exit 1
fi
'''
Program to solve differentiable functions of one variable.
LHS defines what variable it's a function of.
No format checking right now.
Example of line separated file, one equation per line.
c(x) = r * (cos(x) + sqrt(-1)*sin(x))
a(t) = 1/2 * g * t ** 2
f(x) = sin(x**2) * x^2
@Fitzy1293
Fitzy1293 / lists.py
Last active July 19, 2021 05:53
don't append to lists like this please
def append_10(the_list=None):
if the_list is None:
the_list = []
the_list.append(10)
return the_list
original_list = [4, 5]
print('unused list in top level scope')
print('\toriginal_list: ', original_list, sep='\t')
import urllib.parse
import urllib.request
BASE_URL = 'http://libgen.rs/search.php'
def libgen_post_request(query, pagenumber):
url_encoded_query = urllib.parse.urlencode({'req':query})
extra_params = '&open=0&res=25&view=simple&phrase=1&column=def&res=100'
libgen_current_page = f'&page={pagenumber}'
full_url = f'{BASE_URL}?{url_encoded_query}{extra_params}{libgen_current_page}'
@Fitzy1293
Fitzy1293 / main.py
Created August 14, 2021 18:48
Calibre script
import subprocess
import os
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-c,', '--convert', dest='CONVERT_TYPE', help='filetype to convert to')
ARGS = parser.parse_args()
def convert_to_other_ebook_format(input_ebook, output_format):