Archive for category Development

WordCamp Louisville

Posted by Matt Kendrick on Thursday, 20 May, 2010

I’ve been using WordPress blogging platform for over a year now. I’ve been extremely impressed with the ease of use and plugablity. I’ve also taken part in writing a few plugins for WordPress. Now I think I’m ready to take the next step and attend WordCamp. WordCamp is a convention so to speak for those who use WordPress. It’s a great way to meet people and expand your horzions on the great blogging platform. I just found out today, that WordCamp Louisville has been officially set. The date is Dec. 4th 2010. This will be the closest WordCamp event to where I live. Not completely sure if I will be able to make it. But I’m excited and can’t wait to attend. If I can make it, I’m looking forward to meeting other WordPress users and share ideas. This WordCamp event proceeds will benefit the University of Louisville Autism Training Center. So to help the gang at WordCamp Louisville out, I’m putting a supporting logo on my blog! So there ya have it!

Louisville WordCamp

Self Made Tools: Proportional Image Resizer

Posted by Matt Kendrick on Monday, 29 March, 2010

I’ve decided to create a new segment on my site called “Self Made Tools.” From time to time, I make software tools to help me through tasks that I can’t find tools for quickly. I’ve decided to really jump on the Open Source movement bandwagon and share my tools with source. This week’s tool is “Proportional Image Resizer.” What? Ok, let me explain.

When coding HTML, you know when you have an image that is one size and you need it to fit within an area that is of another. Say the image is 800 px X 600 px and you need to make it fit into an area that is 500 px wide spot. Easy right? Just change the one dimension in your code to reflect the change. Sure your browser will adjust your image. But it may not pass some web standards for all browsers. It’s just not clean. You need to have both a width and height specified when resizing an image using code.

How do you resize these images proportionally? Use a simple equation to do the job. You know the before image is 800 px X 600 px right? You also know you need the image to fit within a 500 px width. Now you just need the other part of the equation (solve for x).

800 / 600 = 500 / X

Cross multiply and you’re done right? How about we just skip doing the equation every time and just use a tool? That’s how the proportional image resizer tool was born. You can also do the reverse as well (height vs width). I know there are other tools out there to perform the task. But why not use something homegrown? You could even code this yourself in a matter of minutes. I’ve posted the source to the script above. Thanks for reading!

<html>
<head>
<title>Proportional Image Resizer</title>

<script language='Javascript'>
//Matt Kendrick
//March 28, 2010

function resize_by_width(width)
{

var x_before = document.getElementById('x_before').value;
var y_before = document.getElementById('y_before').value;

var x_new = width;
var y_new;

//a / b = c / x

//x = (c * b) / a

y_new = (x_new * y_before) / x_before;

document.getElementById('y_new').value = y_new;

}

function resize_by_height(height)
{

var x_before = document.getElementById('x_before').value;
var y_before = document.getElementById('y_before').value;

var x_new;
var y_new = height;

//a / b = x / c

//x = (c * b) / a

x_new = (x_before * y_new) / y_before

document.getElementById('x_new').value = x_new;

}

</script>

<style>
.dim_box {width:50px;}
</style>

<head>
<body>

<h2>Proportional Image Resizer</h2>

<b>Instructions</b><br>
<p>
Enter the starting dimensions of the image. <br>
Then enter the dimensions you would like to conform the image to. <br>
<br>
ex. You have an image that is 800 x 600, and you need it to fit the image <br>
proportionaly in a 525 pixel wide area. Enter 800 for the width and 600 for <br>
the height in the before dimensions. Then enter 525 in the after dimensions <br>
width. The script will then compute the proportional height for you.
</p>
<br>

<b>Before Dimensions</b><br>
Width: <input type='text' id='x_before' class='dim_box' value=0> Height: <input type='text' id='y_before' class='dim_box' value=0><br><br>

<b>After Dimensions</b><br>
Width: <input type='text' id='x_new' class='dim_box' onKeyUp='resize_by_width(this.value);' value=0> Height: <input type='text' id='y_new' class='dim_box' onChange='resize_by_height(this.value);' value=0><br><br>

</body>
</html>

CafePress Ad Rotator – WordPress Plugin

Posted by Matt Kendrick on Saturday, 20 March, 2010

thumbnail-1

Contributors: Matt Kendrick
Tags: cafepress, t-shirts, ad, display
Requires at least: 2.6
Tested up to: 2.9.2
Stable tag: .85

This plugin adds a widget that displays random items from your CafePress.com store. Requires cURL and a CafePress API Key.

== Description ==

This plugin adds a widget that displays random items from your CafePress.com store. The display uses the 150px X 150px thumbnail provided by CafePress, description, price and ‘Buy Now’ link. See it in action at OnScreenCars.com It can also cache a copy of your items to avoid hitting API limits and performance issues. Your webserver will need to have the cURL extension for PHP in order for this plugin to work. You will also need to obtain a CafePress API Key. API Keys can be obtained from this link: http://developer.cafepress.com/apps/register.

== Installation ==

1. Upload zip file contents to the `/wp-content/plugins/` directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Add/Configure Your CafePress Ad Rotator Widget

After you install the plugin go to Widgets, add and configure the CafePress Ad Rotator widget. You’ll
need your CafePress store id (ex. http://www.cafepress.com/mystoreid, last part of the url),
API Key and a label name for your widget. You can obtain API Keys from http://developer.cafepress.com/apps/register Once you have your widget up and running it’s best to cache a copy of your CafePress items. From the widget control panel check “Update Cache” and click Save. You can clear or update the cache at anytime. It marks the last time you updated your item cache. Whenever changes are made to your store, you need to update your cache.

== Changelog ==

= .85 =

Bug fixes for PHP5, No sell-out price fix, total items variable correction.

= .80 =

First version released.

=== Downloads ===

CafePress Ad Rotator (196)

Looking for a great guide on how to make your own WordPress plugins?

Tweet My Script Plugin for WordPress

Posted by Matt Kendrick on Tuesday, 26 January, 2010

About: This plugin watches your Twitter RSS Feed for user-defined “launch codes” to trigger user-defined script URLs.

Have you ever needed a script or task run on your blog and you were not near a computer with internet access? Well look no further than “Tweet My Script.” This plugin allows you to simply use your cell-phone to text a short tweet to Twitter with a “launch code.” When someone accesses your Word Press blog, Tweet My Script will check to see if you’ve left any new launch codes to activate. After each successful launch, the plugin records the previous tweet. This insures that the script being launched will only be launched once, unless the launch code is used again in a new tweet. This plugin can be used to launch any public accessible script.

Tweet My Script Screenshot

Updates

Version 0.75 – March 7th 2010: Offset feature added. Allows for bloggers to set an offset on the number of times your blog checks Twitter to keep from exceeding API limits. This is ideal for blogs with high traffic or blogs hosted on high traffic shared hosting. Default offset is set to 0.

Installation

1. Upload `tweet_my_script.php` and `tweet_my_script_options.php` to the `/wp-content/plugins/` directory

2. Activate the plugin through the ‘Plugins’ menu in WordPress

3. Configure plugin settings from the dashboard settings option `Tweet My Script`

Download

Tweet My Script WordPress Plugin (659)

This is my first official plugin for WordPress! If you find it helpful or would like to help further push development, please donate!


  

WordPress: Snow Flakes Plug-in

Posted by Matt Kendrick on Monday, 2 November, 2009

Holiday Season/Winter is approaching fast. You can add some falling snow/leaves to your site to make it more festive! On this site I’m using a blogging software package called WordPress. Nicolas Kuttler a developer from Germany wrote a very easy to use plug-in to add falling snow to your WordPress blog. As you may have noticed I’m using the plug-in now with falling leaves (hasn’t started snowing yet).

Nicolas describes his plug-in:

Snowflakes falling down your blog! Inspired by the unforgettable xsnow. Install this and enjoy the snowfall! Great for times around Christmas and Christmas templates. The plugin comes with different snowflakes and a lot of possible settings. You should see the effect on this page.

You too, can easily add this plug-in to your WordPress blog through your admin console. In the plug-in search box, search for “snow”. The results will list this plug in as “Snow, balloons and more…”. Just install and activate. There ya have it. You can also change different settings for the plug-in as well. Settings include speed, direction, size and images to use.

If ya get a chance check out Nicolas’ other WordPress plug-ins at his website at: http://www.nkuttler.de

You can also learn more about this plug-in at: http://wordpress.org/extend/plugins/nksnow/

Website Badges

Posted by Matt Kendrick on Friday, 28 August, 2009

I’m sure you’ve been to a website that has the little site badges on them. I’ve got some on the sidebar for different blog lists I’m members of. They’re a neat way to graphically link your sites to others. But how do you make them? You could use some photo editing software. There are templates for Photoshop as well. But I’ve found a neat tool, the makes it easier than ever to create your own site badges. It’s called “80×15 Brilliant Button Maker.” It’s a tool on LucaZappa’s website.

Very easy to use. You can change foreground and background colors of the button. If you don’t prefer colors, you can use images. The default font is called “Silkscreen“, commonly used for small type. But you can also choose from a number of other micro-sized fonts as well. As you mend your creation, you can preview the output. Once you’re satisfied with your design you can download the .PNG version of your work. There is even an option to directly upload it to Imageshack.us for hosting. There ya have it. A button maker that is truly “Brilliant.” Below are some examples I’ve created using the tool.

http://www.lucazappa.com/brilliantMaker/

Get ASCII’d

Posted by Matt Kendrick on Tuesday, 18 August, 2009

I’m sure you’ve ran into ASCII art before and never knew what it was called. Remember the last time someone messaged you and typed a colon and a right parenthesis. “:)” Well that’s an example of ASCII art. Basically ASCII art is artwork created with text characters (letters, numbers and symbols). Since the age of typewriters people have been “drawing” with ASCII characters!

What got me thinking about ASCII artwork today, was a neat PHP script called ASCIIArtist. The script allows you to convert bitmap images (jpg,png,gif) to ASCII characters. The script was written by Sebastian Röbke (Boosty) of Meerbeck Germary.

The script is very simple to use. Just visit Sebastian’s site and input the URL of the picture you’re wanting to convert to text. Then change the settings as you like and press “Render”. Then you’ll see a new window pop up with the ASCII artwork version of your image!

You can check the results of our conversion of one of our wedding photos here. Don’t forget to check out Sebastian’s site and get ASCII’d!

Can You Run It?

Posted by Matt Kendrick on Sunday, 9 August, 2009

Have you ever gotten excited about a new PC game coming out? You ran right out and bought it as soon at it hit store shelves? Did the excitement wear off as soon as you found out your PC doesn’t meet the hardware requirements? Sad, I know. I’ve bought games before without paying close attention to the hardware requirements before. It’s one of the last things you expect.

Well life got a little easier with a free utility that can tell you if your machine is up to snuff for the latest games. It’s called “Can You Run It?” Very simple to use. Just go to the “Can You Run It?” website and select the game you want to check for. The application will then inspect your hardware and give you a report of it’s findings. You may find that you just need to upgrade your video card or add ram. However some games tend to overrate the requirements.

New games come out every few weeks. It is amazing how much push there is for new hardware. What’s hot today is not tomorrow. Gaming is not the cheapest hobby out there. But it can be a lot of fun. As they say at the end of every GI Joe cartoon “Now you know and knowing is half the battle.”

http://www.systemrequirementslab.com

w3Schools.com

Posted by Matt Kendrick on Thursday, 30 July, 2009

w3schools LogoWant to learn how to do HTML? Ever needed a quick reference while writing a PHP script? We’ll look no further than w3schools.com! This site is full of great tutorials and references for all your web programming needs. In 1998 a team of developers quit their jobs to form a company called Refsnes Data. They vowed never to charge for the information available on their website. All hosting costs and tutorial are completely supported by their sponsors.

The tutorials are easy to understand. They offered plenty of examples to follow. You can test their examples using their live “Try It Yourself” demos. You can learn at your own pace in the comfort of your office or home. If you’re still a little fuzzy on something. Feel free to sign up and use their forums. There are no stupid questions.

I’ve been using w3Schools.com for years. One of my professors in college first told me about. Ever since I’ve been going back for more information.

Quick and Dirty: Batch Script Pausing

Posted by Matt Kendrick on Tuesday, 28 July, 2009

In my line of work I rely on batch scripts to get things done while I’m a sleep (at night, not at work). Sometimes scripts need to break while underlying tasks complete. So how do you make a script wait say five seconds? Well you could use execute a program that doesn’t do anything for a length of time. But why install another piece of software? A quick and dirty way of pausing a batch script is simply making the server ping something for length of time. That will keep it busy while giving time for other tasks to complete. Below is an example line you could add to your script.

ping 1.0.0.0 -n 1 -w 5000 >NUL

Once the script hits this line, it should pause for five seconds. Keep in mind the syntax may vary based on operating systems. This line was written for Windows Server 2003 batch files. I’m sure their are better ways to do this. But that’s why it’s “Quick and Dirty.” Hope to bring more of this little tricks to help ya out. Happy scripting till then!

 

You need to log in to vote

The blog owner requires users to be logged in to be able to vote for this post.

Alternatively, if you do not have an account yet you can create one here.

Powered by Vote It Up