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.post('/person', function (req, res) { | |
| var personInfo = req.body; //Get the parsed information | |
| if (!personInfo.name || !personInfo.age || !personInfo.nationality) { | |
| res.render('show_message', { | |
| message: "Sorry, you provided worng info", | |
| type: "error" | |
| }); | |
| } else { | |
| var newPerson = new Person({ |
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
| <table class="table"> | |
| <tbody> | |
| <tr> | |
| <td *ngFor="let value of objects?.values(limit)"> | |
| {{ value }} | |
| </td> | |
| </tr> | |
| <tr *ngFor="let obj of data"> | |
| <ng-container *ngFor="let item of obj | keyvalue;"> | |
| <td *ngIf="objects?.keys(limit)?.includes(item.key)">{{ item.value }}</td> |
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
| import { useState } from "react"; | |
| import Message from "./components/Message"; | |
| import Motor from "./components/Motor" | |
| import Uhuy from "./components/Uhuy" | |
| const App = () => { | |
| let [data, setData] = useState({ | |
| name: "", | |
| items: [ |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <div> | |
| <input type="number" id="angka1" > |
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
| /** | |
| * Yanwar Solahudin | |
| * ================ | |
| * I built this simple code to implement the game logic of card combat and | |
| * using energy scores. I enjoyed it, and the code is rudimentary as it | |
| * needs to be updated to take advantage of the defense features and possibly | |
| * additional game logic if the cards go over two. | |
| */ | |
| let temmplatePlayer = { | |
| name: "", |
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 computedTotal = useMemo(() => { | |
| let sum = 0; | |
| if (itemSales.length > 0) { | |
| for (let item of itemSales) { | |
| sum += item.price * item.qty; | |
| } | |
| } | |
| setSale((values) => ({ ...values, total: sum })); | |
| return null; | |
| }, [itemSales]); |
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
| import { useEffect, useState } from "react"; | |
| import { Button, Form } from "react-bootstrap"; | |
| const POSPage = () => { | |
| const [total, setTotal] = useState(0); | |
| const [data, setData] = useState([ | |
| { | |
| id: 1, | |
| name: "Poduct 1", | |
| price: 10000, |
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
| // Aku akan menyelesaikannya nanti! | |
| // Fungsi yang berjalan paralel dengan fungsi lain disebut asinkron | |
| // set time out | |
| setTimeout(() => { | |
| document.getElementById("demo").innerHTML = "Urutan 1"; | |
| }, 3000); | |
| setTimeout(() => { | |
| document.getElementById("demo").innerHTML = "Urutan 2"; |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <input type="number" placeholder="Target BAB" class="targetBab" /> |
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
| var buttonEqual = document.querySelector(".equal"); | |
| var buttonDelete = document.querySelector(".delete"); | |
| var inputText = document.querySelector(".output"); | |
| var actions = document.querySelectorAll(".action"); | |
| var clear = document.querySelector(".clear"); | |
| let evals = []; | |
| buttonEqual.addEventListener("click", function () { | |
| let evaluate = inputText.value; | |
| let result = Function(`return ${evaluate}`); |