Skip to content

Instantly share code, notes, and snippets.

View stefany-newman's full-sized avatar

Stefany Newman stefany-newman

View GitHub Profile
@stefany-newman
stefany-newman / functions.php
Created January 5, 2020 21:43
functions.php for trucks.php
<?php
/*
Function courtesy of Chris McKee - https://gist.github.com/ChrisMcKee/1284052
Get sute URL with protocol (http or https)
*/
function siteURL()
{
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
@stefany-newman
stefany-newman / skip_link.html
Created December 12, 2019 19:05
Skip link (Bypass blocks) code
a {
text-decoration: none;
}
.container {
max-width: 1400px;
margin: auto;
}
#primary-nav .container {
padding: 0 10px;
@stefany-newman
stefany-newman / furbaby-header.html
Created December 2, 2019 22:39
furbaby-header.html
<header class="main">
<nav id="primary-nav" aria-label="Main Navigation">
<div class="container">
<a href="/" class="logo-holder">
<img class="logo" src="/assets/template/images/logo/logo.svg" alt="Homepage">
</a>
</div>
<button id="hamburger" aria-expanded="true">
<span>menu</span>
<span id="expanded">expanded</span>
@stefany-newman
stefany-newman / buttons.html
Created October 29, 2019 21:39
AMP buttons
<button on="tap:myVideo.play">
Play
</button>
<amp-video id="myVideo"
/* amp-video attributes */
></amp-video>
@stefany-newman
stefany-newman / amp-carousel-final-code.html
Created September 6, 2019 21:08
amp-carousel-final-code
@stefany-newman
stefany-newman / carousel-slide.html
Last active September 6, 2019 21:07
amp-carousel-slide
<?php
require 'scripts/functions.php';
$domain_name = domainName(); // Example.com
$siteURL = siteURL(); //https://example.com
// Message
/*
AMP boilerplate CORS code and setting the content type as JSON
Since all errors / sucess messages will be encoded in JSON
*/
@stefany-newman
stefany-newman / amp_email.html
Created July 4, 2019 22:19
AMP Email with a slider
<!doctype html>
<html ⚡4email>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
<style amp4email-boilerplate>body{visibility:hidden}</style>
<style amp-custom>
h1 {
margin: 10px;
<amp-list
src="https://fabulousnewwebsite.com/trucks.php"
layout="fixed-height"
height="200"
width="auto"
>
<template type="amp-mustache">
<div>
<a href="{{url}}">{{title}}</a>