Category Archives: Web

View WordPress Page Drafts in the Dashboard

Wordpress Draft pages on Dashboard

TheDashbaord page of yourWordPress admin interface offers a quick and useful high-level view of your site’s content with the ability to quickly take action as well. There are a number of modules on the dashboard, one of which is the QuickDraft module. Not only does the QuickDraft module allow you to quickly begin a draft of a new post but it also presents you with a list of drafts. For some reason it has been decided that this module should only display drafts of Posts. It would seem to make perfect sense that draft Pages would also be included, but they’re not. However, there is a quick fix for this!

For some reason it has been decided that this module should only display drafts of Posts. It would seem to make perfect sense that draft Pages would also be included, but they’re not. Have no fear, there is a quick fix for this!

To make draft Pages show up in your QuickDraft module on your WordPress Dashboard simply edit the dashboard.php file in your WordPress install. This file can be found here:

> wp-admin > includes > dashboard.php

The line in question is in the function wp_dashboard_recent_drafts. Search for this function and edit the following:

'post_type'      => 'post',

and change it to

'post_type'      => 'any',

 

That’s it! Now you’ll have your draft pages listed right there on your dashboard for easy access.

 

quickdraft-pages

 

Resolving ‘Bad Request Error 400’ in Gmail on Chrome

Gmail on Chrome: Bad Request Error 400
Gmail on Chrome: How to resolve the Bad Request Error 400

I periodically come across the “Bad Request Error 400” problem when using Gmail on Google Chrome. I’m not the only one as you can see from a Google search on the topic. One minute all is well and the next, reload after reload all you see is a blank page and this error message. You haven’t changed anything but things just don’t work anymore. If you try accessing Gmail on a different browser like Firefox, everything seems good, so it’s not Gmail itself; it’s the combination of Gmail and Chrome.

It seems quite ridiculous really that this issue should happen on Chrome. Shouldn’t Gmail on Chrome be essentially bulletproof? Google on Google. C’mon.

When looking for answers the most common suggestion you’ll find is to clear all of your browsing data; history, cache, cookies, etc. I happen to like my browsing data. Among other things, it helps me find things and allows me to stay logged in on various sites. Deleting it all causes me pain.

After searching through various sites and the Gmail and Chrome forums I finally found a great solution. It turns out deleting all of your browsing data is not necessary. This problem comes down to one solitary cookie. Delete this cookie and life is good again.

How to resolve the Bad Request Error 400 in Gmail

Here are the exact instructions.

– Right click on the page with the error
– Select “Inspect Element” from the right click menu
– Select the “Resources” tab at the top of the Developer Tools pane or window that opens up
– Expand the “Cookies” section on the left side navigation by clicking on the little triangle next to “Cookies”
– Select the “mail.google.com” cookie
– Right click on “GMAIL_IMP”
– Select “Delete”
– Refresh the error page

– Rejoice

Original source of solution

 

 

 

Fix ‘Unkown host’ Error on Mac

Have you ever had one of your websites become inaccessible on only one of your computers? The site loads up fine on every other machine you try it on but on this one machine, nada. If you try to ping the domain you’ll likely be presented with an ‘unknown host’ error.

If your computer is a Mac you will likely first think to try dscacheutil -flushcache . However, this will not work for you unless you are using an older version of OS X. Now what you’ll have to do is the following:

sudo killall -HUP mDNSResponder

In most cases this is what will work for you. I won’t bore you with a lengthy explanation of why. Just try it.

Changing Where PayPal IPN Emails Payment Notifications

PayPal IPN
PayPal IPN Email

If you use PayPal for receiving payments online you are likely using PayPal Instant Payment Notification (IPN) as well. This is very useful as it results in an email being sent to the email address you specify whenever a payment is received via PayPal.

However, the email address that you receive these payment notifications at is not necessarily the email address you have configured within your PayPal account for receiving notifications. To set or change the email address to which these IPNs are sent you need to modify the code in the file you point to in the hidden ‘notify_url’ that you set in the form you use for posting to PayPal.

e.g. if you’re using PHP  the field might look like:

<input type=”hidden” name=”notify_url” value=”http://www.mynerdysite.com/paypal_ipn.php”>

In the above case, paypal_ipn.php is the file that gets called after payment has been made. Within this file is the code that send the actual notification email. To set the email address that will receive the payment notification you change the $from variable.

Note that if you want to change where the actual receipt from PayPal gets sent you need to change your primary business email address and then update this in the hidden ‘business’ field in the form you use to post to PayPal.

Installing node.js on Mac OSX

Node js
Node.js

I recently installed node.js on a Mac running OSX 10.7.2 and these were the steps I followed at the command line.  Git and Xcode were already installed on the machine so this assumes they are already present.

  1. git clone git://github.com/ry/node.git
  2. cd node
  3. ./configure
  4. make
  5. sudo make install

You can test that node is installed by running a simple program such as:

var http = require('http');
http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Node.js has arrived.\n');
}).listen(1337, "127.0.0.1");
console.log('Up and running at http://127.0.0.1:1337/');

You can run this code by saving it as something like testing-node.js and then entering the command:

node testin-node.js

That’s it. Node.js is now up and running on port 1337 !

PS: stop the server with ctrl + c

 

How to Create a Custom Facebook Landing Page

Custom Facebook Landing Page
Facebook

Update: Since Facebook launched it’s Timeline in 2012 this information is not really relevant. You can no longer create a page that users see by default.

Custom Facebook landing pages look much more professional than the default wall that everyone else has. Impress your visitors and fans with a custom one. It’s easy. Just follow these simple steps:

  • you need to be logged in to Facebook
  • in the main search box at the top type in ‘static html iframe’ (no quotes)
    • it will be the one with the star icon
  • click on the ‘Add Static HTML to a Page’ button
  • next, select the page you want to add the landing page to from the list
  • click the ‘Add Static HTML: iframe tabs’ button
  • A new item will appear on the far left list (the list with ‘Wall’ at the top)
  • the new item will be called ‘Welcome’ (you can change this later if you want)
    • click on this new item
  • enter html, javascript, css etc. into the text area shown
  • if you want something different displayed to people who have already liked the page, put that in the second text area
  • Facebook requires any images used here to be grabbed from a secure server
    • if you don’t have a secure server you can upload your images to Amazon S3
    • Amazon S3 has free tiers so unless your page is very busy you won’t have to pay
    • however,  you do have to give your credit card info when you sign up to use Amazon S3
  • you can preview your new page by clicking the ‘preview’ button near the top
  • once you are happy with the look of the new landing page you can set it to be the default tab displayed
    • go back to your ‘Wall’ page
    • click on ‘Edit Page’ in the top right
    • on the first page of settings (‘Manage Perminssions’) change the ‘Default Landing Tab’ to your new ‘Welcome’ tab
    • note that you won’t see this tab as the default landing tab while you are logged in as an administrator; you will have to check from a different Facebook account
  • if you want to change the name of your new tab to something other than ‘Welcome’ you can do so by clicking on ‘Apps’ in the list on the left
    • then click on ‘Edit Settings’ under the app in the list (‘Static HTML: iframe tabs’)
    • then enter ‘Custom Tab Name’ and click ‘Okay’
  • Done!

LastPass with Multiple Accounts and Browsers

LastPass with Multiple Accounts and Browsers
LastPass and Multiple Accounts and Browsers

LastPass is a great tool for managing your passwords. The number of passwords we all have these days makes it incredibly difficult to maintain the security of your accounts with strong passwords and actually remember all of those passwords. With LastPass you only need to remember one strong password; it will do the rest.

LastPass comes in the form of browser plugins/extensions for all major browsers. It will remember your passwords across browsers, wherever you are. The LastPass security model is sound so you don’t have to worry about someone getting access to your important information.

One common problem that people encounter with LastPass is when multiple people use the same computer and have different LastPass accounts. By default, LastPass wants to keep you logged in as the same user in all browsers on a computer. Even if you have the plugin/extension/addon installed on completely different browsers (like Firefox and Chrome, not just different browser windows with the same browser) Lastpass will try to keep the same user.

So, if you are logged in as UserA in Chrome and then log in to the extension on Safari as UserB, your LastPass session on Chrome will automatically change to be UserB, the most recent user account you’ve logged in as on any browser on the computer.

This the default LastPass behavior can be very annoying if you share your computer with a spouse or roommate.  Fortunately there is a way around this.

Click on your LastPass icon and up will come the menu. From there, click on Preferences. On the next screen, click on Advanced and then Advanced again in the next window or dialogue. On this second Advanced window/dialogue is a checkbox near the bottom that reads “Share login state between other browsers.” Uncheck this checkbox in each browser on your computer and the problem is solved.

 

Copy and Paste Without Formatting in Chrome

Google Chrome Logo
Copy – Paste Relief!

For people who work extensively on the web, copying and pasting can be a huge pain; not because the act of copying and pasting itself is a difficult tasks but because when you copy some text from a web page, the formatting of that text will tag along. Normally you just want the content in plain text. People often end up copying the content into a word processor like Textmate or Notepad and then re-copying and re-pasting. What a hassle!

Well, there is a handy built-in shortcut in Google Chrome (my choice for best browser) that automatically removes formatting when you paste. Yay! If you are on a Mac, the shortcut is ‘Command-Option-Shift-v’ and if you are on Windows it is ‘Control-Shift-v’.

The 4 key shortcut on Mac is a bit of a ‘handful’ but it is well worth it.

Easy Fix For Broken WordPress Permalinks

Wordpress Permalink Fix
Wordpress

Have you ever had your WordPress blog’s posts or sub-pages stop working for no apparent reason? Well, that happened to me recently. The home page worked fine but any page other than that resulted in an error page from the browser. How this happened I don’t know (if you have a theory, please let me know) but I did come across a quick and easy fix.

To fix this, you need to reset your permalinks in the WordPress admin interface. To do this, log in to your admin interface and click on ‘Settings’ in the left side bar. This should open up a sub menu. In that sub menu, click on ‘Permalinks’.

Once in the ‘Permalinks Settings’, change your settings to something other than what they are currently set to by clicking on one of the other radio buttons in the upper section of the page. If you’re using a ‘Custom Structure’, make sure you copy what is in there first as it will be wiped out when you change this. Now click on ‘Save Changes’. Then, change this setting to how you had it before and click ‘Save Changes’ again. Voila! Your links should work again!

Easy. Quick. Nerdy.

iPhone + Google Calendar + Google Sync = Awesomeness

Google Sync and Mobile Devices
Google Sync and Mobile Devices
Two tools that I love enormously are Google Calendar and my iPhone.  Google Calendar is incredibly powerful. It allows you to have multiple calendars with any mix of private and public/shared calendars you like. It has a powerful quick ad option for adding events with plain English, amazingly configurable repeating events and reminders, and the feature list goes on and on.

When Google launched Google Sync earlier this year the loop from my Google Calendar to my iPhone and back was completed. Sync allows you to view and edit events on either your iPhone built in calendar or on Google Calendar on the web and see the changes propagated almost immediately.

Google sync used to only allow 5 of your Google Calendars to sync to your mobile device but I noticed yesterday that they now allow up to 25 calendars to sync. If you are a Google Calendar power user this is music to your ears.

I highly recommend this combination of tools. If you haven’t tried it yet you are missing out on some serious awesomeness.

Official Google Mobile Blog: Google Sync