Skip to content

Instantly share code, notes, and snippets.


Joe Crawford artlung

View GitHub Profile
artlung / sitemap.xml.php
Created Oct 14, 2009
Generate XML sitemap from list of urls
View sitemap.xml.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:
* Put this file sitemap.xml.php and sitemap-urls.txt at
* the webroot
artlung / highlight-dow-jones-changes-2020.js
Last active Jun 26, 2020
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
for (var i = 0; i<tds.length; i++) {
var td = tds[i];
if (td.innerText.indexOf('2020-0') === -1) { = 0.3; =')', ',0.3)');
artlung / jquery-example.html
Created May 1, 2010
A simple hello world jQuery example
View jquery-example.html
<title>My Sample</title>
<script src=""></script>
<script type="text/javascript">
var new_num = 40; // global variable
$('p').css({border: '5px solid red', color: 'green', padding: '20px'});
artlung / smiley.html
Created Sep 7, 2010
Make a smiley face using only css+html
View smiley.html
<style type="text/css">
body {
font-family: helvetica, sans-serif;
div#wrapper {
width: 100px;
padding: 50px;
View sitemap-siteindex.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:
artlung / sitemap.column.xml.php
Last active Sep 9, 2019
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
* User: artlung
* Date: 2019-08-24
* A variation of :
* "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
View Report.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
.AlignLeft { text-align: left; }
.AlignCenter { text-align: center; }
.AlignRight { text-align: right; }
body { font-family: sans-serif; font-size: 11pt; }
img.AutoScale { max-width: 100%; max-height: 100%; }
View ventcheck_bot.json
"adjectives" : ["aback","abaft","abandoned","abashed","aberrant","abhorrent","abiding","abject","ablaze","abnormal","aboard","aboriginal","abortive","abounding","abrasive","abrupt","absent","absorbed","absorbing","abstracted","absurd","abusive","acceptable","accessible","accidental","accurate","acoustic","acrid","actually","ad","hoc","adamant","adaptable","addicted","adhesive","adjoining","adorable","afraid","agonizing","ahead","alcoholic","alert","alike","alive","alleged","alluring","aloof","ambiguous","ambitious","amuck","ancient","animated","apathetic","aquatic","aromatic","aspiring","assorted","astonishing","auspicious","available","average","aware","axiomatic", "bad","barbarous","bashful","bawdy","beautiful","befitting","belligerent","berserk","better","big","billowy","bizarre","black","boiling","boorish","boring","boundless","brash","brawny","breezy","brief","bright","broad","broken","bumpy","burly", "cagey","callous","capable","capricious","ceaseless","changeable","cheerful","childlike","chilly","chi
artlung /
Created May 19, 2010
Monte Carlo Python Program
"""Run a Monte Carlo simulation to validate the lottery example."""
import random
from lottery import winner, PEOPLE
def simulate(runs, f=winner, arg=PEOPLE):
"""Simulate function f with argument arg with number of given runs."""
# Store the number of results in a dict.
result_counts = {} # this is a dict
View Blah.php
// needed as a debugging shim
class Blah {
function ip() {
//ip from share internet
//ip pass from proxy
You can’t perform that action at this time.