Cool Autocomplete Plugins and Scripts
I found this list of auto-complete plugins and scripts on dzine blog today and decided to share it. Looks like a nice collection.
I found this list of auto-complete plugins and scripts on dzine blog today and decided to share it. Looks like a nice collection.
In an attempt to increase my revenue from domain parking, I've been trying to move away from Sedo so that I can control my own content and advertisement while at the same time keeping my labor overhead low (by overhead, I mean MY time :). I'm currently trying two different options and I'm weighing them by different criteria. Oddly enough, revenue isn't a major focus of the comparison. I'm assuming that because I'm able to use Google AdSense on both platforms, I'll have a comparable revenue per visitor (rpv) on both.
The two different platforms I'm currently experimenting with are ExpressionEngine and Typepad. Here's a breakdown of the criteria I use to compare.
Overall, I don't think I'll decide completely on one or the other. I'm definitely sticking with ExpressionEngine for my serious site development and parked domains that I expect to eventually grow into full sites. The ease of use with Typepad though is so high that I can't resist using it when I'm concerned about my available time. Both are very good alternatives to just parking your site with a 3rd party. Especially once you get picked up by a search engine and start to see the real value of your traffic and their clicks :)
I'm not an expert at shell scripting, but I wrote this little ditty over a year ago and I use it ALL the time. It really makes my life easier. If you work locally with code that needs to be tested on a remote server, you change multiple files at a time, and/or you're using FTP to transfer these files, then this might be a great solution for you. It's a super simple concept, just a nested switch statement used in combination with find, grep, and rsync. However, the uses are so convenient for me that if you were to scroll through my history of my cli commands 70%+- of them would reference this script. I'm posting about it because I want to see if anyone has suggestions for other useful Web Developer functions to add to it.
Here's how I use it. I save the script as /usr/local/bin/my, then just call it like so (example result included):
user@host:~# my find 'some_function_name'
./some/folder/File.php:193: protected function some_function_name($arg1){
The 'sync' option just rsync's the current working directory to the specific server, so be mindful of your working directory!
user@host:~# my sync dev Number of files: 208 Number of files transferred: 173 Total file size: 844041 bytes Total transferred file size: 844041 bytes Literal data: 7851 bytes Matched data: 836190 bytes File list size: 4577 File list generation time: 0.009 seconds File list transfer time: 0.000 seconds Total bytes sent: 15799 Total bytes received: 11572 sent 15799 bytes received 11572 bytes 7820.29 bytes/sec total size is 844041 speedup is 30.84
And here's the code. Like I said, very very simple. If you're a *nix guru you'd probably snort your nose at it, but if you're just an average developer with budding skills, this might change your work-flow quite a bit. Hope someone finds it useful :) If you have suggestions for additional functionality please post them!
case $1 in
find)
find . \( -name "*.php" -o -name "*.py" \) -exec grep -Hn $2 {} \;
;;
findall)
find . -exec grep -Hn $2 {} \;
;;
sync)
case $2 in
dev)
rsync -rz --stats . dev.yourserver.com:/path/to/directory
;;
staging)
rsync -rz --stats . staging.yourserver.com:/path/to/directory
;;
esac
;;
*)
echo "That option is not recognized"
;;
esac
I built this for one small project then found myself using it all over the place. It's basically a generic JavaScript 'class'* that allows you to easily build YUI charts with very little JavaScript code.
If you use YUI charts as suggested in many examples you'll need configuration code for each individual chart which, if you have more than 2 or 3 charts on a page, can make your code appear cluttered. With the ChartsAjax class, all the chart options can be set with JSON data built dynamically on the server and retrieved from one AJAX call. This includes not only data for the datastore but also styling and column definitions.
Below is a breakdown with code examples. Feel free to offer suggestions on how to make it better!
function ChartsAjax(){
var statType='';
var chartType='';
this.buildChart = buildChart;
this.useData = useData;
this.handleFailure = handleFailure;
function buildChart(type, chart){
statType = type;
chartType = chart;
var sourceUrl = '/stats/get_chart/'+statType+'/';
var callback = {success:this.useData,failure:this.handleFailure};
AjaxObject.makeRequest(sourceUrl, callback);
};
function useData(o){
try {var json = YAHOO.lang.JSON.parse(o.responseText);}
catch (e) {return false;}
YAHOO.widget.Chart.SWFURL = "http://yui.yahooapis.com/2.7.0/build/charts/assets/charts.swf";
var msDs = new YAHOO.util.DataSource( json.Response.Results );
msDs.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
msDs.responseSchema = {
fields:json.Response.Fields
};
var targetDiv = statType;
var chartDefinition = {
series: json.Response.Series,
xField: json.Response.XField,
yField: json.Response.YField,
style: json.Response.Style
}
switch(chartType){
case "line":
var chart = new YAHOO.widget.LineChart(targetDiv, msDs, chartDefinition);
break;
case "column":
var chart = new YAHOO.widget.ColumnChart(targetDiv, msDs, chartDefinition);
break;
}
};
function handleFailure(o){
//do something with o.responseText
}
};
var AjaxObject = {
makeRequest:function(url, callback){var request = YAHOO.util.Connect.asyncRequest('GET', url, callback);}
};
<div id="products_sold" >Loading...</div>
function load_charts(){
var products_sold = new ChartsAjax();
products_sold.buildChart('products_sold', 'line');
}
YAHOO.util.Event.onDOMReady(load_charts);
{"Response": {
"YField": "",
"Style": {
"legend": {
"display": "bottom"},
"xAxis": {"labelRotation": "-90"},
"yAxis": {"titleRotation": "-90"}},
"Fields": ["date", "total"],
"Results": [
{"date": "05-27", "total": 147},
{"date": "05-28", "total": 105},
{"date": "05-29", "total": 160},
{"date": "05-30", "total": 40},
{"date": "05-31", "total": 66},
{"date": "06-01", "total": 136},
{"date": "06-02", "total": 243}],
"Series": [{
"yField": "total",
"displayName": "Total Products Sold"}],
"XField": "date"}}
Regular Expressions can be an elusive art. Even when you understand all the rules, you still can easily find yourself having to 'hack' at a pattern until you see the results you expect. Here's an awesome regular expressions tool that I've been using for over a year now. Using AJAX, it sends the pattern/subject to the server and and then populates the result boxes seamlessly. It does this as you type so you can very rapidly iterate through a problem.
If you bookmark it you will use it ;)
Here's a great list of examples and resources for building really sexy forms. There are a lot of JavaScript and CSS tricks that I've seen around for a while, but I've never actually had the need to use. When it comes time create something you've seen before, it can be a bit of a pain finding it again ;(
Having duplicate content has been a long lived problem for people with parameter heavy sites or with multiple versions of the same content scattered across many pages. There has never really been an easy way to highlight your preferred URL when you have scattered and similar content. Over on the Google's webmaster blog, they recently posted instructions on how to use the <link> tag to specify the version you prefer.
How is this useful? Two common scenarios that they mention and that I've personally experienced are the use of tracking parameters and result set ordering parameters.
Let's say you have a product page called black-beans.php, but you have the need to append tracking parameters for some reason. You might end up with black-beans.php?tid=4UZ66?ref=moms_site, black-beans.php?tid=4UX04, etc.. With the <link> tag you can let Google (and any other search engine that adopts this standard) know which should be the 'official' singular version of this content. Here's what your tag would look like: <link rel="canonical" href="http://www.site.fake/black-beans.php" />
site.fake vs www.site.fake?
Historically, you would use .htaccess to 301 redirect one version to the other (typically the site.fake to the www.site.fake). Google claims to honor the canonical <link> tag across sub-domains. Using the <link> method might be the only way some people can solve this issue if they don't have the proper access or environment.
IMHO, this is a really cool new feature!
If you're a web developer with very little SEO experience and have been asked to make your site/pages SEO friendly, then you either asked for more detailed specs or went straight to Google to find out how. Below is a quick list of common sense SEO tips for developers new to the concept.
First of all, SEO is an ever-evolving field. A list of tips/tricks today might be outdated and even funny a couple of years from now. The tips below should stand up to the next few years of search engine evolution. This list is NOT exhaustive, just some fundamental suggestions for technical or on-page SEO.
I was thinking about making a list of useful project management/collaboration tools, but I stumbled upon this blog post while eating my morning cereal. About 2 years ago I was searching desperately for tools like these and came up pretty disappointed. The only good that came from that search was Basecamp, which I've used pretty extensively. Google docs is also a must have...if you trust Google with your privates ;)
Based on his recomendation, I'm off to play with Klock. I need a new Air app to toy around with.
I'm a web developer by day, and what I do at night is my own damn business. I'm fortunate to have gained some very unique experience during my 6-7 years of developing. I've been a contractor, a manager, a code monkey and a consultant. All of which have shaped me into a pretty resilient and productive team member. The one area where I don't have a lot of breadth is my toolset of languages. I am a faithful PHP/MySql developer and for the past 2 years I've worked exclusively with the MVC framework CodeIgniter. I've toyed around with ActionScript a bit and recently started to develop a taste for Flex. Working with Heysan for the past year has given me more depth with PHP and Codeigniter, but since our interface is tailored for mobile devices, the level of CSS/JavaScript I've encountered has been minimal at best.
I really enjoy working with PHP, and I'm not going to stop anytime soon. My entrepreneurial desires are starting to flame more and more over time and I think I have the perfect toolset for experimenting with creative web apps and content sites. I want the focus of this blog to be tidbits of inspiration and jewels of experience I come across that inspire me to create, build business, or just do things with more common sense.
My name is Aaron and I work the dayshift :)