Skip to content

Instantly share code, notes, and snippets.

View EstebanFuentealba's full-sized avatar
:octocat:

Esteban Fuentealba EstebanFuentealba

:octocat:
View GitHub Profile
@EstebanFuentealba
EstebanFuentealba / BBCL ETL
Created December 3, 2012 01:56
tabla dwh sabana de datos
drop table if exists bbcl_dwh;
/*==============================================================*/
/* table: bbcl_dwh */
/*==============================================================*/
create table bbcl_dwh
(
id int not null auto_increment,
post_author_id int,
post_date datetime,
@EstebanFuentealba
EstebanFuentealba / bd_futbol.sql
Last active September 5, 2017 14:57
Consulta SQL tabla posiciones de ANFP
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 13-03-2013 a las 01:22:41
-- Versión del servidor: 5.5.24-log
-- Versión de PHP: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@EstebanFuentealba
EstebanFuentealba / validate_rut.sql
Last active December 1, 2023 23:34
Función MySQL para validar RUT Chile, aplicando la formula del módulo 11
-- ##############################
-- @Autor: Esteban Fuentealba
-- @Email: efuentealba@json.cl
-- ##############################
DROP FUNCTION IF EXISTS validate_rut;
delimiter //
CREATE FUNCTION validate_rut (RUT VARCHAR(12))
RETURNS INT
BEGIN
DECLARE strlen INT;
jQuery.ajax({
url:"http://servel.biobiochile.cl/api/2013/presidente/PRE.json?callback=?&r="+Math.random(),
dataType:"json",
jsonpCallback:"PRE_BBCLServelRefresh",
success:function(json){
if(json.continue) {
/* acá codigo */
timerServel = setTimeout(fnServelUpdate, optionsServel.timer);
} else {
SELECT SUBSTRING_INDEX(email,'@',-1) , count(*) as 'total'
FROM votantes
GROUP BY SUBSTRING_INDEX(email,'@',-1)
ORDER BY total DESC
SELECT count(*) as 'total', ip
FROM votantes
<style>.bbcl_external_iframe_wrapper{display:block;margin:0 auto;overflow:hidden}.bbcl_external_iframe_container{margin-left:0;overflow:hidden;position:relative}.bbcl_external_iframe_container iframe{overflow:hidden}</style> <div class='bbcl_external_iframe_block' style='width: 619px; height: 1102px;'> <div class='bbcl_external_iframe_container' style='width: 619px;height: 1102px;'> <iframe class='bbcl_external_iframe_container' scrolling='no' frameborder='0' width='960' height='2155' src='http://www.topuniversities.com/university-rankings/world-university-rankings/2014#sorting=rank+region=349+country=355+faculty=+stars=false+search=' style='margin-top: -508px;margin-left: -0px;'></iframe> </div> </div>
"D:\RESPALDOS\JUEGOS\mohaa 1.11\MOHAA.exe" +set cl_playintro 0 +connect 190.153.188.176:12237
--
-- Disparador para borrar shtml
--
DROP TRIGGER IF EXISTS `beforeUpdatePostshtml`;
DELIMITER //
CREATE TRIGGER beforeUpdatePostshtml BEFORE UPDATE ON wp_posts FOR EACH ROW BEGIN
IF OLD.post_name != NEW.post_name
AND OLD.post_name != ''
AND NEW.post_type = 'post'
AND NEW.post_status = 'publish'