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 | |
* |
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
{ | |
"name": "artlung/parse-images-for-color", | |
"autoload": { | |
"psr-4": { | |
"Artlung\\ParseImagesForColor\\": "src/" | |
} | |
}, | |
"authors": [ | |
{ | |
"name": "Joe Crawford", |
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 | |
$defaultLink = 'https://tilde.club/~harper/link.html?action=join'; | |
$links = [ | |
'left' => [ | |
'url' => 'https://tilde.club/~harper/link.html?action=join', | |
'x1' => 0, | |
'y1' => 0, | |
'x2' => 129, |
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
<table width="100%" border="0" cellpadding="0" cellspacing="0"> | |
<tr valign="top"> | |
<td colspan="3" bgcolor="#534741"><img src="https://artlung.com/images/blank.gif" height="1" width="1" alt=""></td> | |
</tr> | |
<tr valign="top"> | |
<td align="left" width="33%" rowspan="2"> | |
<img src="https://artlung.com/images/20040604_artlung.gif" width="231" height="75" alt="artlung."> | |
</td> | |
<td align="center" width="33%" rowspan="2"> | |
<img src="https://artlung.com/images/20040613_farmer_joe.jpg" width="303" height="200" alt="in a hat to protect from the sun, making some sort of funny face."> |
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 Roanoke | |
*/ | |
class Roanoke { | |
// Note, this depends on every post having a post_image_count and post_link_count | |
public static function postStatsSentence() { | |
$number_of_published_posts = wp_count_posts()->publish; |
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 | |
$year = 2024; | |
$adult_days_and_prices = [ | |
'wed' => 59, | |
'thu' => 79, | |
'fri' => 79, | |
'sat' => 79, | |
'sun' => 54, |
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 | |
// By Joe Crawford joe@artlung.com | |
// September 2023 | |
// intended to be run from the command line | |
// php thumb.php | |
// place images in the same directory as this script and their names in the array below | |
// or place urls in the array below - filenames must be unique | |
// height and width of the final image, for now the math relies on everything being square |
NewerOlder