Search only within posts in WordPress
If you only want search to look within posts and not in pages for a wordpress site, then a quick and easy way to be to add the following code to your theme’s functions.php file :
add_filter('pre_get_posts', 'aa_search_query_vars'); function aa_search_query_vars($public_query_vars) { global $wp_query; if(is_search()) { $wp_query->query_vars['post_type'] = 'post'; } return $wp_query; }
Shorten URLs in strings with bit.ly
Here is a simple class that shortens the URLs within a string using the bit.ly shortening service. Example is at the bottom of the file.
If you only need to shorten a list of URLs (not within the string), then use the “shorten” function. Bitly api documentation is at http://code.google.com/p/bitly-api/wiki/ApiDocumentation .
Hiding Hosting Providers Nameservers
If you need to use custom nameservers that show up when someone does a whois query, then here is what you do:
Get the IP addresses of the nameservers that your host gives you. They may give it in the welcome mail, or via support. You can also get this by using dig
Now set up child name servers with the IP addresses obtained previously. After this is setup it should look like the following :

Once this is done, you can then set up your nameservers to these child name servers. This setup should look like the following :

Google App Engine as a CDN
If you are looking to offloading some of your bandwidth costs to the great google, and were thinking of using the google app engine as a free content delivery network, then have a look at the cirrux cache project.
Installing it is pretty straightforward, considering you follow the quick installation guide as stated in the readme. If you are looking to use this along with your wordpress installation, then have a look at this link, which gives a much better and easier explanation and a step by step approach on what you really need in order to set up.
Using this technique may also help because the HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel.
If you are feeling lazy and just want to use something, then have a look at http://cdn-cloud.appspot.com/.
Monokai Komodo Edit/IDE Color Scheme
Looking through the interwebs for a suitable dark color scheme for Komodo Edit did not turn up favorable results, other than the one three year old topic over at the Activestate forums.
The only one that did stand out was the Monokai theme (and the Django theme, but that was too green), but the fonts were too big and too italicized for my tastes.
Here is a file with saner values :
Hope you enjoy it.
Quick SSH Proxy
If you have access to ssh to a server, its very simple to use the connection as a proxy server. To do so go to the terminal and run the following command :
ssh -C2qTnN -D 8081 youruser@yourhost.com
The number after -D (8081) specifies which port to listen on. Change it to something else of your liking if something else is using this port.
Then use localhost with the port number you specified as the SOCKS proxy, like so :

You can use ipchicken.com to check that everything is set up correctly.
Download files from a 4chan post
If you need to download all images (or files) from a 4chan post, then here is a quick script to do it. You can run it using PHP on the command line. Saves a lot of time when you see interesting wallpapers and things like that.
Once you save the file, make it executable by using chmod a+x download-4chan.phpand then you can start downloading all the images using something like
./download-4chan.php http://boards.4chan.org/wg/res/2508871
-
Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!