Remote/Telecommute Job Resource

Let’s face it. It’s hard enough to find regular work these days, let alone remote or telecommute opportunities. There are web developers and other technology professionals all over the states who can’t just pick up and move to the nearest large city for a job. I, myself live in Rexburg, ID, a very small community with a strong distrust of expansion and a disappointingly ambiguous craigslist presence. While I love this little town for a myriad of reasons, it is not exactly a hot spot for tech professionals. Therefore, I find my work/clients elsewhere. How? With a great little service called Virtual Vocations.

Virtual Vocations is a fantastic resource for telecommute jobs (full and partial) as well as project listings for freelancers who work remotely. They pull in job listings from sources all over the web and list them by categories for easy browsing and searching. Registration is quick and affordable (around $6 per week) and they send email alerts with new positions every day. Services like this take much of the leg work out of job seeking and cut your travel costs substantially. I would recommend this service to anyone. And so I have ;)

WordPress: include custom fields in search?

While adding some features to Templ33t, I ran into a situation where I need certain custom fields to be searchable. I didn’t want to add any extra input fields to the search box (wouldn’t make sense in this context) or hack apart the query with a bunch of joins and conditions. A fair amount of searching through the codex and google yielded few results. After tinkering for a while, I came up with a simple (if hack-ish) solution.

Using the content_save_pre filter, I was able to append an identifiable HTML comment containing the custom field text to the page content. This makes the custom field text searchable as it is now, for all intents and purposes, part of the main content. It also allows you to be selective about which custom fields are included. The tag is then stripped before editing the page/post using the the_editor_content filter. Here is the code.

// add filter callbacks
add_filter('content_save_pre', 'myplugin_add_comment', 10);
add_filter('the_editor_content', 'myplugin_strip_comment', 1);

/**
 * Append custom field content to main content in comment form for searchability.
 * @param string $content
 * @return string
 */
function myplugin_add_comment($content = null) {
	
	if(array_key_exists('meta', $_POST) && !empty($_POST['meta'])) {
		
		$cfields = array('mycustom_text', 'mycustom_other', 'mycustom_etc');
		
		$append = '';
		
		$content .= '  '.$append;
		
	}
	
	return $content;
	
}

/**
 * Remove custom field comment from end of content before editing.
 * @param string $content
 * @return string
 */
function myplugin_strip_comment($content = null) {

	$content = preg_replace('/()/mi', '', $content);

	return $content;

}

This worked rather well for me but I realized that the matched text would not show up in the search results. This isn’t too big a deal if you’re not using  any keyword highlighting or similar functionality. In order to support those scenarios though, I modified the structure of the comment and attached a callback to the the_content filter which renders the comment as appended text to the post for search results (or strips it in any other context). Here is the new code.

// add filter callbacks
add_filter('content_save_pre', 'myplugin_add_comment', 10);
add_filter('the_editor_content', 'myplugin_strip_comment', 1);
add_filter('the_content', 'myplugin_content_filter', 1);

/**
 * Append custom field content to main content in comment form for searchability.
 * @param string $content
 * @return string
 */
function myplugin_add_comment($content = null) {
	
	if(array_key_exists('meta', $_POST) && !empty($_POST['meta'])) {
		
		$cfields = array('mycustom_text', 'mycustom_other', 'mycustom_etc');
		
		$append = '';
		
		$content .= '  '.$append;
		
	}
	
}

/**
 * Remove custom field comment from end of content before editing.
 * @param string $content
 * @return string
 */
function myplugin_strip_comment($content = null) {

	$content = preg_replace('/()/mi', '', $content);

	return $content;

}

/**
 * Transform custom fields comment into appended text for search results
 * @param string $content
 * @return string
 */
function myplugin_content_filter($content = null) {

	if(is_search()) {

		$content = preg_replace('/(::[A-Z0-9\_\-]+::)/i', ' ... ', preg_replace('/()/mi', '$2', $content));

	} elseif(is_page()) {

		$content = myplugin_strip_comment($content);
		
	}

	return $content;

}

I know this is not the most ideal or efficient solution, but it does work. I hope it helps!

Templ33t v0.1 released

I just tossed up the first version of my new wordpress plugin, Templ33t, which adds tabs to the page editor for custom content blocks you can define in templates for any theme.

Templ33t-Screenshot

It’s based on Page.ly‘s MultiEdit plugin, which was a great start to what I needed to get done. Take a look at the project page to see the documentation or download.

The devil’s domain registry

So my wife is sifting through the mail today and hands me a letter from the Domain Registry of America (I refuse to link to their site, you’ll see why). I open the envelope and glance over the official-looking “Domain Name Expiration Notice”. It seems to be a bill for one of my domain names that needs to be renewed in the next few months.

It's a TRAP!

My domain names are registered with GoDaddy, not with Domain Registry of America. I pay around $8/yr, not $30/yr. I do not need to renew my domain name with DRoA in order to “retain exclusive rights to” my domain name. Oh and all my domain renewal notices are paperless ;)

Needless to say, steer clear of these baddies. Google search is full of scam reports for these jerks. Don’t be their next victim. Here is a photo of the notice:

Moonlighting Tips…

I just read a great post on Tips for Incubating your Small Business Idea While Still Working Full-Time by Anita Campell. The section that caught me most was about setting aside a dedicated schedule for your startup. Time is never really on my side and I find it hard to stay focused on my personal projects while already spending hours on my day job. Anita’s post is full of good info. Props!

Securing a REST Web Service

At work, my latest assignment has been focused around creating web service functionality that mirrors the existing web application. I decided to use a REST based architecture. I’ve enjoyed the task thus far and feel I’ve been able to steer the app in a good direction. However, I began to fret over security. HTTP GET requests to a REST service leave data plainly visible and vulnerable. I needed to require a username and password for each transaction but didn’t want users to send them unencrypted via GET.

So instead of requiring a username/password combo for every transaction, I opted to minimize the number of times sensitive data is sent and package it more securely. I created an Authentication service that returns a transaction key when a valid username/password is posted to it. This transaction key expires 30 seconds after it is issued and can be used in place of authentication for any URI in the web service. Also, there is only one transaction key in the system for each user at any given time. When it is expired, a new key is generated upon request, replacing the old one.

Dark Knight

I FINALLY freed up enough time to go see the Dark Knight. I’m flabbergasted. They put together an amazing cast, some seriously gifted acting (with the exception of the Gyllenhaal girl) threw in a multitude of surprises, some fantastic effects and after all that… they couldn’t do something about that awful Batman voice? Rumor has it they actually ENHANCED it… why? Why would you do that?

Aside from the “rabid death gorrilla grunting”, the movie was amazing. If you haven’t seen it, just buy it when it comes out. It’s worth it. *nods*

Oh and the pencil trick… holy crap *shakes head*