Skip to content

Instantly share code, notes, and snippets.

View brunomertins's full-sized avatar

Bruno Mertins brunomertins

View GitHub Profile
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>
@brunomertins
brunomertins / Verwendung-von-html-Tags-SEO
Last active December 14, 2015 11:58
Die Verwendung von html-Tags
<h1>Titel 1.</h1>
<!--Die Teilüberschriften auf der nächsten Ebene sollten h2-Überschriften sein und so getagt werden-->
<h2>Teilüberschrift 1.1.</h2>
<!--Teilüberschriften zwischen zwei h2-Überschriften sollten h3-Überschriften sein und so getagt werden:-->
<h3>Teilüberschrift 1.1.1.</h3>
<!--In den meisten Fällen wird die Gliederung bis zu h2-Überschriften ausreichend sein.-->
@brunomertins
brunomertins / Spanish Acent Entity Codes
Created April 18, 2013 13:47
Quick Reference Spanish Accent Entity Codes
á --> &aacute;
é --> &eacute;
í --> &iacute;
ó --> &oacute;
ú --> &uacute;
ñ --> &ntilde;
<?php
//* Do NOT include the opening php tag
//* Enqueue sticky menu script
add_action( 'wp_enqueue_scripts', 'custom_enqueue_script' );
function custom_enqueue_script() {
wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/sticky-menu.js', array( 'jquery' ), '', true );
}
//* Reposition the secondary navigation menu
WITH
-- Subquery to define static and/or dynamic start and end date for the whole query
period AS (
SELECT
'20200220' AS start_date,
FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) AS end_date),
-- Subquery to prepare and calculate page view data
pages AS (
SELECT
user_pseudo_id,
WITH
-- Subquery to define static and/or dynamic start and end date for the whole query
period AS (
SELECT
'20200220' AS start_date,
FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) AS end_date)
SELECT
-- Event count per user (metric | the number of times an individual event (change event_name 'page_view' to event that needs to be counted) was triggered divided by amount of users)
COUNT(DISTINCT
CASE
SELECT
-- Date (dimension)
event_date AS date,
-- Year (dimension)
FORMAT_DATE('%Y', PARSE_DATE("%Y%m%d",
event_date)) AS year,
-- ISO Year (dimension)
FORMAT_DATE('%G', PARSE_DATE("%Y%m%d",
event_date)) AS iso_year,
-- Month of Year (dimension)
WITH
-- Subquery to define static and/or dynamic start and end date for the whole query
period AS (
SELECT
'20200220' AS start_date,
FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) AS end_date),
-- Subquery to prepare and calculate engagement data
engagement AS (
SELECT
COUNT(DISTINCT
WITH
-- Subquery to define static and/or dynamic start and end date for the whole query
period AS (
SELECT
'20200220' AS start_date,
FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) AS end_date),
-- Subquery to prepare and calculate user data
user AS (
SELECT
user_pseudo_id,
SELECT
-- event_date (dimension | the date on which the event was logged)
PARSE_DATE('%Y%m%d',
event_date) AS event_date,
-- event_timestamp (dimension | the time (in microseconds, UTC) at which the event was logged on the client)
TIMESTAMP_MICROS(event_timestamp) AS event_timestamp,
-- event_name (dimension | the name of the event)
event_name,
-- event_key (dimension | the event parameter's key)
(