Skip to content

Instantly share code, notes, and snippets.

View florianbachmann's full-sized avatar
💭
rock n roll

Flori florianbachmann

💭
rock n roll
View GitHub Profile
desc "Create a new version tag and push a new podspec"
task :release do
require 'cocoapods'
require 'colored'
version = Pod::Specification.from_file(Pathname.pwd + 'MyLib.podspec').version
puts "Releasing version `#{version}'. Is that correct? (y/n)"
if $stdin.gets.strip.downcase == 'y'
sh "git tag -a #{version} -m 'Release #{version}'"
sh "git push --tags"
sh "pod lint"
@jwilling
jwilling / gist:4186817
Last active March 5, 2023 22:01
Lets help improve AppKit.

Is AppKit causing you frustration? Instead of just complaining about it, lets try to make it better by compiling a list of specific problems with AppKit. Leave a comment below, and I'll include it in the list.


##NSView##

  • NSView does not have the ability to set an affine transform (rdar://15608609)
  • Controls that have cells (such as NSTextField) do not respond properly when layer-backed. Take NSButton as an example. When not layer-backed, it will animate properly using the animator proxy. When layer-backed, using the animator proxy breaks focus rings (they jump to destination immediately). Currently, directly manipulating the layer of a cell-based control is not supported (and will lead to a broken interface), but is much needed. (rdar://15608822)

##NSViewController##

  • NSViewController could be more useful. It has -loadView but no other lifecycle methods. (rdar://15608948)
@florianbachmann
florianbachmann / CCamera.m
Created December 1, 2012 12:59
Really simple Objective-C AVFoundation Camera class
//
// CCamera.h
// CCamera
//
// Created by Jonathan Wight on 7/12/12.
// Copyright (c) 2012 Jonathan Wight. All rights reserved.
//
#import <Foundation/Foundation.h>
#
# Refactor.tv Convert
#
# Before running, you will need to install FFMPEG with libvorbis and libvpx (for WebM)
# $ brew install ffmpeg --with-libvorbis --with-libvpx
#
# Now run the following to get started:
# $ ruby convert.rb Episode003-master.mov 003
#
@florianbachmann
florianbachmann / UIView+FrameAdditions.h
Created August 22, 2012 16:21 — forked from nfarina/UIView+FrameAdditions.h
UIView Frame helper getter/setter category methods
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end
@nfarina
nfarina / UIView+FrameAdditions.h
Created August 21, 2012 06:40
UIView Frame helper getter/setter category methods
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end
@florianbachmann
florianbachmann / SNRDiscogsEngine.h
Created August 20, 2012 06:36 — forked from indragiek/SNRDiscogsEngine.h
API wrapper for the Discogs API built on AFNetworking
//
// SNRDiscogsEngine.h
// Sonora
//
// Created by Indragie Karunaratne on 11-11-18.
//
#import <Foundation/Foundation.h>
@interface SNRDiscogsEngine : NSObject
@indragiek
indragiek / SNRRestorationManager.h
Created August 19, 2012 20:16
Simple Cocoa state restoration
//
// SNRRestorationManager.h
// Sonora
//
// Created by Indragie Karunaratne on 2012-08-19.
//
#import <Foundation/Foundation.h>
@protocol SNRRestorableState <NSObject>
#ifdef DEBUG
void pspdf_swizzle(Class c, SEL orig, SEL new) {
Method origMethod = class_getInstanceMethod(c, orig);
Method newMethod = class_getInstanceMethod(c, new);
if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
}else {
method_exchangeImplementations(origMethod, newMethod);
}
@AlanQuatermain
AlanQuatermain / gist:2912081
Created June 11, 2012 19:15
Check whether the iOS Dev Centre is available yet, for 30 minutes
-- Thirty minute timeout
with timeout of 108000 seconds
repeat while true
delay 5
set baseurl to "https://developer.apple.com/devcenter/ios/index.action"
set curlshellcode to "curl " & baseurl
set theshellresult to do shell script curlshellcode
if theshellresult does not contain "maintenance" then