Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🤖

Joe Crawford artlung

💭
🤖
View GitHub Profile
@artlung
artlung / README.md
Last active Feb 26, 2018
WordPress Graphical Post Count Visualization
View README.md
View javascript.trim.js
/* dumping here from an old blog post, untested! */
function trim(str) {
while('' + str.charAt(0)==' '){ str = str.substring(1, str.length); }
while('' + str.charAt(str.length-1)==' ') { str = str.substring(0, str.length-1); }
return str;
}
View html-css-lorem-ipsum-2010.html
<div class="aboveelshape">
&nbsp;
</div>
<div class="elshape">
Lorem Ipsum Dolor, 2010.
</div>
<div class="belowelshape">
@artlung
artlung / Canvas Hello World.html
Created Feb 20, 2010
<canvas> Hello World, thanks @miketaylr!
View Canvas Hello World.html
<html>
<head>
<script>
window.onload = function() {
var ctx = document.querySelector('#c').getContext('2d');
ctx.lineWidth = 20;
ctx.lineCap = 'square';
ctx.lineJoin = 'round';
ctx.strokeStyle = '#c9f'; // 'rgb(247, 63,20)';
ctx.strokeRect(10,10,346,230);
@artlung
artlung / rosetta-mouseovers.js
Created Feb 20, 2010
Rosetta Mouseovers NCJavaScript Example
View rosetta-mouseovers.js
// DOJO
dojo.query('#nav a:has(img)').forEach(function(item){
dojo.connect(item, 'onmouseover', function(e){
dojo.query('img',item).forEach("item.src = item.src.replace('-off','-over')");
});
dojo.connect(item, 'onmouseout', function(e){
dojo.query('img',item).forEach("item.src = item.src.replace('-over','-off')");
});
});
View .htaccess
php_value allow_url_fopen on
View Spider-wp-config.php-files.php
<?php
$paths = array(
// an array of paths to wp-config.php files
'example.com/blog/wp-config.php',
);
$root = "/usr/home/artlung/public_html/";
$index = 0;
$look_fors = array(
'DB_NAME',
View jwz.data
0416440 00 25 20 C4 00 02 68 02 74 18 00 04 02 00 0F FF .% ...h.t.......
0416460 FF FF FF FF FF B0 72 0E F6 24 97 6B 68 00 01 19 ......r..$.kh...
0416500 05 49 A9 C4 3C 86 5E 72 B7 14 71 FC 1E 05 1A 83 .I..<.^r..q.....
0416520 46 9E 1E 38 FF F3 22 C4 1D 0A D0 06 95 BE 08 84 F..8..".........
0416540 02 5D F2 8D E8 C4 18 F7 86 72 F3 EA 73 68 E4 2A .].......r..sh.*
0416560 0E BF FD CB 24 00 00 C2 7C 24 3A 33 5D 0F 8B BE ....$...|$:3]...
0416600 5E 4A F4 E8 BD 7A A4 A7 B7 FF F3 20 C4 19 0A A0 ^J...z..... ....
0416620 56 8D 9E 30 0A 02 16 13 D7 62 A8 BD 36 DE C5 8E V..0.....b..6...
0416640 14 D5 72 ED 55 15 26 DA 23 D3 00 04 E0 1D 31 D7 ..r.U.&.#.....1.
0416660 18 7A 38 05 95 6C 7A 84 F9 1A 0D F2 37 FF F3 20 .z8..lz.....7..
@artlung
artlung / .htaccess
Created Mar 2, 2010
Redirect blogger hosted feeds to wordpress style
View .htaccess
# Add these lines to .htaccess file:
Redirect permanent /feeds/posts/default?alt=rss http://mamasmoneysavers.com/feed/rss
Redirect permanent /feeds/posts/default http://mamasmoneysavers.com/feed/atom
Redirect permanent /feeds/ http://mamasmoneysavers.com/feed
View relativeDateString.php
<?php
/**
* Dates must be in the past
*/
function relativeDateString($other_date_string) {
$now = strtotime('now');
$other_date = strtotime($other_date_string);
$difference = $now - $other_date;
if ($difference <= 60) {
You can’t perform that action at this time.