Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt H matthewhochler

View GitHub Profile
@matthewhochler
matthewhochler / itunesicon.rb
Created Dec 13, 2017 — forked from ttscoff/itunesicon.rb
Retrieve a 512 x 512px icon for an iOS app
View itunesicon.rb
#!/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
View sync_playlists_to_users.py
#!/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
View ShortcutGenerator.py
# 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
View nzbget-loop.sh
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 Mar 29, 2017 — forked from maxfenton/a-new-mac-setup.md
System setup stuff for a new mac
View a-new-mac-setup.md

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
View fancy_calvin.vb
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
View macos_setup.markdown

Setup new MacOS installation

Homebrew

brew tap homebrew/dupes
brew update
brew upgrade
brew install \
  "awscli" \
  "bash" \
@matthewhochler
matthewhochler / sync-repo.sh
Last active Jan 4, 2017
Sync RapidSOS repo with dev box
View sync-repo.sh
# 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)
View flask_profiler.py
"""
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
"""
@matthewhochler
matthewhochler / msnbc-dl.py
Last active Oct 27, 2016
Download MSNBC episodes - Deprecated
View msnbc-dl.py
#!/usr/bin/env python
import logging
import multiprocessing
import os
import urllib2
import subprocess
import sys
import time
from xml.etree import ElementTree