Skip to content

Instantly share code, notes, and snippets.

View steipete's full-sized avatar

Peter Steinberger steipete

View GitHub Profile
@Abizern
Abizern / git versioner
Created October 12, 2009 23:05
Xcode build script that adds the commit sha to the CFBundleVersion
#!/usr/bin/env ruby
# Xcode auto-versioning script for Subversion by Axel Andersson
# Updated for git by Marcus S. Zarra and Matt Long
# Converted to ruby by Abizer Nasir
# Appends the git sha to the version number set in Xcode.
# see http://www.stompy.org/2008/08/14/xcode-and-git-another-build-script/ for more details
# These are the common places where git is installed.
# Change this if your path isn't here
@andreyvit
andreyvit / UIPickerView_SelectionBarLabelSupport.h
Created October 23, 2009 01:08
UIPickerView category that allows to easily recreate the look and feel of UIDatePicker labeled components (HIG calls them “translucent bar labels”)
// UIPickerView_SelectionBarLabelSupport.h
//
// This file adds a new API to UIPickerView that allows to easily recreate
// the look and feel of UIDatePicker labeled components.
//
// Copyright (c) 2009, Andrey Tarantsov <[email protected]>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
@0xced
0xced / README.md
Created April 5, 2010 22:31
ABGetMe implementation for iOS
//
// KSDIdlingWindow.h
//
// Created by Brian King on 4/13/10.
// Copyright 2010 King Software Designs. All rights reserved.
//
// Based off:
// http://stackoverflow.com/questions/273450/iphone-detecting-user-inactivity-idle-time-since-last-screen-touch
//
@0xced
0xced / gist:372236
Created April 20, 2010 09:34
Automatically show keyboard in MFMailComposeViewController
@try
{
id textView = [mailComposeViewController valueForKeyPath:@"internal.mailComposeView.textView"];
if ([textView respondsToSelector:@selector(becomeFirstResponder)])
[textView becomeFirstResponder];
}
@catch (NSException *e) {}
@soffes
soffes / install.markdown
Last active July 3, 2024 03:04
New computer setup

New Machine

Updated this for the first time in awhile in late 2020.

System Preferences

  • Enable iCloud
  • Disable iCloud mail
  • Display to medium
  • Turn up trackpad speed
@fpillet
fpillet / NSManagedObjectContext+FP.m
Created December 20, 2010 11:30
Core data helpers to log errors and changes to a context (using NSLogger)
- (void)logDetailedError:(NSError *)error from:(id)caller selector:(SEL)selector
{
#if DEBUG
LogMessage(@"coredata", 0, @"*** CORE DATA ERROR: a data store operation failed");
LogMessage(@"coredata", 0, @"*** Caller was: %@ %p %@", [caller class], caller, NSStringFromSelector(selector));
LogMessage(@"coredata", 0, @"*** Error: %@", [error localizedDescription]);
NSArray* detailedErrors = [[error userInfo] objectForKey:NSDetailedErrorsKey];
if ([detailedErrors count] > 0)
{
for(NSError* detailedError in detailedErrors)
@AlanQuatermain
AlanQuatermain / gist:830865
Created February 17, 2011 02:59
All the external private APIs referenced by iBooks.app version 1.2.1
From PrivateFrameworks/Bom.framework:
U _BOMCopierCopyWithOptions
U _BOMCopierCountFilesInArchive
U _BOMCopierFree
U _BOMCopierNew
U _BOMCopierSetCopyFileFinishedHandler
U _BOMCopierSetCopyFileStartedHandler
U _BOMCopierSetCopyFileUpdateHandler
U _BOMCopierSetFatalErrorHandler
U _BOMCopierSetFatalFileErrorHandler
@evadne
evadne / uiwebview_fullscreen_media_playback_with_autororation_workaround.m
Created February 22, 2011 14:31
UIWebView Full-Screen Movie Post-Autorotation-Dismissal Layout Fix
@implementation IRWebViewController (irFullscreenMediaPlaybackAutorotationLayoutFix)
- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
// There is a bug, where launching a media player from the web view, fullscreening it, then rotating the device, and tapping on the media to see the timelime, causes the layout to go all berserk. This is a hack to combat that.
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
if ((!self.view.superview) || (self.parentViewController.modalViewController != self) || (self.modalPresentationStyle != UIModalPresentationFullScreen)) {
@MSch
MSch / xcode_auto_versioning.rb
Created May 24, 2011 19:56 — forked from bgreenlee/xcode_auto_versioning.rb
Xcode Auto-Versioning: Updates your Info.plist's CFBundleVersion with the current git tag and/or sha.
# Xcode Auto-Versioning
#
# Updates your Info.plist's CFBundleVersion with the current git tag and/or sha.
#
# based on https://github.com/elliottcable/xcode-git-versioner
#
# Usage:
# 1. Right-click the target you want to add the versioning phase to (usually the target that builds your app)
# 2. Select: Add -> New Build Phase -> New Run Script Build Phase
# 3. Specify /usr/bin/env ruby as the shell for the script