Skip to content

Instantly share code, notes, and snippets.

Samuel Defago defagos

Block or report user

Report or block defagos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View example_block_swizzling.m
@implementation UILabel (SwizzlingExamples)
+ (void)load
{
SwizzleSelectorWithBlock_Begin(self, @selector(initWithFrame:))
^(UILabel *self, CGRect frame) {
if ((self = ((id (*)(id, SEL, CGRect))_imp)(self, _cmd, frame))) {
// ...
}
return self;
@defagos
defagos / gist:267d3b8b30604fac541f
Created Dec 2, 2014
git commit hook ensuring the correct branch URL is set for Travis badges found in README files. Install both as post-commit and post-merge hooks
View gist:267d3b8b30604fac541f
#!/bin/sh
# Repository settings
REPOSITORY_NAME="YourRepositoryName"
README_FILE_NAME="README.markdown"
# Update a Travis badge URL found in the README to keep it in sync with the branch name
# Badge example:
# [![Build Status](https://img.shields.io/travis/$USER_NAME/$REPOSITORY_NAME/master.svg?style=flat)](https://travis-ci.org/$USER_NAME/$REPOSITORY_NAME)
branch_name=`git symbolic-ref --short HEAD`
@defagos
defagos / UITextView+SDECursorVisibility.m
Last active Aug 29, 2015
A category for iOS 7 ensuring that UITextView cursor stays within the content area defined by its contentInset. This behavior is standard in iOS 8
View UITextView+SDECursorVisibility.m
//
// UITextView+SDECursorVisibility.m
//
// Created by Samuel Défago on 29.10.14.
//
#import <UIKit/UIKit.h>
@interface UITextView (SDECursorVisibility)
@defagos
defagos / uncrustify-objc.cfg
Last active Sep 7, 2016
My Objective-C Uncrustify configuration file
View uncrustify-objc.cfg
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# Alignment
# ---------
## Alignment
You can’t perform that action at this time.