Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🤖

Joe Crawford artlung

💭
🤖
View GitHub Profile
@artlung
artlung / artlung_results.txt
Last active January 9, 2022 20:12
I wanted to see if I could find earworms in my last.fm data which I've used more or less reliably for many years. Yes, I found some. Little Fluffy Clouds I'm pretty sure is an error - I made a playlist with just that and it ran over a weekend on a work computer. But the rest look pretty legit to me. Sequential plays of the same song over and over.
View artlung_results.txt
Found earworm on 2020-05-12: An Angry Thunderstorm by White Noise Meditation: played 238 times.
Found earworm on 2018-10-18: Little Fluffy Clouds (7" Edit) by The Orb: played 245 times.
Found earworm on 2018-10-18: Little Fluffy Clouds (7" Edit) by The Orb: played 25 times.
Found earworm on 2015-04-15: Johannesburg by Gil Scott-Heron: played 16 times.
Found earworm on 2015-04-15: Ring Capacity (Green Lantern Song) by Kirby Krackle: played 39 times.
Found earworm on 2015-04-15: Senses Working Overtime by XTC: played 23 times.
Found earworm on 2015-04-15: Ch-Check It Out by Beastie Boys: played 22 times.
Found earworm on 2015-04-15: She's An Angel (live) by They Might Be Giants: played 32 times.
Found earworm on 2015-04-15: Kansas by The Wolfgang Press: played 24 times.
Found earworm on 2015-04-15: A Real Hero (feat. Electric Youth) by College: played 29 times.
@artlung
artlung / inc.tracker.php
Created December 22, 2021 05:56
In 2010 when I was applying for jobs I added a little tracker chunk of php to any page I sent to recruiters so I could get a notification if they actually clicked through. It worked pretty well. Primitive and intrusive but also pretty funny.
View inc.tracker.php
<?php
define('TRACK', false);
function isSpider($HTTP_USER_AGENT) {
$spiders = array(
'Baiduspider',
'msnbot',
'youdao',
'YandexBot',
@artlung
artlung / make-git-lfs-commands.php
Created December 15, 2021 20:32
Git LFS command generator for my blog
View make-git-lfs-commands.php
<?php
$i = 2001;
$types = ['jpg', 'png', 'gif'];
$years = range(2001, 2021);
foreach ($years as $year) {
foreach ($types as $type) {
echo "git lfs track blog/wp-content/uploads/{$year}/**/*.{$type};\n";
}
View keybase.md

Keybase proof

I hereby claim:

  • I am artlung on github.
  • I am artlung (https://keybase.io/artlung) on keybase.
  • I have a public key ASBIdwaUOPWU_0J_rgMNDyNL1k6NuJdrZBcG2fgEjJeRawo

To claim this, I am signing this object:

@artlung
artlung / keybase.md
Created December 7, 2021 18:42
keybase.md
View keybase.md

Keybase proof

I hereby claim:

I am artlung on github. I am artlung (https://keybase.io/artlung) on keybase. I have a public key ASBIdwaUOPWU_0J_rgMNDyNL1k6NuJdrZBcG2fgEjJeRawo

To claim this, I am signing this object:

@artlung
artlung / words-legacy-template.php
Last active November 19, 2021 03:29
Words Legacy Template (for WordPress)
View words-legacy-template.php
<?php /* Template Name: Words Legacy Template */ ?>
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" <?php language_attributes(); ?>>
<head>
<title><?php echo wp_title('', false, 'left'); ?> : Joe Crawford (ArtLung.com)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<?php wp_head(); ?>
@artlung
artlung / ~filo-stanford-940520-bin-index.pl
Created April 11, 2021 19:30
~filo/stanford/940520/bin/index.html
View ~filo-stanford-940520-bin-index.pl
#! /usr/local/bin/perl
require 'ctime.pl';
require 'newgetopt.pl';
#require '/usr/local/lib/perl5/ctime.pl';
#require '/usr/local/lib/perl5/newgetopt.pl';
#require '/usr/local/lib/perl5/sys/socket.ph';
#
# ----> parse_hotlist <----
# takes a file (default /chronos/c1/jerry/.hotlist
@artlung
artlung / fixpermissions.sh
Created August 30, 2020 20:00
Set Permissions to 600 for all WordPress wp-config.php files
View fixpermissions.sh
# where /usr/home/username/public_html contains all your wordpress installs
# to run for the current directory and lower:
# find . -name wp-config.php | xargs chmod 600
find /usr/home/username/public_html -name wp-config.php | xargs chmod 600
@artlung
artlung / highlight-dow-jones-changes-2020.js
Last active June 26, 2020 07:13
Use this on the Wikipedia page for "List of largest daily changes in the Dow Jones Industrial Average"
View highlight-dow-jones-changes-2020.js
var tds = document.querySelectorAll('td');
// Use in the console for https://en.wikipedia.org/wiki/List_of_largest_daily_changes_in_the_Dow_Jones_Industrial_Average
for (var i = 0; i<tds.length; i++) {
var td = tds[i];
if (td.innerText.indexOf('2020-0') === -1) {
td.style.opacity = 0.3;
td.style.backgroundColor = td.style.backgroundColor.toString().replace(')', ',0.3)');
}
}
@artlung
artlung / sitemap.column.xml.php
Last active September 9, 2019 23:37
This is a quick way to turn a simple comma-separated file with a list of urls in each column representing one sitemap into a valid XML Sitemap:
View sitemap.column.xml.php
<?php
/**
* User: artlung
* Date: 2019-08-24
* A variation of https://gist.github.com/artlung/210438 :
*
* "I have a list of URLs in 10 columns of a CSV file and I need a separate
* sitemap for each column. Can we modify this code accordingly?"
*
* This is a quick way to turn a simple comma-separated file