Skip to content

Instantly share code, notes, and snippets.

View ch0ppy35's full-sized avatar

Mike Miller ch0ppy35

View GitHub Profile
@ch0ppy35
ch0ppy35 / psycopg2_boiler.py
Created September 8, 2020 06:47
psycopg2 boilerplate class
import psycopg2
## Make the db stuff easy
class MyDatabase:
def __init__(self, host="127.0.0.1", db="database_name", user="user_name"):
self.conn = psycopg2.connect(host=host, database=db, user=user)
self.cur = self.conn.cursor()
def query(self, query):
self.cur.execute(query)
@ch0ppy35
ch0ppy35 / flac2mp3.sh
Last active May 2, 2022 01:47
Use this to convert FLAC from BandCamp or wherever - Simple and Works
#/bin/bash
for i in *.flac;
do name=`echo "$i" | cut -d'.' -f1`
echo "Converting $name into an mp3!"
ffmpeg -i "$i" -ab 320k -map_metadata 0 -id3v2_version 3 "${name}.mp3"
done
echo "All done!"