Skip to content

Instantly share code, notes, and snippets.

View jpetrich's full-sized avatar

Joe Petrich jpetrich

View GitHub Profile
@jpetrich
jpetrich / podcasts_opml.xml
Created July 14, 2023 21:53
Joe's podcasts
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<opml version="1.0">
<head>
<title>Pocket Casts Feeds</title>
</head>
<body>
<outline text="feeds">
<outline type="rss" text="Arena Decklists" xmlUrl="https://feeds.soundcloud.com/users/soundcloud:users:229566966/sounds.rss" />
<outline type="rss" text='"Moment of Zen"' xmlUrl="https://feeds.megaphone.fm/RINTP4155988644" />
<outline type="rss" text="On The Brink with Castle Island" xmlUrl="https://castleisland.libsyn.com/rss" />
public class AnimalInfoViewController : UIViewController {
public var animalToDisplay:Animal!
@IBOutlet weak var animalNameLbl: UILabel!
@IBOutlet weak var animalColorLbl: UILabel!
override public func viewDidLoad() {
super.viewDidLoad()
animalNameLbl.text = animalToDisplay.name
animalColorLbl.text = animalToDisplay.color
func pluralize(forNumber number:Int?) -> String {
if let number = number {
if number == 1 {
return "\(number) mouse"
} else {
return "\(number) mice"
}
}
return "no mice"
}
protocol Pluralizable {
func pluralize(forNumber number:Int?) -> String
}
class Mouse : Pluralizable {
func pluralize(forNumber number:Int?) -> String {
if number! == 1 {
return "\(number!) mouse"
} else {
return "\(number!) mice"
Verifying my Blockstack ID is secured with the address 1qTpNFFFtV5dBKTHUVviMHQgTUfzuTXEe https://explorer.blockstack.org/address/1qTpNFFFtV5dBKTHUVviMHQgTUfzuTXEe
@jpetrich
jpetrich / hvecAssetWriter.swift
Created September 26, 2017 16:05
Setting up an AVAssetWriterInput with HEVC encoding
avAssetWriterInput = AVAssetWriterInput(mediaType: AVMediaType.video, outputSettings: [AVVideoCodecKey:AVVideoCodecType.hevc, AVVideoHeightKey:720, AVVideoWidthKey:1280])
import AVFoundation
import UIKit
protocol FrameExtractorDelegate: class {
func captured(image: UIImage)
}
class FrameExtractor: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate {
private let position = AVCaptureDevice.Position.front
private let quality = AVCaptureSession.Preset.medium
@jpetrich
jpetrich / keybase.md
Created September 18, 2017 20:29
keybase

Keybase proof

I hereby claim:

  • I am jpetrich on github.
  • I am jpetrich (https://keybase.io/jpetrich) on keybase.
  • I have a public key ASBda3hA6FoTLyGFMT1EkbSdiBclCqDykPwbrpZ_9PIuzQo

To claim this, I am signing this object: