Skip to content

Instantly share code, notes, and snippets.

View artlung's full-sized avatar
💭
🤖

Joe Crawford artlung

💭
🤖
View GitHub Profile
@artlung
artlung / RoanokeMenuExampleUsage.php
Last active October 26, 2023 21:53
I wanted to replace the text of my menu with font awesome icons so I created a new walker class to do replacements for links with specific outbound links. Not at all generic but I wanted to stash it. I'm sure there are better ways to do this.
<?php
// https://developer.wordpress.org/reference/functions/wp_nav_menu/
$args = [
'menu' => 'roanoke-menu-bar',
'container' => 'nav',
'container_class' => 'roanoke-menu-bar',
'container_aria_label' => 'Menu Bar',
'walker' => new RoanokeMenuWalker(),
];
@artlung
artlung / thumb.php
Last active September 27, 2023 15:04
Multiple Image Thumbnails - Command line PHP tool to generate image to represent multiple images
<?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
@artlung
artlung / sitemap.xml.php
Created October 14, 2009 21:42
Generate XML sitemap from list of urls
<?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
@artlung
artlung / artlung.basic
Last active April 28, 2023 02:19
A program to display ARTLUNG logo on a TI-99/4a
1 REM ARTLUNG START
2 REM TI-EXTENDED BASIC TI-99/4A
3 CALL CLEAR
9 REM
10 CALL CHAR(33, "0F1F7F7F7E7C7CFC")
11 CALL VCHAR(1, 1, 33)
12 CALL CHAR(34, "FCFFFFFFFFFFFFFF")
13 CALL VCHAR(2, 1, 34)
14 CALL CHAR(35, "7F7F7F7E7EFCFCFC")
15 CALL VCHAR(3, 1, 35)
<?php
/**
*
* This is a quick way to turn a simple text file
* with a very long list of urls in a text file (sitemap-urls.txt)
* Where "very long" is an expected url number greater than 10,000
* If loaded without a valid query parameter "page" it will load a
* Site Index site map, otherwise load the individual XML site map
* 10,000 urls into a valid XML Sitemap:
* http://en.wikipedia.org/wiki/Sitemaps
img.alignright {float: right;margin: 0 0 1em 1em;}
img.alignleft {float: left;margin: 0 1em 1em 0;}
img.aligncenter {display: block;margin-left: auto;margin-right: auto;}
a img.alignright {float: right;margin: 0 0 1em 1em;}
a img.alignleft {float: left;margin: 0 1em 1em 0;}
a img.aligncenter {display: block;margin-left: auto;margin-right: auto;}
@artlung
artlung / jquery-example.html
Created May 1, 2010 17:20
A simple hello world jQuery example
<html>
<head>
<title>My Sample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var new_num = 40; // global variable
jQuery(document).ready(function(){
http://api.jquery.com/css/
$('p').css({border: '5px solid red', color: 'green', padding: '20px'});
@artlung
artlung / RANDOM_CSS_javascript.html
Created February 11, 2010 02:20
Load a random CSS file
<!-- this will print one of these:
<link rel="stylesheet" type="text/css" href="css/bk1.css" />
<link rel="stylesheet" type="text/css" href="css/bk2.css" />
<link rel="stylesheet" type="text/css" href="css/bk3.css" />
<link rel="stylesheet" type="text/css" href="css/bk4.css" />
<link rel="stylesheet" type="text/css" href="css/bk5.css" />
<link rel="stylesheet" type="text/css" href="css/bk6.css" /> -->
<script type="text/javascript" src="RANDOM_CSS_javascript.js"></script>
<script type="text/javascript">
RANDOM_CSS.printlinktag();
@artlung
artlung / Onload-Event-ArtLung-Rosetta.html
Created September 21, 2009 23:56
JavaScript Onload Techniques
<script type="text/javascript">
/**
* Several different ways to calls an onload event
* first up, here's a function we will call using all the methods
*/
function artlungOnload() {
alert('The body of the document has loaded');
}
</script>
<html>
<head>
<title>Cursor Position Radius</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<style type="text/css" media="screen">
#square {
height: 400px;
width: 400px;
background-color: #000;
margin: auto;