Skip to content

Instantly share code, notes, and snippets.

View azamsharp's full-sized avatar

Mohammad Azam azamsharp

View GitHub Profile
Button(action: {
}) {
// SF Symbols
Image(systemName: self.systemName)
.resizable()
.frame(width: self.size.width, height: self.size.height)
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) {
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)
-- SQL (Structured Query Language)
-- CRUD (CREATE READ UPDATE DELETE)
-- JOINS
/*
CREATE TABLE posts (
postid SERIAL PRIMARY KEY,
// 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
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')
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')
// 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
struct ContentView: View {
@ObservedObject private var trackingListVM = TrackingListViewModel()
init() {
self.trackingListVM.getTrackingData()
}
var body: some View {
class TrackingViewModel {
var tracking: Tracking
init(tracking: Tracking) {
self.tracking = tracking
}
let id: UUID = UUID()