While working with early GitHub Copilot I would use a lot of short utterances. (e.g., “can we do that?” or “That’s not right.”) I found that the model often would ignore the context of the conversation and answer in an overly literal way. I then would be forced to undo any changes and re-prompt with a more explicit request. Wanting to fix this problem, I thought…
Blog # This is where I write about whatever I’m building or experimenting with. Right now that’s mostly AI/ML and infrastructure, with the occasional deep dive into whatever else has my interest. Background # I’ve always loved to tinker, build, and learn. Over the last 25 years I’ve worked alongside some amazing people and companies who share that same curiosity. This is my…
Background # I’ve recently been tinkering with setting up swarms of long-lived AI agents that organized and self-assemble via a popular slack clone. I found that while they’re pretty good at holding a conversation with one another, they’re terrible at keeping track and organizing an actual project. I tried adapting existing open-source trackers with mixed results. They were just…
Here’s a quick and easy way to tail log files from multiple hosts using Capistrano and the Foreman gem. Capistrano Task # First you’ll need to make sure the foreman gem is installed. This can be done globally using gem install foreman , or by adding gem 'foreman' to your Gemfile . Next, create a new Capistrano task file called tail.rake and place it in the lib/capistrano/tasks…
Where, oh where, is that pesky Doctrine 2 PDO object… Doctrine actually uses a base class called \Doctrine\DBAL\Driver\PDOConnection which extends the native PHP PDO class. It’s used by all PDO-based drivers as the common database connection interface. Code # Access to the \Doctrine\DBAL\Driver\PDOConnection instance can be gained through the Doctrine\ORM\EntityManager instance. <?…
Announcing the next release of WordPress Domain Changer – version 2.0! This release marks the completion of a total rewrite that brings an updated user interface, improved stability, fine-grained control, improved testing, and a few bug fixes. Redesigned UI & Workflow # Precise Control # The ability to specify database tables has finally arrived!
When I decided to port my blog away from WordPress I found myself torn between two great static site generators – Middleman and Jekyll Feature Envy # One of the features that I’ve grown quite fond in Middleman is their LiveReload Extension . All one needs to do is add activate :livereload to the config.rb file and Middleman will automatically reload the browser when a file change is…
The Terminal application has been steadily improving with every major release of Mac OS X. A new feature called Window Groups was recently added which saves the state, tabs, and locations of all terminal windows at a set point in time. I’ve personally found this to be a very helpful feature with just one caveat: It requires frequent upkeep when working with multiple projects. The Window…
Here’s a quick and easy way to sort a Ruby hash by its keys. The ability to sort recursively and provide a custom sort block are also available features. The Method # I took the approach of monkey patching a sort_by_key method into the Ruby Hash class itself. The method can be easily modified and placed into a utility class if you’d prefer to take more procedural approach.
I’ve been loving the Twitter Bootstrap buttons so I came up with a quick technique that turns them into actual working form input elements. HTML # Just like a normal Bootstrap Button Group , but with a few added attributes. < div class = 'btn-group' data-toggle-name = 'is_private' data-toggle = 'buttons-radio' > < button type = 'button' value = '0' class = 'btn' data-toggle = 'button' >…
I had just finished the standard installation of ActiveAdmin when I noticed that authentication was implemented using the fantastic Devise Gem . I had already been planning on using Devise for authentication within my application so I initially thought integration would be a snap. However, as development progressed it became clear that all of the pieces were not quite fitting together. Realization…
I was in the middle of a code review a simple question came up: “What’s the fastest way to output a segmented string in PHP?” echo '<div>' ; echo '<span>' ; echo 'This is a random number: ' . mt_rand ( 1 , 100 ); echo '</span>' ; echo '</div>' ; – OR – $html = '<div>' ; $html . = '<span>' ; $html . = 'This is a random number: ' . mt_rand ( 1,100 ) ; $html . = '</span>' ; $html .…
A couple weeks ago I was looking for a simple way to make AJAX requests on admin or public WordPress pages from a theme or plug-in. After a bit of searching I could not find the solution I was looking for - so I built my own, AHAX. AHAX is a drop-in solution that allows theme or plug-in developers to take advantage of a very simple and streamlined way of making AJAX requests.
Introducing a simple, yet deceivingly useful, micro benchmarking / timer class called Bench . I’ve found myself on more than a few occasion using this familiar block of code in order to quickly narrow down a bottleneck or test a specific section of code. $start = microtime ( true ) ; // [ Some Code To Test ] $time = ( microtime ( true ) - $start ) ; echo $time . ' Seconds' ; This is a crude…
I’ve developed a new class for WinCache that wraps around the wincache_ucache * functions. The goal of this project is to improve and add to the functionality of WinCache’s User Cache feature. Basic Usage # Below is a quick code example of how this class simplifies the way in which a developer can take advantage of the user cache. /** * Get Cache Object */ $cacheObj = DDWinUCache ::…
While working for a previous employer I was tasked with developing a new company “intranet” site. Changes rolled out at an aggressive rate and the process of deploying updates via FTP quickly turned into a tedious task. After a while I decided to spend some personal time thinking of ways to make whole process a bit smoother. A few of days passed as I tossed around various ideas in my…
In this article I’ll explain what register_globals is; how to protect against exploits that take advantage of it; and why it should be turned off (if possible). What is Register Globals? # register_globals is a setting/feature within PHP that was intended to ease development by making variables passed to the script (via a form, cookie, or session) automatically available as predefined…
Notice: A major release has been issued since this post – Version 2.0 Changing the domain name or URL of a WordPress site can be a very frustrating and time consuming task. I usually have three development environments that I’m constantly switching between and all of them have completely different domain names. Server URL Local http://localhost:8888/ myProject Preview http:// myProject…
During the hours between 11:30 PM and 8:00 AM – while attempting to wrap my head around the development process of a WordPress Plugin – I found myself developing this fun, yet semi-useless, plugin that allows for the on-the-fly translation of plain text into “leet speak.” Usage # Translation of a post’s text into leet speak can be accomplished by using one of the…