This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- load script from CDN --> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> | |
<!-- if fails, fallback a local version --> | |
<script>window.angular || document.write('<script src="js/angular.min.js"><\/script>');</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function $_GET(param) { | |
var vars = {}; | |
window.location.href.replace( location.hash, '' ).replace( | |
/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp | |
function( m, key, value ) { // callback | |
vars[key] = value !== undefined ? value : ''; | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queryParameters = {}, queryString = location.search.substring(1), | |
re = /([^&=]+)=([^&]*)/g, m; | |
// Creates a map with the query string parameters | |
while (m = re.exec(queryString)) { | |
queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); | |
} | |
// Usage: Add new parameters or update existing ones | |
queryParameters['user_language'] = 'en'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sanitize_input($the_data){ | |
$the_data = stripslashes($the_data); | |
$the_data = strip_tags($the_data); | |
$the_data = htmlspecialchars($the_data); | |
$the_data = mysqli_real_escape_string($the_data); | |
$the_data = utf8_decode($the_data); | |
return $the_data; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Skeleton</title> | |
<link rel="stylesheet" href="css/style.css" /> | |
</head> | |
<body> | |
<script src="js/main.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$("#myfield").datepicker("destroy"); | |
var newMinDate = new Date( +new Date + days2ms(2) ); | |
$('#myfield').datepicker({ | |
minDate: newMinDate | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validarCP(cp){ | |
var regexp = /^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/; | |
return regexp.test(cp); | |
} | |
function validarEmail(mail) { | |
var regexp = /^[0-9a-z_\-\.]+@[0-9a-z\-\.]+\.[a-z]{2,4}$/i; | |
return regexp.test(mail); | |
} | |
function validarMovil(tlf) { | |
var regexp = /6\d{8}/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$protocol = empty($_GET['ssl']) ? 'http' : 'https'; | |
header("Location: " . $protocol . "://site.com"); | |
exit; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$postid = $wp_query->post->ID; | |
$id_video = $postid; | |
$query_tabla_videos = "SELECT * FROM videos WHERE id_video = '$id_video'"; | |
$results = $wpdb->get_results($query_tabla_videos); | |
foreach ($results as $row) { | |
$v_id_cat = $row->id_cat; | |
$v_fecha = $row->fecha; |