Using s3cmd to synchronize local files against an S3 bucket
Setting up Amazon S3 to host static media assets
I have a server with many gigabytes of static images that are starting to consume all of its available disk space.
Apache httpd + mod_jk Configuration for a 503 "Down for Maintenance" Page
This is a configuration I used to create a “Down for Maintenance” page with a 503 HTTP response code in httpd while I redeploy a Tomcat war file.
Live template in IntelliJ IDEA to generate static class-level Logger variable
This reduces the keystrokes needed to introduce a logger variable in your class to simply typing log
and pressing [Tab] in the declaration block of your class.
Python + peewee and OperationalError 'MySQL server has gone away'
It took hours to figure out why my python script using peewee yielded OperationalError(2006, 'MySQL server has gone away')
, but I found the problem.
Configuring Eclipse for IntelliJ users
There are a few things I’ve gotten used to in IntelliJ that require some customizations in Eclipse. The following steps will make Eclipse feel more familiar and ease the transition.
MacOS Application Installation List
This is a list of applications I find useful on a Mac.
Sublime Text Key Mappings for MacOS
This is my Sublime Text custom key configuration on MacOS, which makes it a bit more consistent with other text editors.
IntelliJ Keymap Customizations on MacOS
A few useful IntelliJ customizations on MacOS.
This post goes through the steps to add the necessary modules in Python that I use.
Save drafts of form textarea inputs in Apache Wicket automatically
This article documents an Apache Wicket solution to automatically save drafts of user input in the background using ajax POST requests to the server.
MacOS Keyboard Shortcut Customizations
Custom keyboard shortcuts that I find useful.
MacOS Command Prompt and vi Customizations
This is my custom command prompt configuration.
An efficient typeahead/autocomplete data structure and algorithm
I’ve been wanting to implement a typeahead lookup for universities and thought it would be an interesting weekend project to write an efficient typeahead lookup dictionary structure.
Deny requests by IP address on an Apache server
It’s very unlikely that someone will legitimately access your web server by IP address in their web browser, and it’s almost guaranteed to be a bot of some sort. To prevent access to your server by IP address, it’s necessary to examine the host
header in the HTTP request (HTTP_HOST
in Apache) and then deny access if it evaluates to an IP address.
A simple cron job to perform a recurring MySQL database backup
I’ve written a simple script that performs a MySQL database dump and can be defined as a cron job to run at regular intervals.
Live template in IntelliJ IDEA to generate serialVersionUID
Live templates in IntelliJ are cool. They reduce the number of keystrokes you need for repetitive code.
Override Wicket's redirect to use "301 Moved Permanently" instead of "302 Found"
HTTP status codes 301 Moved Permanently and 302 Found are used to redirect a user’s web browser to a different location. A user will never notice the difference if your server sends a 301 or 302, but sending a 302 can have negative SEO implications, such as PageRank not transferring correctly to the target page.
Regex to identify an IE 6 user agent without blocking MSIE 8 or 9 users
I recently had a need to block all IE 6 users from a website. After doing some log analysis, it looked like nearly every IE 6 user agent was some sort of bot or undesirable crawler. The browsing patterns made it very obvious that the requests were not coming from a human, and sometimes the same IP address would send different user agent strings on each successive request.
Check if a user already exists in a sign up form with a Wicket validator
A common use case during user sign up is to check if the user already exists, either by email address or by user name. Wicket makes this simple.
Adding a rel=canonical link in Wicket for duplicate content
Google recently introduced a new <link rel="canonical">
tag to help the search engine identify duplicate content across domains or pages. I’m working on a development project that contains many subdomains under a single domain to present content specific to various geographical areas. Some of the administrative pages under each subdomain contain the same content (such as About Us, Privacy Policy, etc.).
Apple Store's usability is great, but…
I’ve been eyeing a new MacBook Pro for a while and decided to pull the trigger during Apple’s Black Friday promotion. Since I wanted some custom upgrades, I bought it on Apple’s online store instead of at an Apple Store. Apple’s done a great job with their site’s usability, but I found a few things lacking with the experience.
A case for declaring your variables as final in Java
I wrote a few months ago about Yoda conditions and using the final keyword. I recently came across a bug that would never have occurred if a final keyword was used.
You can embed wicket:message in any HTML tag for easy internationalization in Wicket
Here’s a useful Wicket i18n tip to reduce the amount of code you need to write. Any HTML tag in your HTML template can have a wicket:message
attribute added to it. This is especially useful in <a>
and <input>
tags.
The importance of spelling and grammar to create a professional appearance
Many people will form an impression of your company based on your website, and if your organization is an online business, this is the only impression you can make. It’s extremely important to create a positive perception by ensuring spelling, grammar, and capitalization are correct.
Configure WiQuery to not import JQuery automatically
I’ve been working on a Wicket project that requires JQuery to be present on every single page rendered by Wicket. I do this by including a reference to JQuery from my base page. However, when I add a wiquery component to a subclass of my base page, it automatically inserts a reference to JQuery as well – resulting in markup that instructs the browser to download jquery.js
twice from two different places.
How to configure your WordPress title to place the title of your article before your blog's name
Update March 2019: This article was written in 2011 when this blog was hosted on WordPress and has since been moved to GitHub Pages.
Usability guidelines for entering credit card numbers on a payment page
As more people with very little computer experience start shopping online, usability on an online retailer’s checkout page is becoming even more important. One common problem that impacts the user experience is a very rigid credit card input that does not permit users to enter spaces or hyphens.
Why Yoda conditions are bad and usage of Java's 'final' keyword is good
I came across some code a while back that made me pause for a moment as I figured out its meaning. This code used something known as a Yoda condition, also sometimes referred to as Yoda notation. In a conditional block, the operands on an operator are reversed, so that the constant expression is listed first instead of second.