This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a:~$ realm-object-server --configuration /etc/realm/configuration.yml | |
| module.js:583 | |
| return process.dlopen(module, path._makeLong(filename)); | |
| ^ | |
| Error: Module version mismatch. Expected 48, got 46. | |
| at Error (native) | |
| at Object.Module._extensions..node (module.js:583:18) | |
| at Module.load (module.js:473:32) | |
| at tryModuleLoad (module.js:432:12) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :~$ node -v | |
| v4.4.2 | |
| :~$ npm -v | |
| 2.15.0 | |
| :~$ nano /var/log/realm-sync.log | |
| empty file | |
| :~$ curl http://localhost:9080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getHDDSize() -> CGFloat { | |
| do { | |
| let fileAttributes = try FileManager.default.attributesOfFileSystem(forPath: "/") | |
| if let size = fileAttributes[FileAttributeKey.systemSize] as? CGFloat { | |
| return size | |
| } | |
| } catch { } | |
| return 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| #import <objc/runtime.h> | |
| unsigned int numberOfProperties = 0; | |
| objc_property_t *propertyArray = class_copyPropertyList([YourClass class], &numberOfProperties); | |
| for (NSUInteger i = 0; i < numberOfProperties; i++) { | |
| objc_property_t property = propertyArray[i]; | |
| NSString *name = [[NSString alloc] initWithUTF8String:property_getName(property)]; | |
| NSString *attributesString = [[NSString alloc] initWithUTF8String:property_getAttributes(property)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| struct User { | |
| var name = "" | |
| var lastName = "" | |
| var nickName = "" | |
| var age = 0 | |
| } | |
| var user = User() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for family: String in UIFont.familyNames { | |
| print("\(family)") | |
| for names: String in UIFont.fontNames(forFamilyName: family) { | |
| print("== \(names)") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension UIImage { | |
| func resizeImage(_ image: UIImage, newWidth: CGFloat) -> UIImage? { | |
| let scale = newWidth / image.size.width | |
| let newHeight = image.size.height * scale | |
| UIGraphicsBeginImageContext(CGSize(width: newWidth, height: newHeight)) | |
| image.draw(in: CGRect(x: 0, y: 0, width: newWidth, height: newHeight)) | |
| let newImage = UIGraphicsGetImageFromCurrentImageContext() | |
| guard let image = newImage else { return nil } | |
| UIGraphicsEndImageContext() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MARK: - Photos | |
| func checkIfAuthorizedToAccessPhotos(_ handler: @escaping (_ isAuthorized: Bool) -> Void) { | |
| switch PHPhotoLibrary.authorizationStatus() { | |
| case .notDetermined: | |
| PHPhotoLibrary.requestAuthorization{ status in | |
| switch status { | |
| case .authorized: | |
| handler(true) | |
| default: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TAGS="TODO:|FIXME:" | |
| echo "searching ${SRCROOT} for ${TAGS}" | |
| find "${SRCROOT}" \( -name "*.swift" \) -print0 \ | |
| | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" \ | |
| | perl -p -e "s/($TAGS)/ warning: \$1/" |