Skip to content

Instantly share code, notes, and snippets.

View SheffieldKevin's full-sized avatar

Kevin Meaney SheffieldKevin

View GitHub Profile

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 / 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;
@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 / MICMSampleBuffer.h
Last active January 18, 2024 10:14
Video Sample buffer accessor/iterator using AVFoundation
// MICMSampleBuffer.h
// MovieMaker
//
// Created by Kevin Meaney on 02/01/2015.
// Copyright (c) 2015 MIT License. All rights reserved.
@import Foundation;
@import AVFoundation;
@interface MICMSampleBuffer : NSObject <NSCopying>
@SheffieldKevin
SheffieldKevin / compareimages.swift
Last active February 26, 2023 18:33
A couple of swift functions for comparing two CGImage using CIImage in OS X
/**
@brief Returns true if images have same meta. Width, Height, bit depth.
@discussion Assumes images are non null.
*/
func doImagesHaveSameMeta(#image1:CGImage, #image2:CGImage) -> Bool {
if CGImageGetWidth(image1) != CGImageGetWidth(image2) {
return false
}
if CGImageGetHeight(image1) != CGImageGetHeight(image2) {
@SheffieldKevin
SheffieldKevin / movietracks.swift
Last active November 7, 2020 14:47
Playing with movie tracks using AVFoundation in Swift (command line version)
#!/usr/bin/env swift
import Foundation
import AVFoundation
if Process.arguments.count != 2 {
println("The first and only argument should be a full path to a movie or music file.")
exit(1)
}
@SheffieldKevin
SheffieldKevin / movietransitions.swift
Last active June 25, 2021 16:58
Make a movie with transitions with AVFoundation and swift
//
// main.swift
// mutablecomposition
//
// Created by Kevin Meaney on 24/08/2015.
// Copyright (c) 2015 Kevin Meaney. All rights reserved.
//
import Foundation
@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 / 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 / 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