Skip to content

Instantly share code, notes, and snippets.

View LuisFcoOrtiz's full-sized avatar
:shipit:
kept you waiting, huh

Luis Manrique LuisFcoOrtiz

:shipit:
kept you waiting, huh
View GitHub Profile
@LuisFcoOrtiz
LuisFcoOrtiz / Mysql.php
Last active November 18, 2016 16:10
PHP Class to connect with MySql and make querys | Clase PHP para conectar con MySql y relizar consultas
<?php
//Clase Mysql para la conexion con la base de datos
class Mysql {
private $conexion;
private $consultas_totales;
public function Mysql() {
if (!isset($this->conexion)) {
$this->conexion = (mysql_connect("ServerName","userName","userPass")) or die (mysql_error());
mysql_select_db("databaseName",$this->conexion) or die (mysql_error());
@LuisFcoOrtiz
LuisFcoOrtiz / tiempoAtmosferico.py
Last active January 4, 2017 12:48
Python parsing wheather XML | Python leyendo XML de AEMET tiempo atmosferico
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tiempoAtmosferico.py
#
# Copyright 2016 manrique <https:/github.com/luisFcoOrtiz>
#
from xml.dom import minidom
import urllib
@LuisFcoOrtiz
LuisFcoOrtiz / MainArrayBidimensional.java
Created January 12, 2017 14:54
Programa Java para Arrays bidimensionales
/*
* MainArrayBidimensional.java
*
* Copyright 2017 manrique <https:/github.com/luisFcoOrtiz>
*
*
*
*/
@LuisFcoOrtiz
LuisFcoOrtiz / FocusExample.java
Last active February 9, 2017 11:16
Ejemplo de Focus Listener (Visualización del foco en ventana Java) | Focus Listener Example (Show in a window where is the focus)
/*
* FocusEvent.java
*
* Copyright 2017 manrique <https:/github.com/luisFcoOrtiz>
*
*
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
@LuisFcoOrtiz
LuisFcoOrtiz / EventosRaton.java
Created February 10, 2017 15:09
Panel que registra los eventos del raton MouseListener JAVA | Panel for watch the mouse events MouseListener JAVA
/*
* EventosRaton.java
*
* Copyright 2017 manrique <https:/github.com/luisFcoOrtiz>
*
*/
import java.awt.*;
import java.awt.event.*;
@LuisFcoOrtiz
LuisFcoOrtiz / BackupFolder.sh
Last active July 3, 2018 18:11
(BASH)Copia de seguridad de una carpeta completa comprimiendo su tamaño | (BASH)Backup from a complete folder reducing his weight
#!/bin/bash
## make a backup from whole folder entry by argument##
## $1 only could be a folder or file ##
## For desscompress use tar -xvf file.tar.gz ##
actualDate=$(date +"%Y-%m-%d")
errorState=$?
folderPath="/home/manrique/BACKUPS"
tar -zcvf $folderPath/$1-$actualDate.tar.gz $1
##Check errors
if [ $errorState -eq 0 ]; then
@LuisFcoOrtiz
LuisFcoOrtiz / ConexionBD.java
Last active June 6, 2017 09:01
java class to connect with database (SQLITE) | Clase java para conexión con base de datos (SQLITE)
import java.sql.*;
import javax.swing.JOptionPane;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
@LuisFcoOrtiz
LuisFcoOrtiz / ReadXML.java
Last active November 16, 2017 19:19
Method to read XML file recursively |Método recursivo lectura de fichero XML
/*METODO RECURSIVO PARA LEER XML*/
/*Method to read XML file recursively*/
private void startReader(Node nodeEntry) {
NodeList nodeList = nodeEntry.getChildNodes();
for (int i=0; i<nodeList.getLength(); i++) {
//get the item
Node node = nodeList.item(i);
if (node.getNodeType()== Node.ELEMENT_NODE) {
@LuisFcoOrtiz
LuisFcoOrtiz / JTableUser.java
Created December 11, 2017 15:10
JTable component modified to get all element from ResultSet Query | Componente JTable modificado para recoger los datos de una sentencia ResultSet
import java.awt.Color;
import java.awt.Component;
import java.beans.SimpleBeanInfo;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import javax.accessibility.Accessible;
import javax.swing.JTable;
import javax.swing.Scrollable;
@LuisFcoOrtiz
LuisFcoOrtiz / ExportXML.java
Created December 18, 2017 14:50
Java class to export text to XML creating xml file | Clase Java para exportar texto a XML creando un fichero xml
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ejercicio8bdoracle;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;