This gist accompanies a blog post on Masilotti.com, How to manage multiple sheets in SwiftUI.
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 SwiftUI | |
struct AppleMusicProfile: View { | |
let profileImage: Image | |
let name: String | |
let username: String | |
var body: some View { | |
ZStack { | |
// (1) Blurred profile image for background |
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 SwiftUI | |
struct BottomSheetDesign: View { | |
@State var showSheet: Bool? = nil | |
var body: some View { | |
Button(action: { showSheet = true }) { | |
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
#!/bin/bash | |
# version 3.2.0 | |
# https://gist.github.com/mbierman/6cf22430ca0c2ddb699ac8780ef281ef | |
wait=1 | |
container=$1 | |
DOCKER=$(which docker) | |
# Check if Docker is installed |
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 | |
import SceneKit | |
import ARKit | |
class ViewController: UIViewController, ARSCNViewDelegate { | |
@IBOutlet var sceneView: ARSCNView! | |
var anchorCount = 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
guard let query = arView.makeRaycastQuery(from: arView.center, allowing: .existingPlaneInfinite, alignment: .horizontal) else { return } | |
guard let raycastResult = arView.session.raycast(query).first else { return } | |
// set a transform to an existing entity | |
let transform = Transform(matrix: raycastResult.worldTransform) | |
entity.transform = transform | |
// or anchor an entity to an ARRaycastResult | |
let anchor = AnchorEntity(raycastResult: raycastResult) | |
anchor.addChild(entity) |
Integration
- Will merging this code create source conflicts?
- Is there a clear and concise description of the changes?
- Did all automated checks (build, test, lint) run and pass?
- Are there supporting metrics or reports (e.g. test coverage, fitness functions) that measure the impact?
- Are there obvious logic errors or incorrect behaviors that might break the software?
Readability
To make Xcode 9 render markdown file eg. README.md, drop .xcodesamplecode.plist
in your .xcodeproj/
folder.
.xcodesamplecode.plist
is like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array/> </plist>
For convenience, There is this tool, which is derived from a tutorial.
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
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands) | |
gpg --gen-key | |
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
# check current keys: | |
gpg --list-secret-keys --keyid-format LONG | |
# See your gpg public key: | |
gpg --armor --export YOUR_KEY_ID | |
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333) |
Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo
.
First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git
) or simply downloading it as a zip (from its GitHub page).
Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim
directory by default).
For example, if the layout of a plugin foo
is as follows:
foo/autoload/foo.vim
foo/plugin/foo.vim
NewerOlder