Skip to content

Instantly share code, notes, and snippets.

View nicescrollbasico.html
<!DOCTYPE html>
<html>
<head>
<title>Ejemplo de NiceScroll</title>
<meta charset="UTF-8">
<meta name="author" content="http://adritah.es">
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js"></script>
<script src="jquery.nicescroll.js"></script>
</head>
<body>
@jrbistuer
jrbistuer / script.sql
Last active Dec 26, 2015
script para el ejemplo de queries entre dos tablas
View script.sql
CREATE SCHEMA IF NOT EXISTS `test2` DEFAULT CHARACTER SET utf8 ;
USE `test2` ;
CREATE TABLE IF NOT EXISTS `test2`.`rol` (
`idRol` INT(11) NOT NULL AUTO_INCREMENT,
`Tipo` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`idRol`))
ENGINE = InnoDB
AUTO_INCREMENT = 1;
@jrbistuer
jrbistuer / adritah-hibernate.sql
Last active Dec 25, 2015
Archivo script de MySQL para utilizar en el ejemplo de Hibernate 4
View adritah-hibernate.sql
CREATE DATABASE IF NOT EXISTS `adritah_hibernate`;
USE `adritah_hibernate`;
DROP TABLE IF EXISTS `cliente`;
CREATE TABLE `cliente` (
`idCliente` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`nombre` varchar(45) NOT NULL,
`apellidos` varchar(45) NOT NULL,
PRIMARY KEY (`idCliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@jrbistuer
jrbistuer / pom.xml
Last active Dec 21, 2015
hibernate 4.0.1 example pom.xml
View pom.xml
<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>HibernateSample</groupId>
<artifactId>HibernateSample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>HibernateSample</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
View index.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, width=device-width, target-densitydpi=device-dpi" />
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="cordova-2.5.0.js"></script>
<script type="text/javascript" charset="utf-8" src="SamplePlug.js"></script>
<script type="text/javascript" charset="utf-8">
View plugin.java
package org.apache.cordova.plugin;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class Echo extends CordovaPlugin {
@Override
View callfromhtml.js
window.echo("echome", function(echoValue) {
alert(echoValue == "echome"); // should alert true.
});
View sampleplug.js
window.echo = function(str, callback) {
cordova.exec(
callback,
function(err) { callback('Nothing to echo.'); },
"Echo",
"echo",
[str]
);
};
@jrbistuer
jrbistuer / pauseListener.html
Last active Dec 15, 2015
This is a Phonegap Listener to a Native Mobile Event
View pauseListener.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, width=device-width, target-densitydpi=device-dpi" />
<title>Pausing an application</title>
<script type="text/javascript" src="cordova-2.5.0.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
@jrbistuer
jrbistuer / jQueryMobile.html
Last active Dec 14, 2015
This is a jQery Mobile layout simple sample
View jQueryMobile.html
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=screen.width; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>jQuery Mobile Layout</title>
<link href="jquerymobile/jquery.mobile-1.3.0.min.css" rel="stylesheet" type="text/css" />
<script src="jquerymobile/jquery.js" type="text/javascript"></script>
<script src="jquerymobile/jquery.mobile-1.3.0.min.js" type="text/javascript"></script>
<script src="cordova-2.5.0.js" type="text/javascript"></script>