Skip to content

Instantly share code, notes, and snippets.

@enlacee
enlacee / index.php
Created March 29, 2016 05:51
ping to URLS *plugin sitemap*
<?php
/**
* instalar CURL
* BASH
* sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
*
* public function parse_request()
*/
} else if ($wp->query_vars['action_to'] == '-make') {
@enlacee
enlacee / anibal-xz.php
Created March 26, 2016 21:01
Plugin de prueba: agregar y eliminar el campo countries al instalar y desintalar
<?php
/**
* Plugin Name: Anibal XZ
* Plugin URI: http://acopitan.blogspot.com
* Description: Test register and unregister data:options.
* Version: 1.0.0
* Author: Anibal C
* Author URI: http://acopitan.blogspot.com
* License: GPL2
*/
<?php
$str = "<p>texto p1</p>" .
"<p>texto p2</p>" .
"<ul>" .
"<li>lista 1</li>" .
"<li>lista 2</li>" .
"</ul>";
if (preg_match('%(<p[^>]*>.*?</p>)%i', $str, $regs)) {
$r = $regs[1];
# ! /bin/bash
# create backup
# comprimir:
# tar -zcvf /home/Escritorio compress.tar.gz
# descomprimir:
# tar -zxvf merge.esika.tar.gz -C /home/anb/Documentos/
BASE="$HOME/Escritorio"
ME_DATE=`date +%Y-%m-%d:%H:%M:%S`
@enlacee
enlacee / buscar-array.php
Created February 4, 2016 20:38
buscar en array
$search_array = array(
'role' => '',
'region' => '',
'parent' => '',
'title' => '',
'id' => ''
);
if (array_key_exists($key, $search_array)) {
@enlacee
enlacee / gist:f10e2b87b92ba56d46db
Created January 21, 2016 22:55
share with javascript *facebook and twitter* BY QA
/*
* button share *meencantaloqueveo*
*/
popup = function(t, e) {
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
var $t = t, _href = "";
if ($t.getAttribute('data-href')) _href = $t.getAttribute('data-href');
else _href = $t.getAttribute('href');
@enlacee
enlacee / mobile
Created January 13, 2016 23:47
mediaquery
@media (min-width: 320px) and (max-width:768px){
}
@media (min-width: 360px) and (max-width:768px){
}
@media (min-width: 375px) and (max-width:768px){
// function.php
add_action('wpcf7_posted_data','saveExtraFieldForContantForm7');
/**
* Save new input *origin-device* for Contact Form 7
*/
function saveExtraFieldForContantForm7($posted_data)
{
require_once dirname(__FILE__).'/includes/class/Mobile_Detect.php';
$detect = new Mobile_Detect();
//add_action("wpcf7_before_send_mail", "wpcf7_do_something");
function wpcf7_do_something($WPCF7_ContactForm)
{
if (/*224 == $WPCF7_ContactForm->id()*/ $WPCF7_ContactForm->id() > 0) {
//Get current form
$wpcf7 = WPCF7_ContactForm::get_current();
// get current SUBMISSION instance
@enlacee
enlacee / evento.delegate.js
Created December 15, 2015 15:48
delegate jquery
// relacionar evento click
$('.lista-preguntas').delegate('p', 'click',function(e) {
var $ver = $(this).parent().find('a.ver-mas');
$ver[0].click();
});