Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
</head>
<body>
<div id="fb-root"></div><script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class="fb-video" data-allowfullscreen="1" data-href="/lovewhatreallymatters/videos/vb.691679627521105/1097052790317118/?type=3"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/lovewhatreallymatters/videos/1097052790317118/"><a href="https://www.facebook.com/lovewhatreallymatters/videos/1097052790317118/">Too Much Cuteness</a><p>All aboard the cute train! :) #LoveWhatMatters Video courtesy of ViralHog</p>Posted by <a href="https://www.facebook.com/lovewhatreallymatters/">Love What Matters</a> on Monday, March 28, 2016</blockquote></div></div>
</body>
</html>
@zmcghee
zmcghee / close_open_html_tags.php
Last active July 6, 2016 21:30
Repair open HTML tags in a PHP string
<?php
/**
* Find unclosed HTML tags in a string and repair them.
* For example:
* $str = '<p>Hi, I\'m <b><a href="mailto:za ... ">Zack</a>';
* echo close_open_html_tags( $str );
* would show '<p>Hi, I\'m <b><a href="mailto:za ... ">Zack</a></b></p>'
*/
function close_open_html_tags( $str ) {
# Recursively find EPS files and convert them to PDF
find . -type f -name '*.eps' -print0 | while IFS= read -r -d '' file; do
pstopdf "$file"
done
# Recursively find PDF files and convert them to EPS
find . -type f -name '*.pdf' -print0 | while IFS= read -r -d '' file; do
sips -s format png --deleteColorManagementProperties --out "${file}.png" "$file"
done