Source Maven

Code Partition for Beau Simensen


I'm a huge fan of PHP-FIG. I take part where I think I can make a constructive contribution and I try to tune in to as many of the discussions as my time allows. So when I saw Larry's poll about the Focus of FIG I was happy to have the opportunity to …

Read more

Tags: php, php-fig, opinion, psr-2

Writing Silex Service Providers

So you've gotten to the point in your Silex application that you want to start breaking it out into modular pieces. Silex service providers to the rescue! The service provider interface appears to be really simple but do you know which things can safely be done in each method? First, a high level overly …

Read more

Tags: silex, pimple

Default Configuration Parameters for Pimple Service Providers

A common requirement when writing service providers for Pimple based projects is to provide default values for some or all of the configuration parameters. Unfortunately, this is not as straightforward as it sounds. Update: And just like that, the whole premise of this blog post became moot. Thanks Igor! On one hand it is nice …

Read more

Tags: php, pimple, silex

Depot — A PHP Implementation of the Tent protocol

I have been interested in decentralized social networks for awhile now. It wasn't until recently that I found a project I could really get behind. That project is Tent. After idling on for several months and watching in envy as the likes of @beberlei showed off projects like Zelten I finally decided to throw …

Read more

Tags: php, tent

Django Advanced Model Choice Field

Django's ModelChoiceField only allows for a string label for each individual choice. While it can be customized to allow for a user to change what that string should look like it is still limited to being just a string. In my project I wanted to have the choices built out in a more …

Read more

Tags: django, python

Happy Birthday Sculpin!

I don't know exactly when I first started working on Sculpin but the first commit to the 1.0 branch was made exactly one year ago today. I wanted to do something special to celebrate but time has run out. So, happy birthday Sculpin! It has been a crazy year. Thanks for the fun times …

Read more

Tags: sculpin

A Pimple Console Service Provider

What started out as an RFC for adding a Console Service Provider to Silex resulted in a few fun personal discoveries. First, Pimple is useful beyond just Silex. I came to understand that most of the "Silex" code I have been writing has really been generic service providers. There really was nothing tying them …

Read more

Tags: pimple, silex, cilex, symfony

Symfony Finder Date Comparator Granularity

I recently ran into a hidden limitation in Symfony's Finder component. The find backed adapters use -mmin to do their "modified since" comparing and not the PHP based date comparator like I had assumed. This is important because it turns out -mmin is only accurate to a minute. The problem showed up in Sculpin. …

Read more

Tags: symfony

An Update on Sculpin

Although my workday has been filled with Python and Django, my early mornings and late nights have been filled with working on several personal PHP projects. One of the projects that has finally been getting some love again is Sculpin, my PHP static site generator. Sculpin is a PHP static site generator built around Symfony's HTTP …

Read more

Tags: sculpin, symfony, react

Dropping a PostgreSQL Database

I wanted to trash and recreate a PostgreSQL from scratch. PostgreSQL roles and security stuff are still a bit weird to my MySQL brain, so it took awhile to find an easy way to accomplish this: sudo -u postgres dropdb dbname I'm sure there are other ways to do this but this seems to …

Read more

Tags: cheat, cli, postgresql

Scaling a Silex Code Base →

One common misconception about silex and microframeworks in general is that they are only suited for small, simple apps, APIs and prototyping. Of course, those use cases are the main selling point, but they are by no means the limit of what is possible. — …

Read more

Tags: silex, php, opinion

Encouraging Contributions with the Easy Pick label →

One of the barriers to convert users into contributors in an open-source projects is that many people have no idea where to start. They are usually scared to take on large tasks because they are not comfortable enough with the code-base. Yet I think there …

Read more

Lincoln Loop Layout and Best Practices

Early into my adventures with Django I saw a few references to Lincoln Loop. Turns out they have provided some pretty decent Django materials including Django Best Practices. I had seen some references to Django Loop's django-startproject which referenced the Django Best Practices. However, the Best Practices actually say to start a project with django-layout …

Read more

Tags: cheat, django

Removing One File from a Git Commit

As often happens, I committed composer.lock when I had not actually intended to do so. Igor broke out the following after I went through a whole lot of stupid things on my own. Thanks Igor. :) git reset HEAD~1 filename && git commit --amend …

Read more

Tags: cheat, git

Adjusting Django Form Field Attributes from a View

I wanted to set a sane default number of rows for fields.TextArea in but wanted to be able to override that value from a view based on whether or not the view was going to be rendered as a modal. The solution: form.fields['some_field'].widget.attrs['rows'] = 8 …

Read more

Tags: django

Newer Posts
Older Posts