Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicola Pernice yumyo

View GitHub Profile
@yumyo
yumyo / font-stacks.css
Created Sep 12, 2020 — forked from don1138/font-stacks.css
CSS Modern Font Stacks
View font-stacks.css
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* A modern Georgia-based serif */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
View Fibonacci Sequence: first 23
{
"fibonacci": {
"0": 0,
"1": 1,
"2": 1,
"3": 2,
"4": 3,
"5": 5,
"6": 8,
"7": 13,
@yumyo
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 = _dl.search;
var _dr = _d.referrer;
// Initialize your data layer and start pushing variables from custom WordPress PHP data layer
@yumyo
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
<?php
/* ADD GTM TO HEAD AND BELOW OPENING BODY */
add_action('wp_head', 'google_tag_manager_head', 20);
function google_tag_manager_head() { ?>
<!-- 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);
View google-doc-cms-test.php
<?php
// This was a quick proof of concept from 2009, use the script freely - https://www.realisingdesigns.com/web-design-articles/using-google-docs-quick-easy-cms/
// Specify document
$gd_doc = "dd9zpc9r_4jh8qv76j";
$gd_doc_type = "doc";
$gd_array = array();
$gd_array["doc"]["url"] = "http://docs.google.com/View?id=".$gd_doc;
$gd_array["doc"]["start"] = '&lt;div id="doc-contents"&gt;';
@yumyo
yumyo / index.html
Created May 15, 2019
simple-landing
View index.html
<div class="img"></div>
<div class="hatch"></div>
@yumyo
yumyo / post-receive
Last active May 17, 2019
WP Dev/Test/Live ENV post-receive hook #devops
View post-receive
# The PROD directory
PROD="/var/www/main.domain/"
# The TEST directory
TEST="/var/www/test.domain/"
# The DEV directory
DEV="/var/www/dev.domain/"
# A temporary directory for deployment
TEMP="/home/[server_user]/temp-deploy/"
# The Git repo
REPO="/home/[server_user]/git-domain-bare/"
View WP-Autoload.php
<?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
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.
You can’t perform that action at this time.