Skip to content

Instantly share code, notes, and snippets.

Mohammad Azam azamsharp

Block or report user

Report or block azamsharp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .swift
var body: some View {
Button(action: {
self.isPressed = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
self.isPressed = false
self.onTap()
}
View .swift
Button(action: {
}) {
// SF Symbols
Image(systemName: self.systemName)
.resizable()
.frame(width: self.size.width, height: self.size.height)
View .swift
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) {
View .js
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)
View .sql
-- SQL (Structured Query Language)
-- CRUD (CREATE READ UPDATE DELETE)
-- JOINS
/*
CREATE TABLE posts (
postid SERIAL PRIMARY KEY,
View .js
// 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
View .js
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')
View .js
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')
View .js
// 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
View .swift
struct ContentView: View {
@ObservedObject private var trackingListVM = TrackingListViewModel()
init() {
self.trackingListVM.getTrackingData()
}
var body: some View {
You can’t perform that action at this time.