Skip to content

Instantly share code, notes, and snippets.

View ptb's full-sized avatar

Peter T Bosse II ptb

  • 13:59 (UTC -04:00)
View GitHub Profile
@ptb
ptb / .zshrc
Last active September 5, 2017 13:19
#!/bin/sh
#-- Exports ----------------------------------------------------
export \
HISTFILE="${ZDOTDIR:-$HOME}/.zhistory" \
HISTSIZE=50000 \
SAVEHIST=50000
#-- Changing Directories ---------------------------------------
init_sudo
init_cache
init_no_sleep
init_hostname
init_perms
init_devtools
init_updates
init_mas_save
install_paths
install_brew
#!/bin/sh
function ask() {
function y() { printf " \e[3;32m%s\e[0m\n" "yes"; }
function n() { printf " \e[3;31m%s\e[0m\n" "no"; }
printf "\e[1;34m%s\e[0m? \e[1;33m%s\e[0m " "${1}" "(y/n)"
for i in {1..3}; do
read -s -n 1 -t 2
case "$REPLY" in
@ptb
ptb / ffmpeg-3.1.3-defaultstreams.patch
Last active September 19, 2016 01:16
Patch for FFMPEG to fix broken channel disabling behavior
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5208,26 +5208,46 @@ static void enable_tracks(AVFormatContext *s)
st->codecpar->codec_type >= AVMEDIA_TYPE_NB)
continue;
+ // note the first stream number for each type
if (first[st->codecpar->codec_type] < 0)
first[st->codecpar->codec_type] = i;
@ptb
ptb / macos-sierra-commands.sh
Created July 6, 2016 10:46 — forked from ProfFrnswrth/macos-sierra-commands.sh
Updating to macOS Sierra Developer Preview 1 directly from Apple
## based on https://github.com/lioonline/OS-X-El-Capitan
## pkg file link - http://osxapps.itunes.apple.com/apple-assets-us-std-000001/Purple30/v4/cc/62/24/cc62243b-7ed7-74cd-d47e-374bc470ecdf/diu414781394017735583.pkg
# !!IMPORTANT!! Run this from folder where you have downloaded or copied diu414781394017735583.pkg file
#create a tmp folder
mkdir sierraRoot && cd sierraRoot
#create a folder structure to match apple server
sudo mkdir -p ./apple-assets-us-std-000001/Purple30/v4/cc/62/24/cc62243b-7ed7-74cd-d47e-374bc470ecdf/
@ptb
ptb / pem2plex.py
Created June 10, 2016 21:22 — forked from lokulin/pem2plex.py
Convert the x509 certificate to certificate.p12 that Plex requires.
#!/usr/bin/python
import sys
import hashlib
from OpenSSL.crypto import *
def main():
if(len(sys.argv) != 4):
print sys.argv[0] + " /path/to/ssl.crt /path/to/ssl.key ProcessedMachineIdentifier"
sys.exit(0)
<route aria-current="{ show ? 'page' : null }" class="{ in: animIn, out: animOut }" if="{ show || animIn || animOut }">
<!--
# route tag
This is a part of ikki project
http://cognitom.github.io/ikki/
-->
<yield />
<script>
@ptb
ptb / UITableViewCellAccessoryDetailDisclosureButton.css.markdown
Created April 3, 2016 21:04
UITableViewCellAccessoryDetailDisclosureButton.css

UITableViewCellAccessoryDetailDisclosureButton.css

The cell has an accessory control that is a blue button with a chevron image as content. It is intended for configuration purposes. The control tracks touches.

http://bit.ly/Yi1pQ7

A Pen by Peter T Bosse II on CodePen.

License.

p
font-size: 24px
--- a/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/artifact.rb 2016-01-04 15:06:43.000000000 -0500
+++ b/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/artifact.rb 2016-01-04 16:29:20.000000000 -0500
@@ -4,6 +4,7 @@
require 'hbc/artifact/uninstall_base'
require 'hbc/artifact/symlinked'
require 'hbc/artifact/hardlinked'
+require 'hbc/artifact/moved'
require 'hbc/artifact/app'
require 'hbc/artifact/artifact' # generic 'artifact' stanza