Skip to content

Instantly share code, notes, and snippets.

View mindbrix's full-sized avatar

Nigel Timothy Barber mindbrix

View GitHub Profile
//
// UIImage+PDF.swift. Copyright © 2016 Nigel Timothy Barber (@mindbrix). All rights reserved.
//
import UIKit
extension UIImage {
static func PDFImageWith(_ url: URL, pageNumber: Int, width: CGFloat) -> UIImage? {
return PDFImageWith(url, pageNumber: pageNumber, constraints: CGSize(width: width, height: 0))
}
@mindbrix
mindbrix / UIView+Geometry.h
Created June 3, 2013 16:24
UIView+Geometry
//
// UIView+Geometry.h
// Swipe To Scrub
//
// Created by Nigel Barber on 29/10/2012.
// Copyright (c) 2012 Mindbrix. All rights reserved.
//
#import <UIKit/UIKit.h>
//
// UIImage+Decompression.swift
// Contis Protocol
//
// Created by Nigel Barber on 01/03/2017.
// Copyright © 2017 @mindbrix. All rights reserved.
//
import CoreGraphics
import ImageIO
@mindbrix
mindbrix / PDFImage.swift
Last active November 17, 2016 09:16
Swift replacement for UIImage+PDF
//
// PDFImage.swift. Copyright © 2016 Nigel Timothy Barber (@mindbrix). All rights reserved.
//
import UIKit
extension UIImage {
static func PDFImageWith(url: NSURL, pageNumber: Int, width: CGFloat) -> UIImage? {
return PDFImageWith(url, pageNumber: pageNumber, constraints: CGSizeMake(width, 0))
}
//
// UILabel+MultiLineSupport.h
// giffgaffIOS
//
// Created by Nigel Barber on 23/10/2013.
// Copyright (c) 2013 confidence. All rights reserved.
//
#import <UIKit/UIKit.h>
@mindbrix
mindbrix / UILabel+MultiLineSupport.h
Created October 23, 2013 13:59
Support for creating a multi-line UILabel from NSAttributedStrings
//
// UILabel+MultiLineSupport.h
// giffgaffIOS
//
// Created by Nigel Barber on 23/10/2013.
// Copyright (c) 2013 confidence. All rights reserved.
//
#import <UIKit/UIKit.h>
@mindbrix
mindbrix / drawTimecodeUsingGCD.m
Created July 8, 2013 11:48
How to draw rapidly refreshed string labels performantly using GCD.
-(void)drawTimecodeUsingGCD
{
if( dispatch_semaphore_wait( _timecodeSemaphore, DISPATCH_TIME_NOW ) != 0 )
{
return;
}
dispatch_async( _timecodeQueue, ^()
{
float fontSize = ceilf( self.scrubberSize * 0.425f );
@mindbrix
mindbrix / NTBProxyImageView.h
Created June 21, 2013 17:07
NTBProxyImageView
//
// NTBProxyImageView.h
// Vectoria Squared
//
// Created by Nigel Barber on 22/04/2013.
// Copyright (c) 2013 Nigel Barber. All rights reserved.
//
#import <UIKit/UIKit.h>
@mindbrix
mindbrix / UIView+getUIColor.h
Created March 30, 2011 15:57
A UIImage category to read a single pixel as a UIColor
//
// UIView+getUIColor.h
// PRL_iPad_Catalogue
//
// Created by Nigel Barber on 30/03/2011.
// Copyright 2011 Mindbrix. All rights reserved.
//
@interface UIImage (getUIColor)
@mindbrix
mindbrix / picasaUtilities.php
Created November 28, 2010 12:23
A simple utility to extract an array of full size Picasa web image URLs for a given user and album. Written for http://vectoria.co.uk/gallery/
<?php
// http://code.google.com/p/picasaphp/
//
require_once("Picasa.php" );
/* Return an array of full size Picasa web image URLs
*
* Written for http://vectoria.co.uk/gallery/