Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#! bin/bash | |
# webrtc - A script to sync and build the webrtc codebase | |
# | |
# Dependencies | |
# Make sure to install the chromium depot_tools first. Detailed instructions available at | |
# http://dev.chromium.org/developers/how-tos/install-depot-tools | |
##### Constants |
// put this in your AppDelegate | |
- (void)changeRootViewController:(UIViewController*)viewController { | |
if (!self.window.rootViewController) { | |
self.window.rootViewController = viewController; | |
return; | |
} | |
UIView *snapShot = [self.window snapshotViewAfterScreenUpdates:YES]; | |
[viewController.view addSubview:snapShot]; | |
self.window.rootViewController = viewController; |
func switchRootViewController(rootViewController: UIViewController, animated: Bool, completion: (() -> Void)?) { | |
if animated { | |
UIView.transitionWithView(window, duration: 0.5, options: .TransitionCrossDissolve, animations: { | |
let oldState: Bool = UIView.areAnimationsEnabled() | |
UIView.setAnimationsEnabled(false) | |
self.window!.rootViewController = rootViewController | |
UIView.setAnimationsEnabled(oldState) | |
}, completion: { (finished: Bool) -> () in | |
if completion { | |
completion!() |
import Dispatch | |
/* | |
Note: Thanks, Ian Keen and Zev Eisenberg and Sven Weidauer | |
Zev Eisenberg: "Do you still have to specify 1 << _n_ manually for `OptionSet` conformance? There’s no magic?" | |
This solution creates values that don't matter. They're simply unique, since option sets should not be accessed by raw value outside the implementation. (Versus direct `UInt`, which supports bit manipulation operations) | |
*/ |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
// | |
// udpsocket.swift | |
// | |
// Created by Richard Wei on 3/7/21. | |
// | |
import Foundation | |
import Network | |
// https://developer.apple.com/news/?id=0oi77447 |
import Combine | |
import PublishedObject // https://github.com/Amzd/PublishedObject | |
import SwiftUI | |
/// A property wrapper type that instantiates an observable object. | |
@propertyWrapper | |
public struct StateObject<ObjectType: ObservableObject>: DynamicProperty | |
where ObjectType.ObjectWillChangePublisher == ObservableObjectPublisher { | |
/// Wrapper that helps with initialising without actually having an ObservableObject yet |