View .zshrc
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
alias c="clear" | |
alias zls="clear; ls -lash" | |
alias zgit="clear; git log --oneline --all --graph; git branch -vva; git status" | |
alias zpull="git pull origin" | |
alias zcommit="git add --all; git commit -am" | |
alias zpush="git push origin" | |
alias zupdate="git add --all; git commit -am update; git push origin --tags" | |
alias zdocs="clear; cd $HOME/Documentos" | |
alias zdown="clear; cd $HOME/Downloads" | |
alias zrepos="clear; cd $HOME/Documentos/Repositorios" |
View dataLayer-event-variable
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() { | |
for (var i=0; i<dataLayer.length; i++) { | |
if (dataLayer[i][0]==='event' && dataLayer[i][1]==='view_item') { | |
return dataLayer[i][2].items[0].id; | |
} | |
} | |
} |
View wp-code-snippet-gtm
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
add_action( 'wp_head', function () { ?> | |
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | |
})(window,document,'script','dataLayer','GTM-XXXXXX');</script> | |
<!-- End Google Tag Manager --> | |
<?php } ); |
View cors.php
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
header("Content-Type: application/json;charset=utf-8"); | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Headers: Content-Type, Authorization"); | |
header("Access-Control-Allow-Methods: POST, OPTIONS"); | |
header("Allow: POST, OPTIONS"); | |
$method = $_SERVER['REQUEST_METHOD']; | |
if ($method == "OPTIONS") { | |
die(); | |
} |
View Debug.php
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
/** | |
* require_once __DIR__ . '/inc/debug.php'; | |
* $debugger = new Debug(true); | |
*/ | |
class Debug | |
{ | |
public function __construct($debug) | |
{ | |
if ($debug) { | |
ini_set('display_startup_errors', 1); |
View Cifrado de datos en PHP
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 | |
$plaintext = "test@test.com"; | |
$key = "secret"; | |
$method = "AES-256-CBC"; | |
$iv_length = openssl_cipher_iv_length($method); | |
$iv = openssl_random_pseudo_bytes($iv_length); | |
$ciphertext = openssl_encrypt($plaintext, $method, $key, OPENSSL_RAW_DATA, $iv); | |
$ciphertext = base64_encode($iv . $ciphertext); |
View Click_Logger
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
<script> | |
console.log('[@][click:element]', {{Click Element}}); | |
console.log('[@][click:id]', {{Click ID}}); | |
console.log('[@][click:classes]', {{Click Classes}}); | |
console.log('[@][click:text]', {{Click Text}}); | |
console.log('[@][click:url]', {{Click URL}}); | |
console.log('[@][click:target]', {{Click Target}}); | |
</script> |
View Event_FB
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
<script> | |
fbq('trackCustom', '{{Event}}'); | |
console.log('[@][event:fb]', '{{Event}}'); | |
</script> |
View Event_Controller
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
<script> | |
window.dataLayer = window.dataLayer || []; | |
var botones = document.querySelectorAll('.btn'); | |
var botones_ = [ | |
['LIKE', 'boton_like'], | |
['CONTACT', 'boton_contact'] | |
]; | |
botones.forEach(function (boton) { | |
var href = boton.getAttribute('href'); | |
var target = boton.getAttribute('target'); |
View Event_DV
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
<script> | |
var event = '{{Event}}'; | |
if (event === 'productViewEvent') { | |
event = 'DC-XXXXXX/1/mcb-01+standard'; | |
} else if (event === 'checkoutEvent') { | |
event = 'DC-XXXXXX/1/mcb-02+standard'; | |
} else if (event === 'paymentSuccess') { | |
event = 'DC-XXXXXX/1/mcb-03+standard'; | |
} | |
gtag('event', 'conversion', { |
OlderNewer