Skip to content

Instantly share code, notes, and snippets.

View OliverLetterer's full-sized avatar
👨‍💻
Happy coding :)

Oliver Letterer OliverLetterer

👨‍💻
Happy coding :)
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"
@OliverLetterer
OliverLetterer / XCDUUID.m
Created January 26, 2013 17:05
With this gist, I, as a total assembly noob, am trying to understand the XCDUUID runtime hack (https://github.com/0xced/NSUUID/blob/1.0.1/NSUUID.m#L167-L221) to be able to use NSUUID on iOS < 6.0.
@implementation XCDUUID
+ (void) load
{
// query runtime if NSUUID class already exists, if so => done
if (objc_getClass("NSUUID"))
{
return;
}
@OliverLetterer
OliverLetterer / gist:5055011
Created February 28, 2013 07:47
OS X get used CPU by current application
#import <mach/mach.h>
float cpu_usage()
{
kern_return_t kr;
task_info_data_t tinfo;
mach_msg_type_number_t task_info_count;
task_info_count = TASK_INFO_MAX;
kr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)tinfo, &task_info_count);
@interface SomeViewController ()
// Declare some collection properties to hold the various updates we might get from the NSFetchedResultsControllerDelegate
@property (nonatomic, strong) NSMutableIndexSet *deletedSectionIndexes;
@property (nonatomic, strong) NSMutableIndexSet *insertedSectionIndexes;
@property (nonatomic, strong) NSMutableArray *deletedRowIndexPaths;
@property (nonatomic, strong) NSMutableArray *insertedRowIndexPaths;
@property (nonatomic, strong) NSMutableArray *updatedRowIndexPaths;
@end
@OliverLetterer
OliverLetterer / Find files to refactor
Created March 11, 2013 21:05
Find files which are worth to refactor
sloccount --details . | sort -n -k1,1
#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
@OliverLetterer
OliverLetterer / cocoapods.zsh
Last active December 16, 2015 20:49
zsh script for automatically sending pull-request to CocoaPods/Specs:master without push access. make sure you have https://github.com/defunkt/hub installed
user="OliverLetterer"
master="CocoaPods"
pod-lint() {
pod spec lint --local --verbose
}
pod-release() {
git add -A && git commit -m "Release "$1"."
git tag $1
// Created by Nick Snyder on 11/13/12.
// NDCollectionViewFlowLayout.h
@interface NDCollectionViewFlowLayout : UICollectionViewFlowLayout
@end
@OliverLetterer
OliverLetterer / gist:6049349
Created July 21, 2013 18:06
Log all used CAFilter operations
typedef struct CAColorMatrix {
float m11, m12, m13, m14, m15;
float m21, m22, m23, m24, m25;
float m31, m32, m33, m34, m35;
float m41, m42, m43, m44, m45;
} CAColorMatrix;
@interface CAFilter : NSObject
@property(copy) NSString *name;
@OliverLetterer
OliverLetterer / guide.md
Last active July 19, 2018 15:44
epson wireless guide

Reset WLAN interface to default values

  • printer off
  • hold tiny reset button on the back
  • keep holding tiny reset button for around 20 seconds while powering on the printer

print current wireless settings

  • printer on and booted
  • hold tiny reset button for around 5 seconds