Skip to content

Instantly share code, notes, and snippets.

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

Dviejo Dviejopomata

🏠
Working from home
  • Alicante, Spain
View GitHub Profile
@Dviejopomata
Dviejopomata / xmltoupper.sql
Created October 31, 2016 07:20
xsl que convierte lo nombres de los elementos a mayusculas
declare
xml xmltype:= xmltype('
<root>
<a k="2">
<b j="2">aaa</b>
</a>
</root>
');
xsl xmltype:= xmltype(
'
@Dviejopomata
Dviejopomata / window_function.sql
Created November 23, 2016 19:49
Creacion de tabla e inserción de datos basicos.
create table importe (
mes BIGINT,
importe NUMERIC
);
INSERT INTO importe (mes, importe) VALUES (1, 112.26412311568856);
INSERT INTO importe (mes, importe) VALUES (2, 967.9190305285156);
INSERT INTO importe (mes, importe) VALUES (3, 369.8063183799386);
INSERT INTO importe (mes, importe) VALUES (4, 649.1722928583622);
INSERT INTO importe (mes, importe) VALUES (5, 609.3098058588803);
@Dviejopomata
Dviejopomata / cache.cs
Last active November 30, 2016 11:32
CACHE DE ACCESO DIRECTO Y LRU CACHE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cache
{
public class EntradaCache
{
@Dviejopomata
Dviejopomata / app.js
Created March 14, 2017 13:32
interceptor
<!DOCTYPE html>
<html lang="en-US">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<body>
<div ng-app="app" class="container">
<div ng-controller="Principal">
https://engineering.circle.com/https-authorized-certs-with-node-js-315e548354a2
https://alligator.io/angular/
https://www.quora.com/Which-is-the-best-choice-Node-js-Java-NIO-or-Go-Golang-Why
@Dviejopomata
Dviejopomata / dijsktra.ts
Last active September 22, 2017 09:32
dijsktra alghoritm in nodejs
class Graph {
public nodes: string[] = [];
public edges: { [key: string]: string[] } = {};
public distances: { from: string, to: string, distance: number }[] = [];
constructor() { }
public addNode(val: string) {
this.nodes.push(val);
return this;
}
public addNodes(...vals: string[]) {
f = (n) => {
var sumaConb = 0;
var c = 0;
for (var i = 0; i <= n; i++) {
var numerador = 1
var denominador = 1
for (var j = 0; j < i; j++) {
numerador *= (n - j)
denominador *= (j + 1);
c = c + 2;
@Dviejopomata
Dviejopomata / vicente.html
Created October 27, 2017 19:06
Ejercicio vicente
<html>
<body>
<input type="text" onkeyup="colorear(this.value)">
<div id="texto">texto 1
<br> texto 2</div>
<script>
#include "stdio.h"
#define ROWS 5
int* fn_input(){
static int intArr[ROWS];
int i;
// Requests users to enter the value for elements
for (i = 0; i< ROWS; i++) {
printf("Enter the value for array intArr[%d]:", i);
@Dviejopomata
Dviejopomata / server.js
Last active January 4, 2018 13:13
Dns server
var dns = require('native-dns');
var server = dns.createServer();
const secondaryDns = { address: "8.8.8.8", port: 53, type: 'udp' };
const hosts = [
{ name: "host1.nextagilesoftdev.com", address: "192.168.1.41", ttl: 6000 },
{ name: "host3.nextagilesoftdev.com", address: "192.168.1.8", ttl: 6000 },
{ name: "host4.nextagilesoftdev.com", address: "192.168.1.8", ttl: 6000 },
]
server.serve(53);