Skip to content

Instantly share code, notes, and snippets.

View phpmaps's full-sized avatar
💭
Lending a helping hand on the web.

Doug Carroll phpmaps

💭
Lending a helping hand on the web.
View GitHub Profile
@phpmaps
phpmaps / bla.js
Created August 10, 2021 04:40
bla.js
module.exports = [{
mode: 'development',
entry: './app/main.ts',
target: 'electron-main',
devtool: 'source-map',
module: {
rules: [{
test: /\.(?:tsx|ts)$/,
include: /app/,
use: [{
@phpmaps
phpmaps / put.js
Created August 7, 2021 21:07
put request
.put(authenticate.verifyUser, (req, res, next) => {
Campsite.findById(req.params.campsiteId)
.then(campsite => {
if (campsite && campsite.comments.id(req.params.commentId)) {
console.log(`Comment author: ${campsite.comments.id(req.params.commentId).author}`);
console.log(`Auth user: ${req.user}`);
if (req.user._id.equals(campsite.comments.id(req.params.commentId).author)) {
if (req.body.rating) {
campsite.comments.id(req.params.commentId).rating = req.body.rating;
}
@phpmaps
phpmaps / membersRouter.js
Last active August 4, 2021 18:59
server/api/membersRouter.js
const express = require('express');
const router = express.Router();
router.route("/")
.get((req, res) => {
res.json({
message: 'API Members - 👋🌎🌍🌏'
});
});
@phpmaps
phpmaps / index.js
Created August 4, 2021 18:56
server/api/index.js
const express = require('express');
const exampleRouter = require('./exampleRouter');
const membersRouter = require('./membersRouter');
const router = express.Router()
/**
* main api endpoint
**/
router.route('/')
@phpmaps
phpmaps / gist:47c2d28fb22b2ca4911c12376effb496
Created July 27, 2021 14:59
Mongoose w/ mongoose-currency
{
"name": "mongo-nucamp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@phpmaps
phpmaps / color-game-extra.html
Created June 14, 2021 16:26
Color game extra
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Week 3 - Workshop (Color game)</title>
<style>
body {
font-family: Verdana, Arial, sans-serif;
}
@phpmaps
phpmaps / color-game.html
Created June 14, 2021 16:18
Color Game
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Color Guessing Game</title>
</head>
<body>
<h1>Color Guessing Game</h1>
<button type="button" onclick="runGame()">Start Game</button>
<script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web App Name</title>
</head>
<body>
</body>
</html>
@phpmaps
phpmaps / deploy.cmd
Created June 11, 2021 15:57
deploy fx
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.4
:: ----------------------
:: Prerequisites
:: -------------
@phpmaps
phpmaps / week2-lesson-example.html
Created June 5, 2021 18:04
week2-lesson-example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Survey Form</title>
</head>
<body>
<h1>Survey</h1>
<form action="https://us-central1-nucamp-production.cloudfunctions.net/post/formdata" method="post">
<fieldset>