remove files by finding them first

find ./ -name '*.tpl' -exec rm {} +

how to replace string in files recursively

http://linux.derkeiler.com/Newsgroups/comp.os.linux.misc/2008-11/msg0004...

uber fast.

find ./ -name '*.tpl' -exec sed -i 's/stringfound/relacewith/' {} +

use -i[extension] to save a backup file also. @see man sed

Jquery check boxes

Thanks to Jerad Bitner
And Jörn Zaefferer

Toggle Checkboxes with javascript.
On, Off, toggle, toggle based on first checkbox state (toggle all)


$.fn.check = function(mode,all) {
var mode = mode || 'on'; // if mode is undefined, use 'on' as default
var toggle_state = 'foo';
return this.each(function() {
if(toggle_state == 'foo' && all==true){
// toggle all of them the same, based on first one
toggle_state = !this.checked;

REGEX

use with preg_replace

remove everything within html comments.

/]*)-->/

remove everything within curls

/{([^}]*)}/

remove comments

/]*)-->/

// clean up all tags...
$html = preg_replace("/(<\/?)(\w+)([^>]*)>/e",
"'\\1'.strtoupper('\\2').'>'",
$html);

// clean up all html...
http://www-eleves-isia.cma.fr/documentation/PhpDoc/function.preg-replace...

Firefox Search Bar

You want your own firefox search settings
This is How To do it...

create an xml document... (view the source - right click "View Source")
--------------

xmlns:moz="http://www.mozilla.org/2006/browser/search/">
Brokerbin Keyword
Search Brokerbin.com for your parts
sales@brokerbin.com

Firefox quick search from address bar....

Open you manage bookmarks.
Create a new bookmark.
In location put your url with %s as the search parameter.
EXAMPLE
http://www.brokerbin.com/members/index.php?loc=partkey&search=%s
set a keyword (bbin)
ADD

Now in the Address Bar type...
keyword [space] search
EXAMPLE
bbin 188122-b22
HIT ENTER and there you go!!!

non www to www (only if not already sub domain)

.htaccess

RewriteCond %{HTTP_HOST} !^(.+)\.([^.]+)\.(.+) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Ben's Brother - Excellent band.

Just saw Ben's Brother on BBC and they are excellent. Was looking on their website and it looks like Dallas would be as close as they tour to me. Oh, well. Still an excellent band.

Php Crap

A new beginning.

Syndicate content