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
Button(action: { | |
}) { | |
// SF Symbols | |
Image(systemName: self.systemName) | |
.resizable() | |
.frame(width: self.size.width, height: self.size.height) |
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
struct NeumorphicImageButton: View { | |
@State private var isPressed: Bool = false | |
private var systemName: String | |
private var onTap: () -> Void | |
private var size: CGSize | |
init(systemName: String,size: CGSize = CGSize(width: 60, height: 60), onTap: @escaping () -> Void) { |
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 mustacheExpress = require('mustache-express') | |
// initialize pg promise library | |
const pgp = require('pg-promise')() | |
// location of the database | |
const connectionString = "postgres://localhost:5432/tripsdb" | |
// create a db object based on the connection string | |
const db = pgp(connectionString) |
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
-- SQL (Structured Query Language) | |
-- CRUD (CREATE READ UPDATE DELETE) | |
-- JOINS | |
/* | |
CREATE TABLE posts ( | |
postid SERIAL PRIMARY KEY, |
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
// REVIEW ACTIVITY 1 - COUNTER - START | |
app.get('/counter',(req,res) => { | |
res.render('counter',{counter: req.session.counter}) | |
}) | |
app.post('/update-counter',(req,res) => { | |
if(req.session) { | |
req.session.counter += 1 |
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 tripsRouter = require('./routes/trips') | |
const usersRouter = require('./routes/users') | |
console.log(usersRouter) | |
const mustacheExpress = require('mustache-express') |
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 mustacheExpress = require('mustache-express') | |
// setting up Express to use Mustache Express as template pages | |
app.engine('mustache',mustacheExpress()) | |
// the pages are located in views directory | |
app.set('views', './views') | |
// extension will be .mustache | |
app.set('view engine','mustache') |
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
// express package is used to start the server | |
const express = require('express') | |
const app = express() | |
// create routes/endpoints | |
// localhost = 127.0.0.1 | |
// Port = 3000 | |
// /hello route/endpoint |
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
struct ContentView: View { | |
@ObservedObject private var trackingListVM = TrackingListViewModel() | |
init() { | |
self.trackingListVM.getTrackingData() | |
} | |
var body: some View { |
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
class TrackingViewModel { | |
var tracking: Tracking | |
init(tracking: Tracking) { | |
self.tracking = tracking | |
} | |
let id: UUID = UUID() | |