#Webdev

Archive of blog posts tagged with "webdev"

  • Order Posts via "Weighted Pseudo Randomness"

    A request we are getting more often is to show a list of posts, to elevate some of those posts above others, and to show the posts in a random order. Imagine a post type called "Sponsors". Sponsors are tiered, like "Platinum", "Gold", "Silver", etc. We want the Platinum sponsors to appear before Gold, Gold before Silver, and so on. We don't want to favor one particular Platinum sponsor though, we want them to be randomized but ordered by the tier.

  • Regular Expression of the day

    (?!(([1,2,3,4,5,6,8,9,0])\2{9}))(?!((1234567890|0987654321)))(((\+?\d{1,2}[\s.-])?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4})|(\d{10,}))

  • Technical Documentation for a Web Development Project

    Working on a large web development project requires that you have clear direction and good technical documentation. The designer needs to understand the functional requirements and the data model in order to deliver a successful design. The themer need to understand the UI/UX spec in order to deliver accurate and functional markup. The developers need to understand the functional requirements and data model in order to build out the CMS backend. Creating these documents, as a team, will help guide the project to success.

  • TLS Peer Verification w/PHP 5.6 and WordPress SMTP Email plugin

    We ran into an issue after upgrading from PHP 5.5 to 5.6. We were no longer able to send email via the awesome WordPress SMTP Email plugin. Turns out that PHP 5.6 introduced some enhancements to its OpenSSL implementation. Stream wrappers now verify peer certificates and hostnames by default. This was causing the form submissions on our site to fail. Clearly there are some issues with our Postfix config and certs. While we sort out those issues, we were able to "solve" our immediate problem, and disabled peer verification in the plugin without editing core files. Thankfully the plugin developer included a filter that would allow us to modify the options array that is passed to PHPMailer.

  • Capistrano tasks for Magento

    Custom tasks for Capistrano that I am using to help manage a Magento website.

  • A WordPress ajax handler for custom themes

    Something I have been noodling on is a better way to handle ajax requests in my custom themes. Seems to me that a relatively complex theme ends up with a lot of add_action calls for custom ajax handlers, and this could be simplified/reduced. Every time a new endpoint is required we have to add two new add_action calls to our theme. Maybe a better approach is to write a single ajax endpoint that will route requests to the proper classes/methods?

  • What to do when your website is hacked/exploited

    So your website has been "hacked"? You load your website in your browser, and are redirected to some spammers website, or maybe you google'd yourself (naughty), and found a few thousand indexed pages for knock off prada gear? Ok, so how do you fix this, and more importantly, how do you learn how they did it so you can defend against it later.

  • Virtualbox Bug related to SendFile

    I have been doing more web development with Vagrant and VirtualBox. It's a nice way to keep my dev environment nearly the same as my production environments. Recently I was doing some front-end coding and was running into the most bizarre errors with my JavaScript.

‹ Prev
1
Next ›