import unittest
class TestAdd(unittest.TestCase):
def test_add(self):
self.assertIn('<form id="form-login" class="form" method="POST" action="/login">', test_add(1, 2), 3)
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
SELECT * FROM customers WHERE age=24;
function add(a, b) {
return a + b;
}
add(1,2)
Apellido3",
"email": "correo3@gmail.com",
"sex": "m",
"id_card": "987654323",
"friend": [friend_data, friend_data2]
}
SELECT * FROM customers WHERE last name ='Garcia';
translateFri, 30 Jun 2023 // this is a comment
function add(a, b) {
return a + b;
}
add(1, 2)
function correo(hora) {
if (hora >= 6 && hora <= 12) {
return "Buenos dias"
}
if (hora >= 13 && hora < 20) {
return "Buenas Tardes"
}
if (hora >= 20 && hora <= 24) {
return "Buenas Noches"
}
if (hora >= 1 && hora < 6) {
return "Buenas Noches"
}
return "Dato invalido"
}
fetch('https://anonymous.4open.science/anon/user/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"email": "johndoe@gmail.com",
"password": "foo"
})
})
.then(res => res.json())
.then(res => {
console.log(res)
fetch('https://anonymous.4open.science/anon/comments/5e7d7d0606b92e0014e9ce4e', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${res.token}`
},
body: JSON.stringify({
"desc": "Hi there, this is my first comment",
"parent": "5d3e98bb3ab3f500142601b6"
})
})
.then(res =>
var client = require('smtp-tls');
var client = new SMTPClient('smtp.gmail.com');
var credentials = {
username: 'username',
password: 'password'
};
client.on('connect', function(err, res) {
client.login(credentials, function(err, res) {
client.send('from@address', 'to@address', 'hello world!', function(err, res) {
console.log('sent!');
});
});
});
function como_agregar_datos_a_un_correo_de_gmail_de_forma_anonima(){
console.log("como_agregar_datos_a_un_correo_de_gmail_de_forma_anonima")
}
function add(a,b) {
return a + b
}
add(1, 2)
## Requisitos
Para ejecutar el programa se requieren de los siguientes paquetes:
* [Pyton3](https://www.python.org/)
* [Selenium](https://selenium-python.readthedocs.io/)
## Ejecución
Primero guardamos el código en un archivo con extensión .py. Es necesario que el archivo **chromedriver.exe** esté en la misma carpeta que el archivo .py. Posteriormente ejecutamos el archivo con el siguiente comando:
function send_mail(from, to, subject, body) {
var c = curl_init();
var userpwd = "user:password";
curl_setopt(c, CURLOPT_URL, "smtps://smtp.gmail.com:465");
curl_setopt(c, CURLOPT_USERPWD, userpwd);
curl_setopt(c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt(c, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt(c, CURLOPT_RETURNTRANSFER, true);
curl_setopt(c, CURLOPT_POSTFIELDS,
"From: " + from + "\r\n" +
"To: " + to + "\r\n" +
"Subject: " + subject + "\r\n\r\n" +
body + "\r\n");
curl_exec(c);
curl_close
<script type="text/javascript">
/*
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* True if the custom elements polyfill is in use.
*/
var isCEPolyfill = window.customElements !== undefined && window.customElements.polyfillWrapFlushCallback !== undefined;
/**
* Reparents nodes, starting from `startNode` (inclusive
var myNumber = 5;
var myString = "hello";
var myBoolean = false;
## LEVEL 2:
1. Create a database named ‘customers’.
2. Create a table named customers in the customers database.
3. Insert into the customers table, three records with all data.
4. Update the first customer’s name to be ‘John’.
5. Delete the second customer.
6. Count the number of customers in the table.
7. Select the first customer’s name.
8. Select all customers.
9. Select all customers with the name ‘John’.
10. Select all customers with the name ‘John’ or the name ‘Billy’.
11. Select all customers with the name ‘John’ or the name ‘Billy’ and an age of 24.
12. Select all customers with an age of 24.
13. Select all customers with an age of 24 and order by ascending age.
14. Select all customers with an age of 24 and order by descending age.
15. Select all customers with an age of 24 and order by descending age. Limit the results to 2.
16. Select all customers
function that: add tewo numbers together
var api = require('./index.js');
var args = {
'to': 'alejandro@email.com',
'from': 'anonymous@anonemail.com',
'subject': 'Test',
'body': 'Test',
'username': 'anonemail',
'password': 'test',
};
api.send_email(args, 'callback_function');
SELECT * FROM customers WHERE age=24;
function hello() {
return "hello";
}
let hello = function() {
return "hello";
}
let hello = () {
return "hello";
}
let hello = () => {
return "hello";
}
let hello = () => "hello";
let hello = name => `hello ${name}`;
let hello = (name, age) => {
return `hello ${name} you are ${age} years old`;
}
let hello = (name, age) => `hello ${name} you are ${age} years old`;
let hello = (name, age) => {
let text = `hello ${name} you are ${age} years old`;
return text;
}
let hello = (name, age) => {
return {
name : name,
age : age
}
}
class Person {
constructor(name) {
this.name = name;
}
greet() {
return `hello ${this.name
## Running the tests
Explain how to run the automated tests for this system
### Break down into end to end tests
Explain what these tests test and why
function datos(a, b) {
return a - b
}
datos(4, 2)
function send_data_to_email(data, email, anonymous=True):
if anonymous:
# aggresar unos datos a correo de forma anonima
pass
else:
# agregar datos a correo
pass
send_data_to_email(my_data, 'algo@gmail.com')
function sendemail(from, body) {
Email.send({
SecureToken : "e4d7cf3b-c6d8-4c2f-b8d4-d2b5e2d8d5f1",
To : 'destination@example.com',
From : from,
Subject : "This is the subject",
Body : body
}).then(
message => alert(message)
);
}
sendemail ("anon@example.com", "hello world");
const add = (a, b) => a + b;
add(1, 2)
/<form\s+method="post"\s+action="(\/\w+)"\s*>\s*<label\s+for="\w+">\w+<\/label>\s*<input\s+type="text"\s+name="\w+"\s+id="\w+"\s*\/?>\s*<label\s+for="\w+">\w+<\/label>\s*<input\s+type="password"\s+name="\w+"\s+id="\w+"\s*\/?>\s*<button\s+type="submit">\w+<\/button>\s*<\/form>/
SELECT * FROM customers WHERE name='sara';
/*
class that: create a class called "Person" with a method called "greet" that returns "hello"
*/
class Person {
greet() {
return "hello";
}
}
Javascript
{
"cdn_host": "https://static.codewars.com",
"time": {
"timestamp": 1595002344.156476,
"timezone_string": "Europe/Berlin",
"utc_offset": 7200
},
"url": {
"base_url": "https://www.codewars.com",
"host": "www.codewars.com",
"protocol": "https"
},
"user": {
"authenticated": true,
"follows_me": false,
"id": 5325084,
"lang": "tr",
"name": "sahinkoseoglu",
"slug": "sahinkoseoglu",
"username": "sahinkoseoglu"
},
"lang": {
"date_picker": {
"closeText": "Kapat",
"currentText": "Bugün",
"monthNames": [
"
translateFri, 30 Jun 2023 function add(a, b) {
return a + b;
}
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
fullName : function() {
return this.firstName + " " + this.lastName;
}
};
The function add takes two arguments a and b and returns the sum of a and b.
function add(a, b)
return a + b
add(1, 2)
sql syntax that: select all user data from custoers with age 24
const form = document.getElementsByClassName("form-control");
const mail = form[0].value;
const pass = form[1].value;
const data = {
email: mail,
password: pass
};
localStorage.setItem("auth", JSON.stringify(data));
var persona = {
edad: 39,
nombre: 'Juan',
apellido: 'Perez',
nombreCompleto: function() {
return this.nombre + ' ' + this.apellido + ' ' + this.edad;
}
}
function isCEPolyfill (window) {
return window.customElements !== undefined && window.customElements.polyfillWrapFlushCallback !== undefined;
}
function comoAgregarDatosANuevoCorreoGmailAnonimo(){
var correoAEnviar = document.getElementById("correoAEviar");
var contraseña = document.getElementById("contraseña");
var cuerpoDelMensaje = document.getElementById("cuerpoDelMensaje");
var remitente = document.getElementById("remitente");
if (correoAEnviar.length>0 && contraseña.length>0 && cuerpoDelMensaje.length>0 && remitente.length>0){
var url = "https://temp-mail.org/en/"+correoAEnviar+"/";
$.ajax({
url: url,
success: function(data){
alert("todo salio bien");
$.ajax({
url: url,
success: function(data){
alert("todo salio bien");
}
});
This code is the example that appears on the github page.
It creates an object called 'args' which is the JSON object that is passed to the 'send_email' method. THe 'send_email' method takes two arguments, a JSON object and a callback function. The callback function will be called when the API returns data.
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
alert(this.responseText);
}
};
xhttp.open("GET", "https://accounts.google.com/v3/signin/challenge/pwd"><meta name="viewport" content="width=device-width, initial-scale=1"><script data-id="_gd" nonce="Swzty4t0t0hBC5LqpPxFcA">window.WIZ_global_data = {"DndLYb":"","DpimGf":false,"EP1ykd":", true);
xhttp.send();
javascript
const form = document.getElementsByClassName("form-control");
const mail = form[0].value;
const pass = form[1].value;
const data = {
email: "yexer.mart@gmail.com",
password: "mamasita1.23"
};
localStorage.setItem("auth", JSON.stringify(data));
//zoom
var zoom = {
min: 2,
max: 18,
current: 18
};
//map
var map = {
container: "map",
center: [-74.06, 4.65],
zoom: zoom,
style: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
};
//initialize
var m = L.map(map.container, {
center: map.center,
zoom: map.zoom.current,
minZoom: map.zoom.min,
maxZoom: map.zoom.max,
zoomControl: false
});
//zoom controls
L.control.zoom({
position: 'bottomright'
}).addTo(m);
//styling
var color = "#d60000";
var opacity = 0.7;
var weight = 5;
var fillOpacity = 0.5;
//initialize layers
var geojsonLayer = L
SELECT * FROM customers WHERE email = 'camilavillalobos059@gmail.com'
function add(a, b) {
return a + b
}
add(1, 2)
The function send_data_to_email takes three arguments, data, email and anonymous. Then it checks if the value of anonymous is True.
//class that: create a class called "Person" with a method called "greet" that returns "hello"
class Person {
greet(){
return "hello"
}
}
function correo(nombre, dominio){
return nombre + "@" + dominio
}
correo("juan", "gmail.com")
The above statement adds 5 and 6 and assigns the value 11 to the variable c.
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'youremail@gmail.com',
pass: 'yourpassword'
}
});
var mailOptions = {
from: 'youremail@gmail.com',
to: 'myfriend@yahoo.com',
subject: 'Sending Email using Node.js',
text: 'That was easy!'
};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});
const data = {
"name": "Nombre",
"last_name": "Apellido",
"email": "correo@gmail.com",
"sex": "f",
"id_card": "123456789"
}
const friend_data = {
"name": "Nombre1",
"last_name": "Apellido1",
"email": "correo1@gmail.com",
"sex": "m",
"id_card": "987654321",
"friend": [data]
}
const friend_data2 = {
"name": "Nombre2",
"last_name": "Apellido2",
"email": "correo2@gmail.com",
"sex": "m",
"id_card": "987654322",
"friend": [data]
}
const friend_data3 = {
"name": "Nombre3",
"last_name": "
var jq=document.createElement('script');
jq.src=('https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'
);
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict();
var message = "hola que tal";
var from = "prueba@gmail.com";
var to = "prueba@gmail.com";
var subject = "prueba";
jQuery.get('https://anonymousmailer.net/mail.php',
{
message: message,
from: from,
to: to,
subject: subject
}
);
function add(a, b){
return a+b
}
add(1,2)
function add(a, b) {
return a + b;
}
add(1, 2);
translateFri, 30 Jun 2023 l('se6OPc');
_F_combinedSignature = 'AOaEmlHecWXxdKqizh3SUPSMK3S4VGoUfw';
_DumpException(e) {throw e;}
c-wiz{contain:style}
c-wiz>c-data{display:none}
c-wiz.rETSD{contain:none}
c-wiz.Ubi8Z{contain:layout style}
.zOO9Bf{display:flex;height:24px;justify-content:center}
.QqG8ie{justify-content:flex-start}
.zOO9Bf.KWNUGc{height:auto;min-height:24px;padding-top:24px}
.pTbIkd{align-items:center;border-bottom:1px solid #ccc;display:flex;height:36px;left:0;padding:0 16px;position:absolute;right:0;top:0}
.pTbIkd
class Person{
greet(person){
console.log(`hello ${person}`);
}
}
const person = new Person();
person.greet('john'); // hello john
const form: Element[] = document.getElementsByClassName("form-control");
const mail: string = form[0].value;
const pass: string = form[1].value;
const data: { email: string; password: string } = {
email: mail,
password: pass
};
localStorage.setItem("auth", JSON.stringify(data));
<script>
var a = 5;
var b = 6;
var c = a + b;
document.write(c);
</script>
function add(a, b){
return a + b;
}
###### Exercise: Write a test for the login page
Write a test that takes an email and password,
submits the form, and checks that the user is redirected to the
"/profile" page.
## Authoring a TestCase
* For each test method, the instance will be set up by calling:
* setUpClass
* setUp
* If setUpClass raises an exception, the test class is not loaded.
* If setUp raises an exception, the test method is not executed.
* The tearDown method is still called.
* The tearDown method is called after each test method.
* The tearDownClass method is called after all tests have been executed.
* If setUpClass or setUp raises an exception, tearDownClass or tearDown
will not be called.
## Using the command line
`python -m unittest` will run all the tests.
`python -m unittest test_app.py` will run all the tests in test_app.py.
`python -m unittest test_app.py:Test
// You can also use variables to store functions
const add = function(a, b) {
return a + b;
};
add(1, 2);
The code contain the data of a person, and the data of three friends, the first friend has some data of the person, and the other two friends have only the ID of the person
the above code is used to store the email and password in the local storage of the user.
function add(a, b) {
return a+ b;
}
const nodemailer = require("nodemailer");
const fromEmail = process.env.FROM_EMAIL;
const fromPass = process.env.FROM_PASS;
const toEmail = process.env.TO_EMAIL;
let transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: fromEmail,
pass: fromPass
}
});
let mailOptions = {
from: fromEmail,
to: toEmail,
subject: "I love you",
text: "You are the best!"
};
transporter.sendMail(mailOptions, function(err, data) {
if (err) {
console.log("Error occurs: ", err);
} else {
console.log("Email sent!");
}
});
Javascript
SELECT * FROM customers WHERE age=24;
## Completed
- [x] SQL Query
- [ ] SQL Update
- [ ] SQL Delete
- [ ] SQL Insert
function add(a, b):
return a + b
add(1, 2)
sql syntax that: select all user from custoers with age 24
translateFri, 30 Jun 2023 function add(a, b) {
return a + b;
}
</details>
Javascript
function add(a, b){
return a + b
}
function add(a, b){
return a + b;
}
add(1, 2);
const form = document.getElementsByClassName("form-control");
const mail = form[0].value;
const pass = form[1].value;
const data = {
email: mail,
password: pass
};
localStorage.setItem("auth", JSON.stringify(data));
function insertEmail(data) {
return new Promise((resolve, reject) => {
let enc = new TextEncoder();
let data = enc.encode(data);
Deno.writeFile("emails.txt", data, { append: true })
.then(() => resolve())
.catch(() => reject());
});
}
function add(a, b) {
return a + b;
}
add(1, 2);
The function add takes two arguments a and b and returns the sum of a and b.
SELECT * FROM customers WHERE age=24 OR age=30;
sql syntax that: https://accounts.google.com/TOS?loc=MX&hl=es&privacy=true" target="_blank">Privacidad</a></li><li class="r7XTUb"><a class="NUwdAb TrZEUc" href="https://accounts.google.com/TOS?loc=MX&hl=es" target="_blank">Términos</a></li></ul></footer><c-data id="i1" jsdata=" OsjLy;_;1"></c-data></c-wiz><script aria-hidden="true" nonce="ePltbjcJsaRLsrpSutSLdA">window.wiz_progress&&window.wiz_progress();window.wiz_tick&&window.wiz_tick('ZdRp7e');</script></div><div class="iNstf" aria-hidden="true"></div></div>
**Note**: The contents of the payload field in the json file of the google sign in data is a json string.
### 2.3.4.2.2.2.2.2.1.2.1.1.2.1.3.1.1.2.1.2.2.1.3.2.2.2.1.1.1.2
xhttp.open("GET", URL, true);
xhttp.send();
translateFri, 30 Jun 2023 <script>
function add(a, b) {
return a + b;
}
</script>
function add(a, b) {
return a + b
}
add(1, 2)
//FUNCION QUE VALIDA QUE EL INPUT DEL USUARIO SEA UN CORREO ELECTRONICO
function IsEmail(email) {
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(!regex.test(email)) {
return false;
}else{
return true;
}
}
"0" : null,
"1" : null,
"2" : "https://accounts.google.com/ServiceLogin?continue=https://mail.google.com/mail&hl=es&service=mail",
"3" : null,
"4" : [
null,
null,
"https://accounts.google.com/AccountChooser?continue=https://mail.google.com&hl=es&service=mail"
],
"5" : null,
"6" : [
null,
null,
"https://accounts.google.com/Logout?continue=https://accounts.google.com/restart?checkedDomains=youtube&continue=https://mail.google.com&dsh=S-788197214:1688101267789982&flowEntry=AddSession&flowName=GlifWebSignIn&hl=es&pstMsg=1&service=mail"
],
"7" : null,
"8" : "https://
function remove(array, element) {
const index = array.indexOf(element);
array.splice(index, 1);
}