Skip to content

Instantly share code, notes, and snippets.

Nicola Pernice yumyo

Block or report user

Report or block yumyo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yumyo / datalayer.php
Created Nov 6, 2019
WordPress Google Tag Manager Data Layer
View datalayer.php
<!-- K Google Tag Manager Data Layer -->
<script type="text/javascript">
// URL toolbox - helps grabbing elements in the URL
var _d = document;
var _dl = _d.location;
var _dlp = _dl.pathname;
var _dls =;
var _dr = _d.referrer;
// Initialize your data layer and start pushing variables from custom WordPress PHP data layer
yumyo / wp-google-tag-manager
Created Nov 6, 2019 — forked from tankbar/wp-google-tag-manager
Add Google Tag Manager in WordPress with hooks and actions
View wp-google-tag-manager
add_action('wp_head', 'google_tag_manager_head', 20);
function google_tag_manager_head() { ?>
<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
View google-doc-cms-test.php
// This was a quick proof of concept from 2009, use the script freely -
// Specify document
$gd_doc = "dd9zpc9r_4jh8qv76j";
$gd_doc_type = "doc";
$gd_array = array();
$gd_array["doc"]["url"] = "".$gd_doc;
$gd_array["doc"]["start"] = '&lt;div id="doc-contents"&gt;';
yumyo / index.html
Created May 15, 2019
View index.html
<div class="img"></div>
<div class="hatch"></div>
yumyo / post-receive
Last active May 17, 2019
WP Dev/Test/Live ENV post-receive hook #devops
View post-receive
# The PROD directory
# The TEST directory
# The DEV directory
# A temporary directory for deployment
# The Git repo
View WP-Autoload.php
The MIT License (MIT)
Copyright (c) 2015 Twitter Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
yumyo / WP Objects
Created Jul 4, 2018
List of WP Objects structure (WP_Post, WP_Post_Type, WP_Term)
View WP Objects
WP_Post Object
[ID] => 50491
[post_author] => 520
[post_date] => 2016-10-18 19:00:46
[post_date_gmt] => 2016-10-18 18:00:46
[post_content] =>
[post_title] => Home
[post_excerpt] =>
[post_status] => publish
View gist:89d34fffe3e862ba13ed98556e4ad1f9
[ID] => 2849
[date] => 1505489663
[post_type] => post
[sticky] =>
[format] => image
[url] => http://mysite/mypost
[url_target] => _self
[title] => Lorem Ipsum is not simply random text.
[excerpt] => Contrary to popular belief, Lorem Ipsum is not simply random text.
yumyo /
Created Oct 9, 2017 — forked from paulirish/
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
yumyo / translate-service
Created Aug 14, 2017
WordReference as a Service AppleScript
View translate-service
on run {input, parameters}
set phrase to input as string
set phrase to quoted form of phrase
set from_lang to "en"
set to_lang to "it"
do shell script "open ''" & from_lang & to_lang & "'/'" & phrase
end run
You can’t perform that action at this time.