sudo apt-get install xserver-xorg-video-dummy
Create / Edit xorg.conf file Rename file if already exists for backup
| - (UIImage *)dynamicImage | |
| { | |
| UITraitCollection *const baseTraitCollection = /* an existing trait collection */; | |
| UITraitCollection *const lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]]]; | |
| UITraitCollection *const purelyDarkTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; | |
| UITraitCollection *const darkTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, purelyDarkTraitCollection]]; | |
| __block UIImage *lightImage; | |
| [lightTraitCollection performAsCurrentTraitCollection:^{ | |
| lightImage = /* draw image */; |
| final class Loader: BindableObject { | |
| let didChange = PassthroughSubject<Data?, Never>() | |
| var task: URLSessionDataTask! | |
| var data: Data? = nil { | |
| didSet { | |
| didChange.send(data) | |
| } | |
| } | |
| init(_ url: URL) { |
| // | |
| // Promise + CancelRequest.swift | |
| // PeopleFinders | |
| // | |
| // Created by Efraim Budusan on 12/13/17. | |
| // Copyright © 2017 Tapptitude. All rights reserved. | |
| // | |
| import Foundation | |
| import PromiseKit |
Last updated: October 21st, 2019.
At the time of writing this gist (January 4th, 2017), I was unable to find true sandboxing to separate development and production environments for a Firebase project. The closest we can get is to create two separate Firebase projects -- one for development and one for production.
| # The trick is to link the DeviceSupport folder from the beta to the stable version. | |
| # sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
| # Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
| sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
| # Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
| # (A similar approach works for older versions too, just change the version number after DeviceSupport) |
| extension UIImage { | |
| class func imageByCombiningImage(firstImage: UIImage, withImage secondImage: UIImage) -> UIImage { | |
| let newImageWidth = max(firstImage.size.width, secondImage.size.width ) | |
| let newImageHeight = max(firstImage.size.height, secondImage.size.height) | |
| let newImageSize = CGSize(width : newImageWidth, height: newImageHeight) | |
| UIGraphicsBeginImageContextWithOptions(newImageSize, false, UIScreen.mainScreen().scale) |
| // | |
| // ViewController.m | |
| // AVPlayerCaching | |
| // | |
| // Created by Anurag Mishra on 5/19/14. | |
| // Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer | |
| // | |
| #import "ViewController.h" | |
| #import <AVFoundation/AVFoundation.h> |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the | |
| software to the public domain. We make this dedication for the benefit |