View shoot-sharing-image.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const imagemin = require('imagemin'); | |
const imageminPngquant = require('imagemin-pngquant'); | |
// Get the URL and the slug segment from it | |
const url = process.argv[2]; | |
const segments = url.split('/'); | |
const slug = segments[segments.length-2]; | |
(async () => { |
View ExternalLinkRenderer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Notist\Extensions; | |
use League\CommonMark\ElementRendererInterface; | |
use League\CommonMark\HtmlElement; | |
use League\CommonMark\Inline\Element\AbstractInline; | |
use League\CommonMark\Inline\Element\Link; | |
use League\CommonMark\Inline\Renderer\InlineRendererInterface; |
View mixed_article.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<perch:blocks> | |
<perch:before> | |
<div class="row"> | |
<div class="col-md-6 col-md-offset-3"> | |
</perch:before> | |
<perch:block type="text" label="Text"> | |
<perch:content id="text" type="textarea" markdown="true" editor="markitup" size="s" label="Text" /> | |
</perch:block> |
View flickr.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#eyebrow { | |
display: none; | |
} | |
#photo { | |
background-color: #333 !important; | |
} | |
body.with-eyebrow #global-nav { | |
top: 0 !important; | |
} | |
body.with-eyebrow { |
View archive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
perch_blog_date_archive_months('years.html', 'months.html'); | |
?> |
View gist:3848748
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture alt="<perch:content type="text" id="alt" label="Alt" />"> | |
<source src="<perch:content type="image" id="image" label="Image" width="800" />" media="min-width:800px"> | |
<source src="<perch:content type="image" id="image" label="Image" width="480" />" media="min-width:480px"> | |
<source src="<perch:content type="image" id="image" label="Image" width="200" />"> | |
<img src="<perch:content type="image" id="image" label="Image" width="480" />" alt="<perch:content type="text" id="alt" label="Alt" />"> | |
</picture> |
View slow_image_loader.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Artificially delay the loading of images to simulate a slow connection | |
<img src="/slow_image_loader.php?img=realimage.jpg" /> | |
*/ | |
$image = $_GET['img']; | |
// delay between 1 and 3 seconds | |
usleep(rand(1000000,3000000)); |