By now you should know about the official release of Internet Explorer 8. This is a huge milestone for the browser that most Web Developers have come to hate.
XHTML
1 |
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> |
By now you should know about the official release of Internet Explorer 8. This is a huge milestone for the browser that most Web Developers have come to hate.
1 |
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> |
Lighter.js is a free syntax highlighting class developed with MooTools. It was created with the MooTools developer in mind and takes advantage of many of the Framework’s features. Using it can be as simple as adding a single script to your web page, selecting the elements you wish to highlight, and Lighter.js takes care of the rest.
All browsers supported by MooTools are compatible with Lighter.js. It’s possible that it may work with earlier/other browsers but these are unofficially supported. The official list is:
Easily list the most recent comments in a sidebar or a tab. The code below will list the 10 most recent comments. You can change the number displayed by changing the value of the variable, $intCommentLimit to list more or less comments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<?php function getRecentPosts() { global $wpdb; $intCommentLimit = 10; $strSql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content, 1, 50) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $intCommentLimit"; $comments = $wpdb->get_results($strSql); $strOutput = "<ul>\n"; foreach ($comments as $comment) { $strOutput .= "<li>" . strip_tags($comment->comment_author) . " Says, <br>" . "<a href="\""" .="" get_permalink($comment-="">ID) . "#comment-" . $comment->comment_ID . "\" title=\"on " . $comment->post_title . "\">" . strip_tags($comment->com_excerpt) . " ...</a></li>\n"; } $strOutput .= "</ul>\n"; return $strOutput; } echo(getRecentPosts()); ?> |
Here’s a quick function to generate a password. All you have to do is call it passing the length of your required password as an argument.
1 2 3 4 5 6 7 8 9 10 11 12 |
<?php function generatePassword($intNumOfChars) { if (is_numeric($intNumOfChars) && ($intNumOfChars > 0)) { $strChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"; for ($i = 0; $i < $intNumOfChars; $i ++) { $strPassword .= $strChars[rand(0, strlen($strChars)-1)]; } } return $strPassword; } ?> |
This is a function I use to display the ellipses when I want to truncate and display a summary of a larger body of text.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?php function truncateString($intLength = 0, $strText = "") { if ($intLength == 0) { return $strText; } if (strlen($strText) > $intLength) { preg_match("/[a-zA-Z0-9]{0, " . $intLength . "}/", $strText, $strNewText); return ($strNewText . "..."); } else { return $strText; } } ?> |
I needed a way to access the filename of a file being uploaded or attached using the input file from a form. So, I created a nice little function to achieve this. Hopefully it comes in handy for someone.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<script> function getNameFromPath(strFilepath) { var objRE = new RegExp(/([^\/\\]+)$/); var strName = objRE.exec(strFilepath); if (strName == null) { return null; } else { return strName[0]; } } </script> |
This is a great little function that I whipped up and use to capitalize every word in a string. I can’t tell you how many times I’ve had to use this. Hope you find it useful as I have!
1 2 3 4 5 6 7 8 9 |
<script> function wordToUpper(strSentence) { return strSentence.toLowerCase().replace(/\b[a-z]/g, convertToUpper); function convertToUpper() { return arguments[0].toUpperCase(); } } </script> |
Brusheezy is the place to share your free Photoshop brushes and other Photoshop-related resources. Here you can explore and discuss the creations of other artists from around the world, or just find that perfect little freebie for your next Photoshop project. Brusheezy makes it easy to explore thousands of resources created by artists from all over the globe. All the resources are free to download and, depending on the license, free to use in your projects.
Vecteezy is the place to share your free Vector Art and other vector-related resources. Here you can explore and discuss the creations of other artists from around the world, or just find that perfect little freebie for your next project. Vecteezy makes it easy to explore thousands of graphics created by vector artists from all over the globe. All the graphics are free to download and, depending on the license, free to use in your projects.
Datejs is an open-source JavaScript Date Library. Comprehensive, yet simple, stealthy and fast. Datejs has passed all trials and is ready to strike. Datejs doesn’t just parse strings, it slices them cleanly in two.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<script> // What date is next thrusday? Date.today().next().thursday(); // Add 3 days to Today Date.today().add(3).days(); // Is today Friday? Date.today().is().friday(); // Number fun (3).days().ago(); // 6 months from now var n = 6; n.months().fromNow(); // Set to 8:30 AM on the 15th day of the month Date.today().set({ day: 15, hour: 8, minute: 30 }); // Convert text into Date Date.parse('today'); Date.parse('t + 5 d'); // today + 5 days Date.parse('next thursday'); Date.parse('February 20th 1973'); Date.parse('Thu, 1 July 2004 22:30:00'); </script> |
Hello, my name is Richard Castera. I have more than 12 years of experience architecting, implementing, leading and launching large scale, high performance software products in a fast-paced agile environment.