Skip to content

Instantly share code, notes, and snippets.

@mjmsmith
mjmsmith / Bundle+TestFlight.swift
Created October 30, 2023 21:11 — forked from lukaskubanek/Bundle+TestFlight.swift
A code snippet for detecting the TestFlight environment for a macOS app at runtime
import Foundation
import Security
extension Bundle {
/// Returns whether the bundle was signed for TestFlight beta distribution by checking
/// the existence of a specific extension (marker OID) on the code signing certificate.
///
/// This routine is inspired by the source code from ProcInfo, the underlying library
/// of the WhatsYourSign code signature checking tool developed by Objective-See. Initially,
@mjmsmith
mjmsmith / InAppPurchaseManager.swift
Created February 21, 2019 11:18 — forked from RenGate/InAppPurchaseManager.swift
Sample implementation of In-App purchase manager class
// MIT License
//
// Copyright (c) 2019 Rostyslav Dovhaliuk
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
#!/usr/bin/env ruby
# vim: set syntax=ruby
flag = false
files = `git diff --cached --name-only --diff-filter=ACM | grep "_spec\.rb$"`.split("\n")
files.each do |file|
results = `git diff --cached #{file} | grep "^\+[^+]" | grep ":focus => true"`.split("\n").map { |r| r.sub(/^\+[\s\t]*/, '') }
if $? == 0
@mjmsmith
mjmsmith / KeychainItemWrapper.h
Created November 30, 2012 20:35 — forked from dhoerl/KeychainItemWrapper.h
KeychainItemWrapper ARCified
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of