brew install redis
Set up launchctl to auto start redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)
| Update: just use this: https://mustapp-exporter.pages.dev/ | |
| Original Developer Tools way follows (but it doesn't export reviews). | |
| Here's how to export your movie history from Must, just in case it goes under. | |
| Go to https://mustapp.com/@<your_profile_name>/watched | |
| Scroll down (hold End on keyboard) until the whole list is loaded. | |
| Open Browser Developer Tools, Console. | |
| Paste the following line and press Enter: | |
| (() => { let exportResult = ""; $('.js_item_product').each((i, el) => exportResult += $(el).find('.poster__title').text() + '\t' + $(el).find('.poster__rate').text().trim() + '\n'); copy(exportResult); })(); |
| import Foundation | |
| import SwiftSyntax | |
| func main() throws { | |
| guard CommandLine.arguments.count > 1 else { | |
| print("usage: swift-format [file]") | |
| exit(-1) | |
| } | |
| let url = URL(fileURLWithPath: CommandLine.arguments[1]) |
| // | |
| // RealmSwift+Codable.swift | |
| // | |
| // Created by Michael Gray on 8/16/17. | |
| // | |
| import Foundation | |
| import RealmSwift | |
| // swiftlint:disable line_length identifier_name |
| import Foundation | |
| struct DateComponentUnitFormatter { | |
| private struct DateComponentUnitFormat { | |
| let unit: Calendar.Component | |
| let singularUnit: String | |
| let pluralUnit: String | |
| // | |
| // DetailViewController.swift | |
| // TransitionCoordinator | |
| // | |
| // Created by Rob Nadin on 15/02/2015. | |
| // Copyright (c) 2015 Rob Nadin. All rights reserved. | |
| // | |
| import UIKit |
| func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
| let calendar = NSCalendar.currentCalendar() | |
| let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
| let now = NSDate() | |
| let earliest = now.earlierDate(date) | |
| let latest = (earliest == now) ? date : now | |
| let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
| if (components.year >= 2) { | |
| return "\(components.year) years ago" |
| - (CGSize)intrinsicContentSize { | |
| CGSize boundingSize = CGSizeMake(self.titleLabel.preferredMaxLayoutWidth - self.titleEdgeInsets.left - self.titleEdgeInsets.right, CGFLOAT_MAX); | |
| NSAttributedString *attributedTitle = [self attributedTitleForState:self.state]; | |
| CGRect boundingRect; | |
| if(attributedTitle) { | |
| #import <RestKit/RestKit.h> | |
| #import "CoreData+MagicalRecord.h" | |
| // Use a class extension to expose access to MagicalRecord's private setter methods | |
| @interface NSManagedObjectContext () | |
| + (void)MR_setRootSavingContext:(NSManagedObjectContext *)context; | |
| + (void)MR_setDefaultContext:(NSManagedObjectContext *)moc; | |
| @end | |
| @implementation AppDelegate |