Skip to content

Instantly share code, notes, and snippets.

View macguru's full-sized avatar

Max Seelemann macguru

View GitHub Profile
@lukaskubanek
lukaskubanek / Bundle+TestFlight.swift
Last active November 19, 2026 10:24
A code snippet for detecting the TestFlight environment for a macOS app at runtime
/// MIT License
///
/// Copyright (c) 2021 Lukas Kubanek, Structured Path GmbH
///
/// 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:
@morizotter
morizotter / UIImage+Trim.m
Created September 29, 2015 18:08 — forked from spinogrizz/UIImage+Trim.m
Trim transparent pixels around UIImage
- (UIImage *) imageByTrimmingTransparentPixels {
int rows = self.size.height;
int cols = self.size.width;
int bytesPerRow = cols*sizeof(uint8_t);
if ( rows < 2 || cols < 2 ) {
return self;
}
//allocate array to hold alpha channel