Skip to content

Instantly share code, notes, and snippets.

@enlacee
enlacee / configurar-router-zf2.php
Created February 7, 2015 05:03
configuracion de router zf2
<?php
// http://localhost/iglesia-bb/public/persona/index/123
// http://localhost/iglesia-bb/public/persona/index/123/enlacee-
'router' => array(
'routes' => array(
'Persona' => array(
'type' => 'Literal',
'options' => array(
'route' => '/persona',
@enlacee
enlacee / asistemas.update01.txt
Last active August 29, 2015 14:15
asistemas.update01.txt
.ico-detail-see-more {
-webkit-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
top: 3px;
font-size: 18px;
}
@enlacee
enlacee / asistemas.update02.txt
Last active August 29, 2015 14:15
buscador, trigger, and config router
SEARCHS TABLE
------
0. id_search
1. id_user (users.id_user)
2. username (users.username_user)
2. name (profiles.name_profile + profiles.lastname_profile)
3. description (profiles.services_profile)
4. gender_profile (profiles.gender_profile)
@enlacee
enlacee / trigger-mysql-multiple.sql
Last active August 29, 2015 14:15
triggger mysql 5 multiple INSERT
USE asistemas;
DROP TRIGGER IF EXISTS MiTrigger;
DELIMITER |
CREATE TRIGGER MiTrigger AFTER INSERT ON asistemas.users
FOR EACH ROW
BEGIN
INSERT INTO asistemas.oauth_users (username, password, first_name, last_name)
@enlacee
enlacee / mysql-5.6-full-text.sh
Last active August 29, 2015 14:15
FULL TEXT Mysql 5.6
# TABLE
DROP TABLE IF EXISTS `searchs`;
CREATE TABLE `searchs` (
`id_search` int(11) NOT NULL AUTO_INCREMENT,
`username_user` varchar(45) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`services_profile` text,
`gender_profile` varchar(1) DEFAULT NULL,
`id_user` int(11) NOT NULL,
PRIMARY KEY (`id_search`,`id_user`),
@enlacee
enlacee / zf2-subquery-1.php
Created February 12, 2015 15:59
zf2-subquery-1
<?php
$text = '*'.$text.'*';
// subquery
$sql = new Sql($this->dbAdapter);
$mainSelect = $sql->select()->from('searchs');
$subQry = $sql->select()
->from('searchs')
@enlacee
enlacee / zf2-subqueyr-2.php
Created February 12, 2015 16:00
zf2-subqueyr-2
<?php
$text = '*'.$textParam.'*';
$id_district = (int) $district;
// subquery
$adapter = $this->table->getAdapter();
$sql = new Sql($adapter);
$mainSelect = $sql->select()->from('searchs');
$mainSelect->columns(
array(
'id_search',
@enlacee
enlacee / loanding.jquery.mobile.js
Last active August 29, 2015 14:17
load jquery mobile for tiny senconds
setTimeout(function(){
$.mobile.loading('show');
},100);
$( "header" ).fadeOut( 1, function() {
setTimeout(function(){
$( "header" ).fadeIn();
$.mobile.loading('hide');
},2000);
});
$str = 'https://www.google.com';
$str = preg_replace('#^https?://#', '', $str);
$str = preg_replace('#\/#', '', $str);
echo $str;
@enlacee
enlacee / str_mi_url.php
Last active August 29, 2015 14:17
urldecode, explode, strpos, substr
<?php
$urlImage = urldecode($urlImage);
$arrayImage = explode(_url_, $urlImage);
$pathImage = $arrayImage[1];
if (strpos($pathImage, '/',0) >= 0 ) {
$pathImage = substr($pathImage, 1,(strlen($pathImage)));
}