RSSAmplifier

Blog

Daniel Doezema's Blog

Recent content on Daniel Doezema's Blog

dan.doezema.comRSS feed ↗21 posts

Latest posts

Illocutionary Force In Prompt Engineering

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…

About

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…

Goard — Project Management for Agent Swarms

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…

Tail Multiple Logs with Capistrano

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…

Add Eloquent ORM Tab to PHP Debug Bar

Using Eloquent outside of a Laravel project? – Me too! Collector Class # class PHPDebugBarEloquentCollector extends \DebugBar\DataCollector\PDO\PDOCollector { public function __construct () { parent :: __construct (); $this -> addConnection ( $this -> getTraceablePdo (), 'Eloquent PDO' ); } /** * @return Illuminate\Database\Capsule\Manager; */ protected function getEloquentCapsule () { //…

Doctrine 2 PDO Object

Where, oh where, is that pesky Doctrine 2 PDO object&hellip; Doctrine actually uses a base class called \Doctrine\DBAL\Driver\PDOConnection which extends the native PHP PDO class. It&rsquo;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. <?…

WordPress Domain Changer 2.0

Announcing the next release of WordPress Domain Changer &ndash; 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!

Setting Up LiveReload With Jekyll

When I decided to port my blog away from WordPress I found myself torn between two great static site generators &ndash; Middleman and Jekyll Feature Envy # One of the features that I&rsquo;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…

Programmatically Create & Title Tabs Within The Mac OS X Terminal.app

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&rsquo;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…

Recursively Sort Ruby Hash By Key

Here&rsquo;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&rsquo;d prefer to take more procedural approach.

Twitter Bootstrap Radio Button Form Inputs

I&rsquo;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' >…

How to Implement a Single User Model with Rails, ActiveAdmin, and Devise

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…

PHP Output Profiling: Echo vs Concat

I was in the middle of a code review a simple question came up: &ldquo;What&rsquo;s the fastest way to output a segmented string in PHP?&rdquo; 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 .…

AHAX WordPress Plugin

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.

Benchmarking and Timing PHP Class

Introducing a simple, yet deceivingly useful, micro benchmarking / timer class called Bench . I&rsquo;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…

WinCache PHP Class

I&rsquo;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&rsquo;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 ::…

Site Deployment with Subversion

While working for a previous employer I was tasked with developing a new company &ldquo;intranet&rdquo; 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…

The Basics: PHP register_globals Overview

In this article I&rsquo;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…

WordPress Domain Change Script

Notice: A major release has been issued since this post &ndash; 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&rsquo;m constantly switching between and all of them have completely different domain names. Server URL Local http://localhost:8888/ myProject Preview http:// myProject…

Leet Speak WordPress Plugin

During the hours between 11:30 PM and 8:00 AM &ndash; while attempting to wrap my head around the development process of a WordPress Plugin &ndash; I found myself developing this fun, yet semi-useless, plugin that allows for the on-the-fly translation of plain text into &ldquo;leet speak.&rdquo; Usage # Translation of a post&rsquo;s text into leet speak can be accomplished by using one of the…

Page Not Found

Sorry, but the page you were trying to view does not exist.