Shouts & Hollers is an online "ezine" of sorts that is published by Charleston, WV, area bloggers. Bill Gardner got in contact with me to answer a few questions regarding a recent sideproject of mine. Read it here.
Thanks Bill!
For a new project I've been working on, I needed to pull the image attachments from all incoming mail, store them separately. I couldn't find any snippets online for this so I had to create my own. Here's what I came up with. As always, it's a bit rough but is a [...]
I've had a lot of requests to turn some of my Twitter apps into mobile services. Most companies, like Twitter itself, use Short Codes (like 40404) to accept and send txt/sms messages. Short codes are very expensive (the cheapest solution I found started at $500 per month for a randomized short code of [...]
Just to keep my blog semi updated (seems I'm just letting this place collect dust), here's what I'm working on for today. This design won't be used. I liked where it was going, the client didn't. Figured I'd share it before I toss it. Also, I'm working on something new for this blog. It [...]
After a week or so of very hard work, we decided trying to clean everything up and restore the house was a futile attempt. Everything we really wanted to save/couldn't afford to replace immediately was cleaned up, boxed, and stored at my brother's house. After a couple weeks of cleaning and boxing, the [...]
A friend needed to push/send items from an RSS feed to his Twitter account. Here's the code in a nice .zip file. Very simple and rough, but it gets the job done nicely. Feel free to add to/modify. http://kevinsmithdesigns.com/blog/wp-content/uploads/KSDtwitter.zip
Shouts & Hollers is an online "ezine" of sorts that is published by Charleston, WV, area bloggers. Bill Gardner got in contact with me to answer a few questions regarding a recent sideproject of mine. Read it here.
Thanks Bill!
We've been working with Flash in my Intro to Computers in Art class and I wanted to play with with Flash a bit more than the assignment I've been working allowed me to (even though the assignment has allowed me to play and learn quite a lot, a clock wouldn't be able to fulfill its requirements). I searched around and found a basic tutorial on how to create a very basic clock and I went from there. I didn't want to simply do numbers so I quickly plopped out another idea. Here's a very simple, very ugly clock that depicts the way most 9-5 people spend their waking hours.
The assignment: "Create a vector-based self-portrait. Using the photographs we've taken in class as a guide, make a vector-based self-portrait with Adobe Illustrator. The object of this project is to be as visually detailed and honest as is possible while using only strokes and shapes. Illustrator-based effects such as blurs, blends, and gradients are not permitted. Strokes and shapes - that's all. Your primary tools in this project will be the pen tool (and its subtools), the pencil tool, and, possibly, the brush tool."
I enjoyed it for the most part. I plan on delving into Illustrator a bit more when I get time.
I also have quite a few pieces from my ceramics class that I recently fired. I'll try to get some pictures of those when I can.
Oh yeah -- Woot for Obama. His speech was very powerful -- it almost brough a tear to my eye bahaha. I don't know if I was just feeling very wimpy last night or if his words were just that powerful. I'm going to say it was a mixture.
I just realized I haven't shared any of the stuff I've done since I've been back in school. Here are two pieces created within the past few weeks.
This first one was a project for a class. Here's an excerpt of the requirements: "This project is conceptually simple - create a new creature in Photoshop. This can be anything from an animal hybrid, something impossibly cute, or a scary monster. Using the skills you've acquired so far and developing few more, you must make the image visually convincing. There should be no visual clues that the photograph is a construction. Your creature must be situated in its natural habitat (swamp, sewer, house, street, forest, zoo, science lab, alien landscape, Applebees, etc.)
I took an image of a market, elephant, and goose to create this:
And this is a project I did outside of class because the text and class assignments didn't cover tool manipulation in great detail -- I wanted to play, basically.

Update: To prevent any confusion the code highlighter might cause in the post, I added a plain text version of this post here.
I noticed a lot of sites allow user submitted content but prevent autolinking of urls. Some of the most common instances of this are on Twitter sites (much like my own creation: SecretTweet.com). So I threw together a function to autolink urls:
<? $text= 'Hey go to google.com moo http://google.com moo www.google.com moo http://wwww.google.com/404.php moo'; function linkify(&$text) { //CONVERT *://.* TO LINK (EG HTTP://KEVINSMITHDESIGNS.COM) $text = ereg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "\\0", $text); //CONVERT *://*.* TO LINK (EG HTTP://WWW.KEVINSMITHDESIGNS.COM) $text = ereg_replace("(^| )(www([.]?[a-zA-Z0-9_/-])*)", "\\1\\2", $text); return $text; } echo linkify($text); ?>
Would return "Hey go to google.com moo http://google.com moo www.google.com moo http://wwww.google.com/404.php moo".
And since I made this primarily for Twitter, the following will linke @ replies automatically, too:
<? $tweet = "Hey @mozunk! Go check out http://digsby.com -- I think you will like it."; function twitterify(&$tweet) { //CONVERT *://.* TO LINK (EG HTTP://KEVINSMITHDESIGNS.COM) $tweet = ereg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "\\0", $tweet); //CONVERT *://*.* TO LINK (EG HTTP://WWW.KEVINSMITHDESIGNS.COM) $tweet = ereg_replace("(^| )(www([.]?[a-zA-Z0-9_/-])*)", "\\1\\2", $tweet); //LINK @USERNAME $tweet = preg_replace('/([\.|\,|\:|\¡|\¿|\>|\{|\(]?)@{1}(\w*)([\.|\,|\:|\!|\?|\>|\}|\)]?)\s/i', "$1@$2$3 ", $tweet);return $tweet; } echo twitterify(&$tweet); ?>
Would return "Hey @mozunk! Go check out http://digsby.com -- I think you will like it."
I'll be implementing this into SecretTweet pretty soon. I haven't decided if I want to autolink URLs or not...maybe just @replies.
---
automatically link urls php
autolink @ replies Twitter automatically link php
What we're doing: turning the .php extension into .whatever
Why we're doing this: security, seo, or because you want to (then you'll have to answer why for yourself)
How to do this:
In your .htaccess file, we're going to tell apache to parse your choice of a single or multiple .whatevers as php.
So if we wanted to parse .html files as php, we would do something like this:
AddType application/x-httpd-php .html
And if we wanted to parse .bunnyboyfoofoo files as .php:
AddType application/x-httpd-php .bunnyboyfoofoo
And if we wanted to parse .bunnyboyfoofoo, .html, .htm, .py, .kevinsmith, .google files through php:
AddType application/x-httpd-php .bunnyboyfoofoo .html .htm .py .kevinsmith .google
Simple and fun to play with if you're that type of person.
PS:Â Sorry it has been so long since my last update...it's summer, I've been enjoying it.
Just to compare two of the different ways to effectively do a proper redirect...
PHP:
(old.php)
<? header ('HTTP/1.1 301 Moved Permanently'); header('Location: http://kevinsmithdesigns.com/new.php'); exit; ?>
.HTACCESS
Redirect 301 /old.php http://www.kevinsmithdesigns.com/new.php
--------------
I much prefer .htaccess so you can delete old.php and keep track of all redirects via one file (.htaccess).
.htaccess is also probably the safest way to redirect (if you're the SEO conscious type)
Strip all symbols and other non a-z, 1-0 characters from a string using the handy-dandy ereg_replace.
<?php $before= "First !@#$%^&*() Middle _+:?><|} Last"; $after= ereg_replace("[^A-Za-z0-9] ", "", $before); echo $after ?>
And the output would be:
"First Middle Last"
---
This is very basic but I see a lot of people going about this the long way around with snippets that are 10-15 lines long (when they only need to be one)...
Aken pointed out a mistake I made.
I had ereg_replace("[^A-Za-z0-9]", "", $before); when it should be ereg_replace("[^A-Za-z0-9] ", "", $before); (so that spaces are also not allowed). I have corrected the code above. I'm only human :/