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 lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN}); | |
let badWordsList = [ | |
/** in this parts you can add all the banned words you want, to add more just add: ' word ',**/ | |
' ', | |
' ', | |
' ', | |
]; | |
let regexString = |
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
app.get("/", isLoggedIn, (req, res) => { | |
db.customer | |
.findAll({ | |
where: { userId: req.user.id }, | |
where: { unfullfilled: true }, | |
}) | |
.then((customers) => { | |
res.render("main/index", { customers: customers }); | |
}) | |
.catch((error) => { |
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 express = require("express"); | |
let db = require("../models"); | |
let router = express.Router(); | |
require("dotenv").config(); | |
// POST /customers - create a new customer | |
router.post("/", (req, res) => { | |
db.customer | |
.create({ | |
ticket: req.body.ticket, |
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
router.post("/sms/:number", (req, res) => { | |
async function sendSMS(phone, message) { | |
const token = process.env.TOKEN; | |
const lib = require("lib")({ token: token }); | |
// make API request | |
let result = await lib.utils.sms["@2.0.2"]({ | |
to: phone, | |
body: message, | |
}); | |
console.log(result); |
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
<div id="container"> | |
<div class="row"> | |
<div class="col-sm-8"> | |
<div class="row"> | |
<div class="col-xs-12"> | |
<img class="hero" src=""> | |
</div> | |
</div> |
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
<h1>Create a New Customer</h1> | |
<form action="/customers" method="POST"> | |
<div class="form-group"> | |
<label for="ticket">Ticket Number</label> | |
<input type="text" class="form-control" id="ticket" name="ticket" required> | |
</div> | |
<div class="form-group"> | |
<label for="firstName">First Name</label> |
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
document.addEventListener("keydown", (e) => { | |
if (e.keyCode === 37) { // if left arrow is pressed | |
function playerMove(control) { // run this playerMove() function with a control argument | |
player.pos.x += control; // we move our players position on the x axis based on the control (-1) | |
if (collide(field, player)) { //we check to see if the field and player collide | |
player.pos.x -= control; // if they collide then we move our player position back | |
} | |
} | |
playerMove(-1); // the control is -1 | |
} else if (e.keyCode === 39) { // if right arrow is pressed |
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
document.addEventListener("keydown", (e) => { //this is a | |
if (e.keyCode === 37) { | |
function playerMove(control) { | |
player.pos.x += control; | |
if (collide(field, player)) { | |
player.pos.x -= control; | |
} | |
} |
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
document.addEventListener("keydown", (e) => { | |
if (e.keyCode === 37) { | |
function playerMove(control) { | |
player.pos.x += control; | |
if (collide(field, player)) { | |
player.pos.x -= control; | |
} | |
} | |
playerMove(-1); | |
} else if (e.keyCode === 39) { |
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 canvas = document.getElementById("tetris"); | |
const ctx = canvas.getContext("2d"); | |
const startButton = document.getElementById("start"); | |
const resetButton = document.getElementById("reset"); | |
const modal = document.getElementById("myModal"); | |
const instructionsButton = document.getElementById("instructions"); | |
const span = document.getElementsByClassName("close")[0]; | |
ctx.scale(20, 20); |
NewerOlder