0

How To Display Just The HTTP Response Code In CLI Curl


Posted by Artem Russakovskii on June 10th, 2010 in Linux, Tips

Today, I was looking for a quick way to see HTTP response codes of a bunch of urls. Naturally, I turned to the curl command, which I would usually use like this:

curl -IL "URL"

This command would send a HEAD request (-I), follow through all redirects (-L), and display some useful information in the end. Most of the time it's ideal:

curl -IL "http://www.google.com"
 
HTTP/1.1 200 OK
Date: Fri, 11 Jun 2010 03:58:55 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Server: gws
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked

However, the server I was curling didn't…

  • Share/Bookmark
12

How To Diagnose And Fix Incorrect Post Comment Counts In WordPress


Posted by Artem Russakovskii on March 21st, 2010 in Wordpress

image

Introduction

If your WordPress comment counts got messed up, whether because of a plugin (I'm talking about you, DISQUS) or you messed with your database manually and did something wrong (yup, that's what I just did), fear not – I have a solution for you.

But first, a little background.

Comment Counts In WordPress

Here's how comment counts work in WP:

  • Posts live in a table called wp_posts and each has an ID.
  • Comments reside in a table called wp_comments, each referring to an ID in wp_posts.
  • However, to make queries faster, the comment count is also cached

  • Share/Bookmark

http://media.smashingmagazine.com/cdn_smash/images/shortcuts/total-commander-logo.pngToday I have 2 tips for Total Commander users:

  • how to display hidden local directories and files and
  • how to display hidden FTP directories and files

Really, Total Commander should just control this setting in one place but, unfortunately, it is not the case.

I usually prefer when my file manager shows me everything I have, so that I can be more in control and see the hidden directories, such as .svn or $Recycle.Bin, and files, such as .bashrc or pagefile.sys.

How To Display Hidden Local Directories And Files

  • go to Configuration -> Options… ->

  • Share/Bookmark

VPN This tip can also be filed in the "post with the longest title that kind of makes sense but needs more explanation" category.

If you use a VPN (Virtual Private Network), this tip is for you.

 

The Problem

  • you connect to a VPN to get access to your work/whatever network
  • your connection is fast but the VPN connection is balls slow
  • you try to stream a bit of online radio, go to a website, watch a video, or do anything, which is automatically routed through the VPN connection but everything TAKES AGES because

  • Share/Bookmark

I got a new development machine at work – a 24" iMac. Since I am not an OSX fan at all, I immediately installed Windows 7 x64 on it and initiated a search for a fitting background image.

And then I found it:

image

Right click here and Save As to download the 1920×1200 version

And that's how you set up your iMac people.

Credit goes to Jonzy from DeviantArt.

  • Share/Bookmark
5

How To View A Specific SVN Revision In Your Browser


Posted by Artem Russakovskii on February 20th, 2010 in SVN, Tips

Updated: July 26th, 2010

image This is a quick recipe that I found pretty interesting and relatively unknown.

Everyone who uses SVN knows that most repositories are set up to allow viewing of their contents via a web browser. For example, here's the trunk of WP Plugins SVN: http://plugins.svn.wordpress.org/ and here is the current trunk version of a specific file, let's say http://plugins.svn.wordpress.org/stats/trunk/readme.txt.

The Problem

However, what if you wanted to view a specific revision of a file or directory in your browser?

Let's say I wanted revision 100,000 of http://plugins.svn.wordpress.org/stats/trunk/readme.txt

Normally, on a command line,…

  • Share/Bookmark

Updated: March 7th, 2010

Introduction

2010 thirtytwo Focus Boa Boots

In this review I'm going to take a look at a pair of 2010 thirtytwo Focus Boa snowboard boots that I picked up a few weeks ago, after spending a day demoing them in the snow at a resort in Tahoe.

Even though I am an avid snowboarder (I try to go to the snow almost every weekend during the winter), I haven't evaluated my gear in years. This season, however, I decided to take a look at my options with the snowboard boots.

 

The Upgrade

It was only after the shoelace on one of my 5…

  • Share/Bookmark

lock Today I'm going to look at how not to handle user authentication in a web application, taking BeTwittered.com authenticating with Twitter as an example (sorry, guys).

BeTwittered is a simple and comfortable gadget that you can add to your site, such as your iGoogle homepage.

Since BeTwittered is just a bridge between you and Twitter, it has to first log you into your account. Here is where things go horribly, horribly wrong.

1. BeTwittered does not use SSL to secure requests to its servers

All authentication information is transmitted to BeTwittered servers in plain text and is…

  • Share/Bookmark
6

Why Are?.. – Presented By Google [PICTURES]


Posted by Artem Russakovskii on January 31st, 2010 in Humor, Politics, Stuff

Google Recently, I decided to conduct a Google experiment and write down what the search engines suggests for the phrase "why are" followed by all kinds of nationalities, races, and localities (alright, "recently" seems to be last March, as evident from the Google theme, but I only decided to post this now).

I did this just for fun and found most of the results funny, some hilarious, and some offensive and controversial.

However, all of them have a reason for being there – statistics. It's what people search for. The cream of the crop. Stereotypes, hilarities, it's all here.

If…

  • Share/Bookmark

NuSphere PHPEd

Introduction

I don't know about you, but I can't imagine doing my PHP development without an IDE with a debugger anymore.

It autocompletes for me, it lets me step through each line of code, jumping around the project, execute and change the code flow on the fly, and does many other things that make me feel cozy, comfortable, and efficient at PHP development (as opposed to, say, CPP which makes me feel cold and lonely).

There are many PHP IDEs out there and I've tried most of them (including the free PHPEclipse and PDT for…

  • Share/Bookmark

The Problem

If you use the Recent Comments sidebar widget in your WordPress installation, it's possible that you want to customize this widget's style.

You will quickly find, however, that as soon as you add the widget to your sidebar, it injects the following inline, hardcoded CSS into the containing page (using !important to make things worse): 

<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>

The code above comes from recent_comments_style() (found in wp-includes/default-widgets.php), which is in turn called by WP_Widget_Recent_Comments() in the same file (this is just an old-style PHP4 constructor – same as PHP5's __construct()), which is triggered…

  • Share/Bookmark
20

WordPress Developers – How Do You Make A Living [Poll + Discussion]?


Posted by Artem Russakovskii on January 18th, 2010 in Wordpress

Updated: May 3rd, 2010

The Question

I'd like to pose this question to all WordPress developers – plugin, theme, as well as core ones:

How do you make your living?

And, for clarification, by this I mean: "what are your primary sources of income?"

Open Source

Open source is a beautiful concept but it often comes with a price tag or, rather, the inverse price tag: most of the time you are not being paid for your time (of course, there are exceptions, such as companies hiring dedicated open source developers and keeping them on their direct payroll).

Everyone has to make…

  • Share/Bookmark
8

Follow-up To Loading CSS And JS Conditionally


Posted by Artem Russakovskii on January 15th, 2010 in Programming, Wordpress

First of all, I'd like to thank everyone who read and gave their 2 cents about the [WordPress Plugin Development] How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts post. The article was well received and will hopefully spark some optimizations around loading styles and scripts.

Here are some discussions and mentions around the web:

Sure, there are drawbacks to this method and it does require some more processing on the backend and it's not…

  • Share/Bookmark

Updated: January 25th, 2010

thumbnail Introduction

If you follow web design at all, you probably see 5 billion top NN posts on a daily basis mentioning site and blog designs, fonts, icons, etc.

However, nobody seems to be paying attention to these little but important guys: comment forms.

If you have an appealing comment box, you are more likely to receive comments (this is based on days of scientific research that I imagined I did in my head) and your content is more likely to be re-shared, voted up, and saved.

I really do feel that way when I visit blogs, especially when an…

  • Share/Bookmark

Updated: January 15th, 2010

Introduction

wordpress logo In this tutorial, I am going to introduce a WordPress technique that I believe was unpublished until I raised the question a few days ago on the WordPress forums.

In short, the problem I was trying to solve was plugins unnecessarily loading their JavaScript and CSS on *every* page of the blog, even when doing so would achieve absolutely nothing and the plugin wouldn't do any work.

Update #1: I have posted a follow-up in response to some comments received around the web.

Update #2: There is a solution that can be considered a compromise

  • Share/Bookmark