Skip to content

Instantly share code, notes, and snippets.

Michael Hackett MichaelHackett

  • Halifax, NS, Canada
View GitHub Profile
MichaelHackett /
Created May 31, 2019 — forked from vincetreur/
A RecyclerView.ItemDecoration that adds 8 dp padding to the top of the first and bottom of the last item in a list (or RecyclerView in this case).
import android.content.Context;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.View;
* Adds 8dp padding to the top of the first and the bottom of the last item in the list,
MichaelHackett / NSMutableArray+Indexing.m
Created Mar 18, 2014
Implementation of NSArray shorthand subscripting as found in iOS 6 / OS X 10.8. (Not tested.)
View NSMutableArray+Indexing.m
@implementation NSMutableArray (Indexing)
- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index
if (index == [self count]) {
[self addObject:object];
} else {
[self replaceObjectAtIndex:index withObject:object];
You can’t perform that action at this time.