Skip to content

Instantly share code, notes, and snippets.

View ryan-k-t's full-sized avatar

Ryan Taylor ryan-k-t

View GitHub Profile
<html>
<head>
<style>
.with-sidebar {
display: flex;
flex-wrap: wrap;
margin: -1.5rem;
}
.sidebar, .not-sidebar {
margin: 1.5rem;
@ryan-k-t
ryan-k-t / styles.css
Created February 23, 2018 18:48
Horizontally Centered heading with vertically centered border
/**
as seen at https://www.smashingmagazine.com/2018/02/generated-content-grid-layout/
*/
.elem {
text-align: center;
display: grid;
grid-template-columns: 1fr auto 1fr;
grid-gap: 20px;
}
@supports (display: grid) {
@ryan-k-t
ryan-k-t / youtube_id_from_url.php
Created November 29, 2016 15:36
Get the Youtube ID
<?php
/**
* get youtube video ID from URL
* as found at http://stackoverflow.com/questions/6556559/youtube-api-extract-video-id
*
* @param string $url
* @return string Youtube video id or FALSE if none found.
*/
function youtube_id_from_url($url) {
$pattern =