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
@objc func resolveAnchor() { | |
if let cloudAnchor = try? self.gSession.resolveCloudAnchor(withIdentifier: self.cloudIdentifier) { | |
let box = SCNBox(width: 0.3, height: 0.3, length: 0.3, chamferRadius: 0) | |
let material = SCNMaterial() | |
material.diffuse.contents = UIColor(fromHexString: hex) | |
box.materials = [material] | |
let node = SCNNode(geometry: box) |
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
@objc func addBlock() { | |
let grAnchor = try? self.gSession.resolveCloudAnchor(withIdentifier: self.cloudIdentifier) | |
if let cloudAnchor = grAnchor { | |
let box = SCNBox(width: 0.1, height: 0.1, length: 0.1, chamferRadius: 0) | |
let node = SCNNode(geometry: box) | |
node.position = SCNVector3(cloudAnchor.transform.columns.3.x, cloudAnchor.transform.columns.3.y, cloudAnchor.transform.columns.3.z) | |
self.sceneView.scene.rootNode.addChildNode(node) |
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
private func setupObservers() { | |
self.rootRef.child("cloud-anchors").observe(.value) { (snapshot) in | |
if let dictionary = snapshot.value as? [String:Any] { | |
self.cloudIdentifier = dictionary["cloudIdentifier"] as! String | |
let hex = dictionary["hex"] as! String | |
if let cloudAnchor = try? self.gSession.resolveCloudAnchor(withIdentifier: self.cloudIdentifier) { |
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
let btnSave = document.getElementById("btnSave") | |
btnSave.addEventListener('click',function(){ | |
let tasksRef = database.ref("tasks") | |
tasksRef.push({ | |
title : "Feed Dog", | |
priority : "low" |
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
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
// Create a session configuration | |
let configuration = ARImageTrackingConfiguration() | |
guard let referenceImages = ARReferenceImage.referenceImages(inGroupNamed: "AR Resources", bundle: nil) else { | |
fatalError("Missing expected asset catalog resources.") | |
} | |
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
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
// Create a session configuration | |
let configuration = ARImageTrackingConfiguration() | |
guard let referenceImages = ARReferenceImage.referenceImages(inGroupNamed: "AR Resources", bundle: nil) else { | |
fatalError("Missing expected asset catalog resources.") | |
} | |
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 renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { | |
if anchor is ARImageAnchor { | |
let phoneScene = SCNScene(named: "Phone_01.scn")! | |
let phoneNode = phoneScene.rootNode.childNode(withName: "parentNode", recursively: true)! | |
// rotate the phone node | |
let rotationAction = SCNAction.rotateBy(x: 0, y: 0.5, z: 0, duration: 1) | |
let inifiniteAction = SCNAction.repeatForever(rotationAction) |
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
const express = require('express') | |
const app = express() | |
const bodyParser = require('body-parser') | |
const mustacheExpress = require('mustache-express') | |
const promise = require('bluebird') | |
app.engine('mustache',mustacheExpress()) | |
app.use(bodyParser.urlencoded({extended :false})) |
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
Dashboard My Paths Admin Mohammad MA | |
ASK AN INSTRUCTOR | |
Back to Course Lecture: Introduction to Sequelize | |
Admin Panel | |
OBJECTIVES | |
1: Create models with Sequelize v0.1.3 | |
2: Use Sequelize models to find, create, update, and delete data v0.1.2 | |
3: Author routes and controllers to view, create, update, and delete database models v0.1.0 | |
INSTRUCTOR MATERIAL | |
Lecture Notes |
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
// swift-tools-version:4.0 | |
import PackageDescription | |
let package = Package( | |
name: "hello-leaf", | |
dependencies: [ | |
// 💧 A server-side Swift web framework. | |
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"), | |
.package(url: "https://github.com/vapor/leaf.git", from: "3.0.0-rc"), | |
.package(url: "https://github.com/vapor/fluent-postgresql.git", from: "1.0.0-rc"), |