Skip to content

Instantly share code, notes, and snippets.

View labra's full-sized avatar

Jose Emilio Labra Gayo labra

View GitHub Profile
# spring.h2.console.enabled=true
logging.level.org.hibernate.SQL=debug
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.database = MYSQL
spring.jpa.show-sql = true
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>es.uniovi.asw</groupId>
<artifactId>censusesN</artifactId>
<version>0.0.1</version>
<name>censusesN</name>
<packaging>jar</packaging>
<description>Censuses SubSystem</description>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>es.uniovi.asw</groupId>
<artifactId>votersN</artifactId>
<name>votersN</name>
<version>0.0.1</version>
curl -X POST -d "{ \"email\":\"[email protected]\", \"password\": \"jj\"}" -H "Content-type: application/json" http://localhost:8080/user
@labra
labra / formulario.js
Last active January 9, 2016 15:56
Ejemplo de formulario
var http=require('http');
var url = require('url');
var qs = require('querystring');
var server = http.createServer(function(req, res) {
switch (req.method) {
case 'POST': var body = '';
req.on('data', function(data) {
body += data;
if (body.length > 1e6) req.connection.destroy();
@labra
labra / servidor.js
Created January 9, 2016 14:01
Ejemplo Node
var http = require('http');
var procesa = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hola desde Node\n');
}
var server = http.createServer()
server.on('request',procesa);
server.listen(3000);
@labra
labra / pedido.xsd
Created January 9, 2016 00:52
Ejemplo XSD
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="pedido">
<xs:complexType>
<xs:sequence>
<xs:element name="producto" minOccurs="1" maxOccurs="3"
type="TipoProducto"/>
</xs:sequence>
<xs:attribute name="fecha" type="TipoFecha"/>
</xs:complexType>
</xs:element>
@labra
labra / pedido.dtd
Created January 9, 2016 00:35
Ejemplo de DTD
<!ELEMENT pedido (producto)*>
<!ELEMENT producto (nombre, cantidad,comentarios, precio?)>
<!ELEMENT nombre (#PCDATA)>
<!ELEMENT cantidad (#PCDATA)>
<!ELEMENT comentarios (#PCDATA)>
<!ELEMENT precio (#PCDATA)>
<!ATTLIST producto codigo CDATA #REQUIRED>
<!ATTLIST precio moneda CDATA #IMPLIED>
@labra
labra / pedido.xml
Created January 9, 2016 00:19
Pedido
<pedido>
<producto codigo="R23">
<nombre>Rotulador RX2</nombre>
<cantidad>20</cantidad>
<comentarios>Comprobad que escriben</comentarios>
</producto>
<producto codigo="G56">
<nombre>Grapadora Lin</nombre>
<cantidad>2</cantidad>
<comentarios>Envuelta para regalo</comentarios>
var http=require('http');
var server = http.createServer();
server.on('request', procesa);
server.listen(3000);
function procesa(request,response) {
console.log("URL solicitada = " + request.url);
response.setHeader("Content-Type", "application/json");
response.write("[{\"alumno\": 23, \"nota\": 8}, {\"alumno\": 34, \"nota\": 6}]");
response.end();