inicio mail me! sindicaci;ón

making Freeow work with jQuery 1.2.6

Hi,

I was able to make this lib work with jQuery 1.2.6 by making only this one-liner change:

?View Code JAVASCRIPT
    //this.element.hover(this.options.onHover); 
    this.element.hover(this.options.onHover, this.options.onHover);

More Project Management Tools

I ran across this list, entitled Top 10 Best Free Online Project Management Application Services

While most of these products do offer free versions, I think that they are not functional for a team of five people working on serious projects without paid subscriptions.

Many of these were not found in my original analysis; check them out.

Inline images with Data URLs

Just read today about using Data URLs to include images inline, skipping an HTTP lookup for each item. Nifty!

Project Management and Time Tracking

The world of Time Tracking and Project Management is a vast one. For small businesses like ours, there are seemingly endless time tracking solutions and a good number of project management answers.  I spent nearly two weeks evaluating options in my spare time, so hopefully this data will help save you some time.

Read the rest of this entry »

Get elements by CSS class name in javascript

Dustin Diaz wrote a nice, efficient version of getElementByClassName(), which searches HTML elements and retrieves all the items with a given CSS class specified.

Of course, if you use a lib like extjs, jQuery, et al, then you have no need of this. But if you’re trying to hack out a greasemonkey script or insert some minimalist code, here it is.

And here it is, for my own archives:

?View Code JAVASCRIPT
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

Here’s another alternative I found on Glazblog, using xpath to search the document:

?View Code JAVASCRIPT
document.getElementByClassName = function(needle) {
  var xpathResult = document.evaluate('//*[@class = needle]', document, null, 0, null);
  var outArray = new Array();
  while ((outArray[outArray.length] = xpathResult.iterateNext())) {
  }
  return outArray;
}

I don’t really know which is more efficient, though I suspect the xpath search could be taxing in very large documents. I’m positive, based on IE’s fake implementation of key/value pairs in the DOM, that they both suck in IE, even if you specify a specific tag type to search. Obviously, providing a node makes the regular expression search faster, by virtue of having less content to parse.

Unable to start Apache, port 80 in use–Skype bastard process

Today I was unable to start Apache using a new install of XAMPP. A quick netstat -o in cmd showed something was blocking port 80.

After about an hour of searching, I discovered that port 80 was in use by Skype. No kidding. There is an advanced setting in skype to “Use port 80 and 443 as alternate incoming connections.” If this is checked (which it is by default) then a service is started on port 80 that blocks Apache. Ungh for bad ideas and even worse defaults.

Sending Mail From Bash Scripts with an Attachment

Here is a great little tut on getting started in Bash. I’d recommend it to anyone trying to hack their way into a shell script.

Here is a quick script for sending an email:

#!/bin/bash
 
# Subject of email
SUBJECT="Test email with attachment from a bash script"
 
# Where to send it
TO_ADDRESS="your@email.com"
 
# Where the attachment is
ATTACHMENT_FILE="/tmp/attachment.txt"
 
# For fun, let's put something into the attachment
echo "This goes into the file."  >  $ATTACHMENT_FILE
echo "This appends to the file." >> $ATTACHMENT_FILE
 
# send the message
/bin/mail -s "$SUBJECT" "$TO_ADDRESS" < $ATTACHMENT_FILE

Color Scheme Designer

Great color scheme program for creating themes and complimentary designs:

http://colorschemedesigner.com/

Manually remove a service from windows

Today I needed to manually remove a service from windows. I found this command line approach, which worked great for me.  Be sure to use the service name and not the display name:

sc delete ServiceName

You can find the service name by going to Control Panel -> Administrative Tools -> Services, right click the service and choose properties, the service name is shown there.

Debug PHP With Firebug : )

http://www.sitepoint.com/blogs/2010/02/09/debug-php-firebug-firephp/

« Previous entries · Next entries »