Skip to content

Instantly share code, notes, and snippets.

@JulesMoorhouse
JulesMoorhouse / AppDelegate.swift
Last active March 29, 2020 20:27
Relationships - core data
lazy var managedObjectModel: NSManagedObjectModel = {
let modelURL =
NSBundle.mainBundle().URLForResource("myDevices", withExtension: "Momd")!
return NSManagedObjectModel(contentsOfURL: modelURL)!
}()
lazy var persistentStoreCoordinator:
NSPersistentStoreCoordinator = {
let coordinator = NSPersistentStoreCoordinator
@JulesMoorhouse
JulesMoorhouse / code.txt
Last active March 28, 2020 09:07
NSManagedObject Subclasses - Beginning Core Data
PeopleTableViewController.swift
------
import UIKit
import CoreData
class PeopleTableViewController: UITableViewController {
var managedObjectContext: NSManagedObjectController!
var people = [NSManagedObject]()
override func viewDidLoad() {
@JulesMoorhouse
JulesMoorhouse / task.json
Last active December 8, 2019 09:53
Visual Studio Code - Build script which runs a shell script task then launches the file (html) in the default browser (aka safari)
{
"version": "2.0.0",
"tasks": [
{
"label" : "Launch",
"command": "open",
"args": ["/Users/jm/Dropbox/Code_ObjC/Screenshots/Scripting/STT_V2_HD/Output/index.html"],
"dependsOn":["Build with Merge script"],
"group": {
"kind": "build",
https://makingsoftware.wordpress.com/2013/02/16/using-git-subtrees-for-repository-separation/
https://newfivefour.com/git-subtree-tutorial.html
https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844
https://www.yeahshecodes.com/git/a-simple-git-subtree-tutorial
https://blog.developer.atlassian.com/the-power-of-git-subtree/
@interface NSObject (Debounce)
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay;
@end
[16:15:50]: ▸ (2/6) Resize video...
[16:15:50]: ▸ ----------------------------------------------------------------------------------------------
[16:15:50]: ▸ ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
[16:15:50]: ▸ built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
[16:15:50]: ▸ configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --disable-jack --enable-gpl --enable-libass --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --enable-openssl --disable-lzma --enable-nonfree
[16:15:50]: ▸ libavutil 55. 78.100 / 55. 78.100
[16:15:50]: ▸ libavcodec 57.107.100 / 57.107.100
[16:15:50]: ▸ libavformat 57. 83.100 / 57. 83.100
[16:15:50]: ▸ libavdevice 57. 10.100 / 57. 10.100
@JulesMoorhouse
JulesMoorhouse / gist:8384223
Last active January 3, 2016 00:39
iOS mp3 duration to plist, the plist can then be manually copied to the plist.
NSString *plistFilename = [[NSBundle mainBundle] pathForResource:@"voice_list" ofType:@"plist"];
NSMutableDictionary *plist = [[NSMutableDictionary alloc] initWithContentsOfFile:plistFilename];
for (NSInteger xt = 1; xt < 13; ++xt) {
for (NSInteger row = 1; row < 13; ++row) {
NSString *sum = [NSString stringWithFormat:@"mel%ldx%lde%d", (long)row, (long)xt, (row * xt)];
NSMutableDictionary *sumDict = [plist objectForKey:sum];