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 | |
/** | |
* | |
* This is a quick way to turn a simple text file | |
* with a list of urls in a text file (sitemap-urls.txt) | |
* into a valid XML Sitemap: | |
* http://en.wikipedia.org/wiki/Sitemaps | |
* Put this file sitemap.xml.php and sitemap-urls.txt at | |
* the webroot http://example.com/sitemap.xml.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
function show(object,x,y) { | |
if (document.all && document.all[object]) { | |
document.all[object].style.left = x+'px'; | |
document.all[object].style.top = y+'px'; | |
document.all[object].style.zIndex = AlwaysTopmostZ; | |
document.all[object].style.color = '#000'; | |
AlwaysTopmostZ++; | |
document.all[object].style.visibility = 'visible'; | |
} | |
else if (document.layers && document.layers[object] != null) { |
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 | |
/* | |
Plugin Name: Customize Feed Content | |
Description: I'm looking for a theme-independent plug-in that will let me customize my blog post excerpts for my RSS feed. I would like to be able to show the featured image and customize the length of the preview, as well as add a link underneath the excerpt for a viewer to click on to see the original article. | |
Version: 1.0 | |
Author: artlung | |
*/ | |
class CustomizeFeedContent { | |
/** |
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
(Transcript made with HappyScribe.com) | |
[ NOTE: NOT FULLY COPYEDITED ] | |
https://about.flipboard.com/inside-flipboard/molly-white/ | |
[00:00:02.240] Welcome to Dotsocial, the first podcast to explore the | |
world of decentralized social media. Each episode, host Mike McHieu | |
talks to a leader in this movement, someone who sees the Fediverse's | |
tremendous potential and understands that this could be the internet's |
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 | |
$current_dir = dirname(__FILE__); | |
// load wordpress functions | |
require_once( $current_dir . '/../../../wp-load.php'); | |
$years = range(2001, date('Y')); | |
$ignored_permalinks = [ | |
'https://artlung.com/blog/2002/02/02/9309543/', |
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
<!-- | |
A div with an id of 'slideshow' contains five images, the first of which is shown and the others are hidden using a display style of none. Using Javascript, create a simple slideshow that cycles through the images, displaying each image for three seconds at a time, looping back to the first image when the end is reached. You cannot use jQuery or any other library. | |
--> | |
<body> | |
<div id="slideshow"> | |
<img src="http://placehold.it/300x200&text=foo1.jpg"> | |
<img src="http://placehold.it/300x200&text=foo2.jpg" style="display: none"> | |
<img src="http://placehold.it/300x200&text=foo3.jpg" style="display: none"> | |
<img src="http://placehold.it/300x200&text=foo4.jpg" style="display: none"> | |
<img src="http://placehold.it/300x200&text=foo5.jpg" style="display: none"> |
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
-- Let's say you had a table fruit | |
CREATE TABLE IF NOT EXISTS `fruit` ( | |
`id` int(11) NOT NULL auto_increment, | |
`blah` varchar(255) NOT NULL, | |
PRIMARY KEY (`id`) | |
); | |
-- Then you populate it, and delete some rows: | |
-- id, blah |
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
/** | |
* @param $text | |
* @param int $maxLength (default 200 characters) | |
* @param string $ending (characters to append to the end of the excerpt) | |
* @return string | |
*/ | |
function excerpt($text, int $maxLength = 200, string $ending = '...'): string | |
{ | |
// collapse whitespace | |
$text = preg_replace('/\s+/', ' ', $text); |
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 | |
/** | |
* UPDATE WORDPRESS LINKS DATABASE WITH FEED URLS via COMMAND LINE | |
* | |
* @author Joe Crawford | |
* @license MIT | |
* @version 0.1 | |
* @link https://artlung.com/ | |
* @date 2024-03-06 | |
* |
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 | |
/** | |
* Class RoanokeVisualization | |
* Creates a visualization of blog posts by year and month | |
* and breaks out posts, and posts with Instagram and Delicious tags | |
* | |
* Uses wp_get_archives to get the data | |
* Uses wp_cache to store the data from expensive operations | |
* |
NewerOlder