Skip to content

Instantly share code, notes, and snippets.

View ripper2hl's full-sized avatar
🎯
Focusing

Israel Perales ripper2hl

🎯
Focusing
View GitHub Profile
@ripper2hl
ripper2hl / pom.xml
Created November 23, 2015 23:32
Todo Java 6
<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>com.todo</groupId>
<artifactId>todo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>todo</name>
<description>lista de pendientes</description>
@ripper2hl
ripper2hl / pom.xml
Created November 23, 2015 23:28
Todo Spring Hibernate Jackson y H2
<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>com.todo</groupId>
<artifactId>todo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>todo</name>
<description>lista de pendientes</description>
<properties>
@ripper2hl
ripper2hl / pom.xml
Created November 23, 2015 23:23
Todo Agregando modulos de spring
<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>com.todo</groupId>
<artifactId>todo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>todo</name>
<description>lista de pendientes</description>
<properties>
@ripper2hl
ripper2hl / en-us.json
Created November 10, 2015 21:22
Archivo de traducciones para Clima
{
"nombre-app": "Clima",
"hecho" : "Done",
"buscar" : "Search",
"opciones" : "Options",
"cambiar-ubicacion": "Change location",
"ciudad": "City",
"opinion": "Request",
"acerca" : "About",
"evaluar" : "Review",
@ripper2hl
ripper2hl / app.js
Created November 3, 2015 01:05
Video with streams express 5
var express = require('express');
var app = express();
var fs =require('fs');
app.get('/video',function(req ,res){
var filePath = '';
console.log(filePath);
var stat = fs.statSync(filePath);
res.writeHead(200, {
'Content-Type': 'audio/mpeg',
@ripper2hl
ripper2hl / log4j.properties
Created October 26, 2015 22:46
Archivo comun de configuracion de log4j para java
log4j.rootLogger=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
@ripper2hl
ripper2hl / web.xml
Created October 23, 2015 15:05
Ejemplo de un web.xml para un proyecto de spring este archivo se encuentra en la carpeta projectName/WebContent/WEB-INF
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>applicationName</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
@ripper2hl
ripper2hl / pom.xml
Last active October 23, 2015 15:00
Ejemplo de un pom.xml de maven para un proyecto de spring y hibernate
<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>projectName</groupId>
<artifactId>projectName</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>projectName</name>
<description>projectName</description>
@ripper2hl
ripper2hl / applicationContext.xml
Created October 23, 2015 14:55
Archivo de configuracion de ejemplo de spring, debe ir en el directorio projectName/WebContent/WEB-INF/
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
@ripper2hl
ripper2hl / DividirCadena.js
Created October 14, 2015 18:55
Divide una cadena de texto cada N caracteres Ejemplo: texto 'cadena', numeroCaracteres '2' resultado ['ca','de','na']
/**
* Divide una cadena de texto cada N
* caracteres
* Ejemplo:
* texto 'cadena', numeroCaracteres '2'
* resultado ['ca','de','na']
* @param texto texto a dividir
* @param numeroCaracteres numero de caracteres para su division
* @author Jesus Perales.
*/