This file contains 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 java.util.Scanner; | |
public class TiendaFrutas { | |
public static void main(String[] args) { | |
double kilosManzana = 0.0; | |
double precioManzana = 0.0; | |
double totalKilosVendidos = 0.0; | |
double totalDineroAcumulado = 0.0; |
This file contains 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
# Define the function sortList(<numbers>) | |
# <numbers> - List of numbers | |
# return the sorted list of <numbers> | |
def sortList(numbers): | |
# Create a empty list | |
sorted_numbers = [] | |
# Get the size of the list of numbers | |
size = len(numbers) | |
# Repeat `size` times | |
for i in range(size): |
This file contains 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
{ | |
"name": "App One PWA", | |
"short_name": "AppOnePWA", | |
"description": "Esta aplicación muestra como usar las PWA", | |
"icons": [ | |
{ | |
"src": "icon/android-chrome-192x192.png", | |
"sizes": "192x192", | |
"type": "image/png" | |
}, |
This file contains 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>My App</title> | |
</head> | |
<body> | |
<h1>Hello world!</h1> |
This file contains 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 { useReducer, useState } from "react"; | |
import "./styles.css"; | |
function useCounter() { | |
const [count, setCount] = useState(0); | |
return { | |
count, | |
increment() { | |
setCount(count + 1); |
This file contains 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 app = createApp` | |
source: https://randomuser.me/api | |
query: ${config => config.query} | |
context: ${data => data.results[0]} | |
id: ${config.id} | |
view: | |
-- | |
<h1 onclick="@click"> | |
Hola me llamo #firstname y tengo #age años | |
</h1> |
This file contains 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
function css(strings, ...values) { | |
return context => { | |
let text = ""; | |
for (let i = 0; i < strings.length; i++) { | |
text += strings[i]; | |
if (typeof values[i] === "function") { | |
text += `${values[i](context || {})}`; | |
} else { | |
text += `${values[i] || ""}`; | |
} |
This file contains 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
function makeObject(strings, ...values) { | |
let object = {}; | |
for (let i = 0; i < strings.length; i++) { | |
const key = strings[i].trim(); | |
if (key) { | |
const value = values[i]; | |
object[key] = value; | |
} | |
} | |
return object; |
This file contains 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
function ConcatenaYSuma(strings, ...values) { | |
const suma = values.reduce((suma, value) => suma + value, 0); | |
const texto = strings.join("*"); | |
return [texto, suma]; | |
} | |
const [texto, suma] = ConcatenaYSuma`a ${1} b ${2} c ${2 ** 10} d ${Math.cos(0)}`; | |
console.log(texto); // "a * b * c * d *" |
This file contains 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
`Hola ${name}, ¿Es cierto que tienes ${age} años?` | |
// TEXTO INYECCIÓN TEXTO INYECCIÓN TEXTO | |
// TEXTO: "Hola " | |
// INYECCIÓN: name | |
// TEXTO: ", Es cierto que tienes " | |
// INYECCIÓN: age | |
// TEXTO: " años?" |
NewerOlder