Skip to content

Instantly share code, notes, and snippets.

View SheffieldKevin's full-sized avatar

Kevin Meaney SheffieldKevin

View GitHub Profile
@SheffieldKevin
SheffieldKevin / Compare images not working
Last active August 29, 2015 13:56
The CIAreaMaximum filter is not working.
// main.m
// compareimages
//
// Created by Kevin Meaney on 25/02/2014.
// Copyright (c) 2014 Kevin Meaney. All rights reserved.
@import Foundation;
@import QuartzCore;
// ---------------------------------------------------------------------------
@SheffieldKevin
SheffieldKevin / MPO image meta
Created April 24, 2014 14:16
MPO image meta
{
"{TIFF}": {
"ResolutionUnit": 2,
"Software": "NEX-5N v1.01",
"DateTime": "2013:07:28 13:50:35",
"XResolution": 350,
"ImageDescription": " ",
"Orientation": 1,
"Model": "NEX-5N",
"Make": "SONY",
@SheffieldKevin
SheffieldKevin / BaseDerivedClassMethods
Last active August 29, 2015 14:01
Calling derived class methods from the base class. What do you think this code outputs.
#import <Foundation/Foundation.h>
@interface BaseClass : NSObject
+(void)callDerivedClassMethod;
@end
@interface DerivedClass : BaseClass
+(void)derivedClassMethod;
@end
@SheffieldKevin
SheffieldKevin / coda_runscript.rb
Last active August 29, 2015 14:05
Coda run the current document in ruby plugin script
#!/usr/bin/env ruby
# This is the script code to run. It runs the script based on the file path to the script not text passed in.
# In Panic's "Coda Plug-in Creator" I've set the following options:
# Command is: Run Document
# Keyboard shortcut: Command-Option-R
# On Run: Save
# On Success: Nothing
# STDIN None
# STDOUT New Document
@SheffieldKevin
SheffieldKevin / scaleandwatermark
Created October 12, 2014 22:04
ruby/applescript display select folder dialog script for Paul
#!/usr/bin/env ruby
# Scale and add a text water mark to images.
require 'moving_images'
include MovingImages
# The folder where the water marked images will be saved.
output_dir = "~/Desktop/watermarkedfiles"
@SheffieldKevin
SheffieldKevin / CreateImageProtocol.h
Created October 17, 2014 16:38
Objective-C properties of protocols that take blocks/closures and accessing them in Swift
//
// CreateImageProtocol.h
// test
//
// Created by Kevin Meaney on 17/10/2014.
// Copyright (c) 2014 Kevin Meaney. All rights reserved.
//
#import <Foundation/Foundation.h>
@SheffieldKevin
SheffieldKevin / main.m
Created February 20, 2015 11:20
bigears. Drawing rotated and positioned text within a path using CoreText (OS X command line, intended to be bug report for apple but highlighted a bug of mine)
//
// main.m
// bigears
//
// Created by Kevin Meaney on 18/02/2015.
// Copyright (c) 2015 Kevin Meaney. All rights reserved.
//
#import <Foundation/Foundation.h>
@SheffieldKevin
SheffieldKevin / MIAVCreateImageOfCompositionMap.m
Created March 8, 2015 19:22
This is a hack grab of code from Apple's AV Composition Debug Viewer application to generate a CGImage. Works on OS X and iOS. Doesn't draw text.
//
// MIAVCreateImageOfCompositionMap.m
// MovingImagesFramework
//
// Created by Kevin Meaney on 08/03/2015.
//
// Lifted from Apple's Composition Debug Viewer application.
@import Foundation;
@import AVFoundation;

Keybase proof

I hereby claim:

  • I am SheffieldKevin on github.
  • I am ktam (https://keybase.io/ktam) on keybase.
  • I have a public key whose fingerprint is D09A 1368 02CD 66C0 454C 42A8 595C 9934 19FB CBF9

To claim this, I am signing this object:

@SheffieldKevin
SheffieldKevin / main.m
Last active November 26, 2018 18:22
I had far more difficulty getting the generation of gif animations working correctly using ImageIO and Core-Graphics aka Quartz on MacOS/iOS than should have reasonably been expected.
// main.m
// creategif
//
// Created by Kevin Meaney on 21/10/2013.
// I've briefly blogged about it here:
// http://blog.yvs.eu.com/2013/10/creating-gif-animations-using-coreimagequartz
// The following code is all that is all the code needed for a creating a command line tool to generate
// a gif animation from image files.
// The main limitation with this code is that apart from the frame delay time of 0.1 second, every