Skip to content

Instantly share code, notes, and snippets.

blork / Debouncer.swift
Last active Mar 20, 2019
Simple Debouncer in Swift 4
View Debouncer.swift
// Debouncer.swift
// Created by Sam Oakley on 20/03/2019.
import Foundation
class Debouncer {
blork / tableviewAnimation.m
Created Feb 20, 2015
Reload a tableview with nice animations.
View tableviewAnimation.m
- (void)reloadWithUpdatedObjects:(NSArray *)updatedObjects animated:(BOOL)animated
NSMutableArray *delete = [NSMutableArray array];
NSMutableArray *insert = [NSMutableArray array];
NSMutableArray *changed = [NSMutableArray array];
NSMutableDictionary *moved = [NSMutableDictionary dictionary];
NSInteger deleteIndex = 0;
for (NSObject *existingObject in self.objects)
blork / colors.xml
Created Nov 28, 2014
Material Colors
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<color name="black">#000000</color>
<color name="white">#FFFFFF</color>
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
<color name="red_200">#EF9A9A</color>
<color name="red_300">#E57373</color>
blork /
Last active Aug 29, 2015
What's new in Pinner 3.0.3

Pinner 3.0.3 (App Store)

  • Fixed landscape split view issues on iPhone 6 Plus.
  • Fixed a crash that could occur when sharing a bookmark.
  • Fixed a crash caused by an invalid URL being handed off (Handoff to Safari supports HTTP/HTTPS only).

##Share Extension

  • Never set the title and description to the same text. Brought to you by the department of redundancy department.
  • Add a notice if a bookmark has been previously added.
  • Fixed issue where PDFs could not be bookmarked.
blork /
Last active Aug 29, 2015
What's new in Pinner 3.0.1

Pinner 3.0.1

The biggest update for Pinner yet, with hundreds of changes specially designed for iOS 8! If you like Pinner, please take the time to give it a nice review: it really helps!

  • Added @3x images for iPhone 6 Plus. So crisp.
  • Improved selection colour legibility in dark mode.
  • A few bug fixes.

blork /
Last active Aug 29, 2015
What's new in Pinner 3.0.2

#Pinner 3.0.2

What's New

  • Improved extension compatibility with Pocket & others. You should now see both the URL and title when sharing to Pinner.
  • Tags are parsed from description text.
  • "Fill Description" option now works correctly.
  • Improved webview scrollbar display.
  • Fixed a bug that could cause articles containing HTML to be incorrectly displayed in the "Optimised" view.
  • Shows login page the first time the app runs.
  • Fixed a display bug that could cause spacing between title/description to be inconsistent. This one took a while to figure out.
blork / Prrprocessor.js
Created Sep 5, 2014
iOS Extension Web Page Preprocessor
View Prrprocessor.js
var MyPreprocessor = function() {};
MyPreprocessor.prototype = {
run: function(arguments) {
// Pass the baseURI of the webpage to the extension.
arguments.completionFunction({"URL": document.URL, "pageSource": document.documentElement.outerHTML, "title": document.title, "selection": window.getSelection().toString()});
// The JavaScript file must contain a global object named "ExtensionPreprocessingJS".
var ExtensionPreprocessingJS = new MyPreprocessor;
blork / extensions.m
Last active Dec 13, 2018
Dealing with various extension data types
View extensions.m
NSExtensionItem *item = self.extensionContext.inputItems.firstObject;
NSItemProvider *itemProvider = item.attachments.firstObject;
// Shared plain text is stored here. Content varies wildly based on app.
NSString *sharedPlainText = [item.attributedContentText string];
if ([itemProvider hasItemConformingToTypeIdentifier:(NSString *)kUTTypePropertyList]) {
[itemProvider loadItemForTypeIdentifier:(NSString *)kUTTypePropertyList
completionHandler:^(NSDictionary *item, NSError *error) {
View gist:9599421
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
NSInteger newIndex = toIndexPath.row;
NSInteger oldIndex = fromIndexPath.row;
EKReminder *movedReminder = self.remindersList[oldIndex];
[self.remindersList removeObjectAtIndex:oldIndex];
[self.remindersList insertObject:movedReminder atIndex:newIndex];
blork / New in
Last active Aug 29, 2015
Changelog for Tasked 1.2
View New in

New features

  • Change the app font to one of 22 alternatives.
  • You can hide the default "Reminders" list from the app.

Note: all settings are changed through the system Settings app.


  • Fixed appearance of sharing options on iPad.
  • Improved display of notes screen.
  • Prevented reloading animation when moving to a new screen.