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 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 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 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 .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" |