Skip to content

Instantly share code, notes, and snippets.

JulesMoorhouse

Block or report user

Report or block JulesMoorhouse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JulesMoorhouse
JulesMoorhouse / AppDelegate.swift
Last active Mar 29, 2020
Relationships - core data
View AppDelegate.swift
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 Mar 28, 2020
NSManagedObject Subclasses - Beginning Core Data
View code.txt
PeopleTableViewController.swift
------
import UIKit
import CoreData
class PeopleTableViewController: UITableViewController {
var managedObjectContext: NSManagedObjectController!
var people = [NSManagedObject]()
override func viewDidLoad() {
@JulesMoorhouse
JulesMoorhouse / task.json
Last active Dec 8, 2019
Visual Studio Code - Build script which runs a shell script task then launches the file (html) in the default browser (aka safari)
View task.json
{
"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",
View Subtree urls
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/
View NSObject+Debounce.h
@interface NSObject (Debounce)
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay;
@end
View gist:e5e0061960728d4d2943ed2afe977e95
[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 Jan 3, 2016
iOS mp3 duration to plist, the plist can then be manually copied to the plist.
View gist:8384223
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];
You can’t perform that action at this time.