Skip to content

Instantly share code, notes, and snippets.

View yurijserrano's full-sized avatar
🏠
Working from home

Yuri Serrano yurijserrano

🏠
Working from home
View GitHub Profile
@yurijserrano
yurijserrano / example.js
Created March 2, 2024 17:35
FIX - Page example
var express = require('express');
var app = express();
// Create JS object
const appData = {};
// Respond with JS object when a GET request is made to the homepage
app.get('/all', function (req, res) {
res.send(appData);
});
@yurijserrano
yurijserrano / starter.js
Last active March 1, 2024 04:40
Solution
// Empty JS object to act as endpoint for all routes
projectData = {};
// Express to run server and routes
const express = require('express');
// Start up an instance of app
const app = express();
// Cors for cross-origin allowance
@yurijserrano
yurijserrano / starter.js
Created March 1, 2024 04:26
Starter Code
/* Empty JS object to act as endpoint for all routes */
projectData = {};
// TODO-Express to run server and routes
// TODO-Start up an instance of app
// TODO-Cors for cross origin allowance
// Use express built-in middlewares for parsing JSON and URL-encoded request bodies
@yurijserrano
yurijserrano / app.js
Created February 27, 2024 00:28
NEW SOLUTION - The Default Action
document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('#ga-99cff7');
links.forEach(link => {
link.addEventListener('click', function(event) {
event.preventDefault();
console.log("Wow! We didn't navigate to a new page!");
});
});
});
@yurijserrano
yurijserrano / index-solution.html
Created February 20, 2024 18:20
Ordering Elements Demo - Exercise Solution
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Exercise 1</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport"/>
<style>
.container {
display: flex;
flex-direction: row-reverse; /* Changed from column to row-reverse */
@yurijserrano
yurijserrano / checkbox.html
Created February 18, 2024 08:37
Checkbox Example
<input type="checkbox" />
@yurijserrano
yurijserrano / form.html
Created February 18, 2024 08:05
Form - Example
<!DOCTYPE html>
<html>
<head>
<title>E-commerce Registration</title>
</head>
<body>
<h2>E-commerce Registration Form</h2>
<form action="/submit_registration" method="post">
import java.util.concurrent.TimeUnit;
public class Main
{
public static void main(String[] args) {
long startTime = System.nanoTime();
String word = "Hola mi nombre es Juri";
System.out.println("Result: " + vowelOnly(word));
long endTime = System.nanoTime();
long totalTime = (endTime - startTime);
import java.util.concurrent.TimeUnit;
public class Main
{
public static void main(String[] args) {
long startTime = System.nanoTime();
String word = "Hola mi nombre es Juri";
System.out.println("Result: " + vowelOnly(word));
long endTime = System.nanoTime();
long totalTime = (endTime - startTime);
@yurijserrano
yurijserrano / quizverification.java
Created September 12, 2019 16:23
Quiz - Verification
String respuesta = edtEditText.getText().toString().toUpperCase();
if(respuesta.equals("PERU") || respuesta.equals("PERÚ")){
return true;
}else{
return false;
}