Category: Technology

  • Testing localhost instances on devices using a proxy

    I wanted to be able to access my localhost from my iPhone. This article on Egalo told me how to do it. Essentially, you run a Proxy Server from your laptop and point your device at the proxy in the wifi settings. The article suggests using SquidMan as a proxy, largely because it is fairly easy…

  • Advanced GitHub issue filtering

    A little over a year ago, I posted about using dotjs to add buttons for advanced issue filtering on GitHub. With GitHub’s launch of their revamped Issues page, or dotjs code is no longer needed! Issue filtering is where it’s at: Example: all bugs that aren’t labeled as “help wanted” If you are looking at Twitter Bootstrap CSS issues,…

  • Discovering the events attached to elements in jQuery

    If you have a need to find what events are attached to an element in jQuery, here’s what you do: Finding events attached to the document: Finding events attached to an element with an ID of bacon: Here’s a snippet I’ve been using in the console:

  • Bringing back the console API on Netflix and Facebook

    Facebook and Netflix have implemented some code that breaks the console API in Chrome by changing the getter/setter for the console property on the window object. The purpose is noble – to help avoid a social engineering attack – but as a developer it irks me. I want my console when and where I want it.  In…

  • Setting /etc/hosts on an Android Emulator using a Mac

    Testing sites on mobile devices is a necessity. When you find a bug that needs some loving and you want to do the code tweaks on your localhost, the Android emulator balks. It doesn’t know anything about your localhost. Luckily, you can resolve this by editing the emulator’s /system/etc/hosts/ file. Here’s what to do: First,…

  • Activating BuddyPress for PHPUnit WordPress-tests

    I have found myself writing PHPUnit tests for WordPress plugins lately (using wordpress-tests) and the code that I’m working with has a dependency on BuddyPress.  Enabling BuddyPress for WordPress unit testing requires a bit of hoop jumping because you can’t use the wp_tests_options global variable as you would any other plugin in your local bootstrap…

  • Bypassing Output Buffering in PHP

    I’ve been developing with PHP for over a decade and I just love it when I learn a new trick. Perhaps you are working on a command line script and want some feedback, but you’re output buffering to generate a fancy report (or something).  You can bypass the output buffering with this little trick Result:…

  • Chromedriver doesn’t run in tmux and here’s how to fix it

    If you are attempting to run Selenium using the Chromedriver while in a tmux session, you may have encountered some issues with chromedriver.  Specifically, this error: Aw, Snap! Something went wrong while displaying this webpage. To continue, reload or go to another page. If you’re seeing this frequently, trie these suggestions. A simple solution is to…

  • Preparing a Site for SOPA Blackout with .htaccess

    BorkWeb, like a number of other sites, will be going black this Wednesday as a protest to SOPA.  Legends of the Sun Pig has an excellent article on this exact topic.  Martin writes: Google recommends using HTTP 503 “Service Unavailable” status codes. The 503 code indicates that the service (or page, or site) is temporarily…

  • Vim Undo Magic

    Ever have a time when you are happily editing a script in vim and you realize you made a mistake over the course of editing? Luckily, Vim supports back in time undos. You want to go back 10 minutes? :earlier 10m You want to go forward in time by 5 seconds? :later 5s Sweet cuppin’…

  • Sites Not Reachable After Linode Restart

    I have recently moved the majority of my sites over to my CentOS Linode VPS and I was experience some load issues that prevented me from gaining SSH access.  As such, I decided to restart my VPS.  After the restart, I found that my sites were not reachable…lame. First, I checked the firewall found here: /usr/bin/system-config-securitylevel-tui So…the…

  • Platypus Mascot: A Plymouth State April Fool’s Day

    Yesterday (April Fool’s Day) I had a little fun and launched a prank on the entire Campus Community of Plymouth State University. The prank? PSU’s portal received a makeover in order to announce a change of the campus’ Mascot from Panther to noble Platypus due to trademark issues.  Results?  Awesome. Before our users logged in,…

  • Guest Lecture: JavaScript, Ajax & DOM Manipulation

    Zach has asked me to give a JavaScript guest lecture in his Web Programming class. We’ll cover: JS basics, node manipulation, DOM traversal, AJAX, JavaScript libraries, and myPlymouth implementations of those topics. Here are the slides (get the .ppt here): Javascript: Ajax & DOM Manipulation v1.2 View SlideShare presentation or Upload your own. (tags: javascript…

  • CSS Selector Browser Support

    As many web developers know, CSS support is highly varied amongst browsers. I often find myself hunting for which selectors are more heavily supported. As such, I thought I’d post a direct link to a quality resource here so I wouldn’t have to hunt anywhere besides on BorkWeb. Here’s some decent resources: CSS selector and…

  • Oracle 10g: Using The Returning Clause With ADOdb

    Plymouth State University uses Oracle heavily due to its Student Information System of choice – SungardHE Banner. As such, I play around in Oracle a lot (sometimes a lot more than I’d like) and I occasionally find functionality that seems more cumbersome than it should. One such item is selecting the last inserted value on…