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;;;;;;
@goodevilgenius
goodevilgenius / reddit_rss_relinker.php
Last active October 26, 2017 14:16
[Reddit RSS Relinker] Modifies Reddit RSS feeds so that the links go to the original URL, rather than the comments page. Also adds author. Can optionally filter based on regular expressions. #RSS #Reddit
<?php
$url = $_GET['url'];
if (!preg_match('@http://(www\.)?reddit\.com/r/([A-Za-z0-9]+)\.rss@', $url)) {
header("HTTP/1.0 400 Invalid Reddit RSS URL");
exit;
}
@goodevilgenius
goodevilgenius / wordpress-rss-atom-updated.php
Last active February 3, 2020 11:09
[WP atom:updated] Wordpress Plugin to add atom:updated to rss feed #Wordpress #RSS
<?php
/**
* @version 0.1
*/
/*
Plugin Name: Atom:Updated
Plugin URI: https://gist.github.com/goodevilgenius/9786001
Description: This plugin adds atom:updated to your RSS2 feed
Author: Dan Jones
Version: 0.1
@goodevilgenius
goodevilgenius / membash.sh
Last active November 2, 2023 12:19 — forked from ri0day/memcache_cli.sh
[membash] BASH script which may be used to interact with memcache. All main memcache functions are supported. #memcache
#!/bin/bash
# Gist: 11375877
# Url: https://gist.github.com/goodevilgenius/11375877
#
# All memcache functions are supported.
#
# Can also be sourced from other scripts, e.g.
# source membash.sh
# MCSERVER="localhost"
@goodevilgenius
goodevilgenius / media-categories.php
Last active October 26, 2017 14:15
[WP Media Categories] Wordpress plugin to add categories and tags to media items #Wordpress
<?php
/**
* Plugin Name: Media Categories and Tags
* Plugin URI: https://gist.github.com/goodevilgenius/755bc2e7b78ee0b26890
* Description: Adds categories to media
* Version: 0.3.0
* Author: Dan Jones
* Author URI: http://danielrayjones.com/
* License: MIT
*/
@goodevilgenius
goodevilgenius / desc_to_cont_rss.php
Last active October 26, 2017 14:13
[RSS description to content] Transforms an RSS feed, making the content:encoded the same as description #RSS
<?php
/**
To use, place desc_to_cont_rss.php somewhere within your webroot. Then point your browser to http://localhost/desc_to_cont_rss.php?rss=http://example.com/feed.rss
Adjust the paths appropriately for your setup. You may need to urlescape the path to the feed, e.g. http%3A%2F%2Fexample.com%2Ffeed.rss
*/
$rss = $_GET['rss'];
if (empty($rss)) {
$http = "400 Bad Request";
@goodevilgenius
goodevilgenius / my_memory.php
Last active October 26, 2017 14:12
[MyMemory Translate] This PHP script will take the text from stdin, and pass it through the translation service at MyMemory. #translation
#!/usr/bin/php
<?php
$totranslate = file_get_contents('php://stdin');
if (strlen($totranslate) > 1500) {
file_put_contents("php://stderr", "Truncating text to 1500 characters");
$totranslate = substr($totranslate, 0, 1500);
}
@goodevilgenius
goodevilgenius / resume.md
Last active October 26, 2017 14:11
[My Résumé] in Markdown format #resume #work

Dan Jones


5501 Alderbrook Ct #5501 • Rockville, MD 20851
+1 (704) 326-1626 • dan@danielrayjones.com

Summary

Web developer with broad experience in both large (educational and commercial) and small(commercial) websites. Designed custom web applications from the ground up, and modified existing open-source applications to meet specific needs. Effective communicator, with experience researching and writing content for educational websites. Social media expertise maintaining Facebook and Twitter accounts for educational institution, and building Facebook applications.

@goodevilgenius
goodevilgenius / fortune_variety_quotes.py
Last active October 28, 2023 05:09
[Variety fortune plugin] Plugin for Variety background changer that uses the UNIX fortune program as a quotes source
#!/usr/bin/python
from variety.plugins.IQuoteSource import IQuoteSource
import subprocess, re
from locale import gettext as _
class FortuneSource(IQuoteSource):
@classmethod
def get_info(cls):
return {
@goodevilgenius
goodevilgenius / Screenshot.sh
Last active October 26, 2017 14:10
[Screenshots] Simple script to make screenshot of website and save to a directory (requires xvfb and cutycapt) #web #screenshots
#!/bin/bash
# Usage: /path/to/screenshot.sh /path/to/screenshot/directory http://url.com/
# To display on a website, use index.php (and http_build_url)
dir="$(readlink -f "$1")"
if [ ! \( -d "$dir" -a -w "$dir" \) ]
then
echo "$dir is not a valid writeable directory" >&2
exit 4