Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt H matthewhochler

View GitHub Profile
@matthewhochler
matthewhochler / README.md
Created Apr 26, 2021 — forked from daniel-j/README.md
Converts images in a directory to a comic/manga EPUB3 ebook. Can be used to convert extracted CBZ/CBR to EPUB3.
View README.md

images2epub.py

Converts a directory of images into a modern EPUB3 ebook. Use a tool to extract CBZ/CBR/CBT files and then run this program to generate a nice fixed-layout EPUB ebook of it. You can optionally set the reading direction to right-to-left (e.g. for manga). For Kobo ereaders, use the file extension .kepub.epub to get the modern reader and correct reading direction.

Usage

Install dependencies with pip install imagesize lxml

@matthewhochler
matthewhochler / uninstall-razer-synapse.sh
Created Jan 8, 2021 — forked from timotgl/uninstall-razer-synapse.sh
How to fully uninstall Razer Synapse 2 on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) without using Razer's official uninstall tool
View uninstall-razer-synapse.sh
# How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 )
# on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra)
# without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Edited with additional steps for later OS X versions,
# contributed by commenters on this gist.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater
View keybase.md

Keybase proof

I hereby claim:

  • I am matthewhochler on github.
  • I am mattyhochs (https://keybase.io/mattyhochs) on keybase.
  • I have a public key ASCIeB6GtEN1EEn8ugJOLnkIQDcOEbnCxlPig8lbGQJYfQo

To claim this, I am signing this object:

@matthewhochler
matthewhochler / readme.md
Created May 1, 2019 — forked from maxogden/readme.md
Video stabilization using VidStab and FFMPEG (Mac OS X)
View readme.md

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Here's an example video I made

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
@matthewhochler
matthewhochler / ffmpeg.md
Created May 1, 2019 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files
View ffmpeg.md

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@matthewhochler
matthewhochler / heroku_pg_db_reset.md
Created Apr 10, 2019 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?
View heroku_pg_db_reset.md

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@matthewhochler
matthewhochler / heroku_pg_db_reset.md
Created Apr 10, 2019 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?
View heroku_pg_db_reset.md

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

View gist:9d80e8c0f74bae238e6f05593bc85006
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from

These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
@matthewhochler
matthewhochler / Aurora-Profiles
Created Oct 2, 2018 — forked from throughnothing/Aurora-Profiles
Applescript to run multiple firefox instances with the profilemanager
View Aurora-Profiles
do shell script "open -n -a aurora --args -profilemanager"
@matthewhochler
matthewhochler / merger.py
Created Jul 24, 2018 — forked from ericmjl/merger.py
A Python script for merging PDF files together.
View merger.py
"""
Author: Eric J. Ma
Purpose: To merge PDFs together in an automated fashion.
"""
import os
from PyPDF2 import PdfFileReader, PdfFileMerger