Skip to content

Instantly share code, notes, and snippets.

View matthewhochler's full-sized avatar

Matt H matthewhochler

View GitHub Profile
@matthewhochler
matthewhochler / merger.py
Created July 24, 2018 15:49 — forked from ericmjl/merger.py
A Python script for merging PDF files together.
"""
Author: Eric J. Ma
Purpose: To merge PDFs together in an automated fashion.
"""
import os
from PyPDF2 import PdfFileReader, PdfFileMerger
@matthewhochler
matthewhochler / itunesicon.rb
Created December 13, 2017 18:06 — forked from ttscoff/itunesicon.rb
Retrieve a 512 x 512px icon for an iOS app
#!/usr/bin/ruby
# encoding: utf-8
#
# Updated 2017-10-25:
# - Defaults to large size (512)
# - If ImageMagick is installed:
# - rounds the corners (copped from @bradjasper, https://github.com/bradjasper/Download-iTunes-Icon/blob/master/itunesicon.rb)
# - replace original with rounded version, converting to png if necessary
#
# Retrieve an iOS app icon at the highest available resolution
@matthewhochler
matthewhochler / sync_playlists_to_users.py
Created October 22, 2017 21:32 — forked from JonnyWong16/sync_playlists_to_users.py
Sync Plex playlists to shared users.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests, xmltodict
import requests
import xmltodict
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
app=$HOME/apps/nzbget-loop
cat > $app << EOF
#!/usr/bin/env bash
export TERM="xterm"
until ~/apps/nzbget/nzbget -s; do
echo "NZBGet crashed. Respawning.." >&2
sleep 1
done
EOF
chmod +x $app
@matthewhochler
matthewhochler / a-new-mac-setup.md
Created March 29, 2017 16:36 — forked from maxfenton/a-new-mac-setup.md
System setup stuff for a new mac

New computer setup

  • a/o 2016-05-21 *

--

Format the drive

  1. Restart with Cmd-R or Cmd-D
  2. Erase drive / 3x if second-hand
  3. Reinstall MacOS
Public Function getRowNum(worksheetName, rowName, headerColumnNum) As Integer
Set worksheet = Worksheets(worksheetName)
rowNum = 0
lastRowNum = worksheet.Cells(worksheet.Rows.Count, headerColumnNum).End(xlup).Row
For rowLoopNum = 1 To lastRowNum
If worksheet.Cells(rowLoopNum, headerColumnNum).Value = rowName Then
rowNum = rowLoopNum
End If
Next rowLoopNum
getRowNum = rowNum
@matthewhochler
matthewhochler / macos_setup.markdown
Last active December 30, 2021 15:07
New macOS Setup

Setup new MacOS installation

Homebrew

brew tap homebrew/dupes
brew update
brew upgrade
brew install \
  "awscli" \
  "bash" \
@matthewhochler
matthewhochler / sync-repo.sh
Last active January 4, 2017 20:41
Sync RapidSOS repo with dev box
# sync-repo
# Dependencies:
# rsync (https://rsync.samba.org)
############################## BEGIN APP CONFIG ###############################
# You should only have to modify this section
# All paths are relative to your home
# Name of project to sync (used for notifications)
@matthewhochler
matthewhochler / flask_profiler.py
Created August 3, 2016 18:49 — forked from madhukar93/flask_profiler.py
A profiler for Flask apps
"""
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the profile or cProfile
module to do the profiling and writes the stats to the stream provided
To use, run `flask_profiler.py` instead of `app.py`
see: http://werkzeug.pocoo.org/docs/0.9/contrib/profiler/
and: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling
"""