Blog
I enjoy playing Minecraft, and in particular I like making circular things in the game. I generall google a chart or a generator while I'm building. I wanted to be able to make variable size ovals which is something I didn’t find a generator capable of doing, so I created this! I made it for myself, but if someone else finds it helpful, that would be awesome!
Fork my source on Github!…
Read More / Comment »
A hierarchy is a common structure, especially in web development. The problem with hierarchies is they need to be flattened to be stored in a relational database, and then expanded again after being pulled out.
An Example Hierarchy
Top level item
Sub Item
Sub Sub Item
Sub Sub Sub Item
Sibling of Sub Item
Top level as well
A common and simple way to store them is with a table structure similar to the following.
id
parent_id
title
1
0
Top level item
2
0
Top level as …
Read More / Comment »
So yesterday I was bored and asked my friend what I should do. She replied "I don't know, draw ASCII art or something!" and sitting there with the terminal open I kind of wondered what it would take to write one of those image to ASCII scripts.
20 minutes later I had the following PHP Shell Script! It works by simply sampling the saturation of every Xth pixel and mapping that saturation to a character from an array. There is no nearest-neighboring or anything like that, just straight up sampling.
Huzzah!
And there you have it! A whopping 35 lines of code. There is a ton of tweaking you can …
Read More / Comment »
I recently upgraded from an aging MacBook Pro to a much more nubile MacBook Air. I am frankly delighted with the Air in every way. The problem I encountered though is the sparse image backup of the MacBook Pro I made with Carbon Copy Cloner before I wiped the drive and sold it is seemingly corrupted and will not mount.
I did though have a backup of my Photo Booth Photos and wanted to get them to be recognized by the application. It is admittedly simply a matter of entering them into the Recents.plist file, but having several hundred photos across three operating systems and three naming scheme…
Read More / Comment »
It would seem there is a fair deal of call for an updated version of my PhpED dark theme from colleagues as well as random folks on the internet who’ve seen screenshots of my PhpED installation. I previously had my Dark Theme for 5 linked on my Review of PhpED, but I figured I could have a page dedicated to it.
Screenshots
Download and Installation
The first step is to download the proper version. Click here to download the PhpED 6 Version or here to download the PhpED 5 Version.
After you have downloaded the file you will need to replace your hl.cfg. In Windows 7 or Vista th…
Read More / Comment »
Today I decided to spruce up a VB.Net application I wrote in
college and still use almost daily. In the process of converting it
from .Net 2 to .Net 4 I wanted to add a splash of Windows 7 goodness; there were some
very simple operations I wanted to add to JumpLists. The problem I ran into with all the examples I
could find is that they either called entirely different applications (the Microsoft
examples all called Notepad) or
the example was in C#. The
application is in VB.Net and I intend to keep it that way, as it is my .Net
language of choice.
The interesting problem with Jump…
Read More / Comment »
I find myself often needing to set up a large number of 301 redirects from an excel file of old to new url’s. Until this point, writing these had been a fairly exhausting process as you need to be certain to escape every character that could be picked up by the regular expression engine, or risk unintended consequences. On top of that, writing these rewrites to catch GET parameters in any order is complex to say the least. While working through a large list of 301s for a very picky server where Redirect 301 style redirects were not an option, I began setting up RewriteRule's by hand and dec…
Read More / Comment »
Googles Page Speed “Optimizations” Make Learning Difficult
If you, as I, grew up during the web bubble we call the 90’s and were interested at all in web development my guess is that you probably didn’t learn most of your skills from a book or a class. You probably would run across a site that had something cool on it and ponder “Oh my, how does that work?” right click, view source, and after some digging were enlightened. I’m certain this is how most of my generation learned their HTML/CSS/JavaScript skills, it is certainly how I did, and often…
Read More / Comment »
Grid Style Sheets Must Die
I have been aware of Grid Style Sheets for quite a while, but I long ago dismissed them as a fad like CSS Resets. Recently though it came to my attention that OSCommerce 2.3 switched to the 960 Grid Style to replace its table based layout system. I spend most of my development time working with OSCommerce and thought it would be good to understand this change so I could decide whether or not to integrate it into our fork.
My general impression playing with the latest nightly of OSCommerce 2.3 from Github though is that I don’t like it – maybe I’m …
Read More / Comment »
Several months ago I was wondering to myself if you could detect patterns in a list of words and then use those patterns to generate a new list of fake “words”. A kind of a flavored Lorem Ipsum generator, where I could change the feel of the sentences by switching out the data set. I’m sure thousands of developers have done this before me – but it was a fun thought experiment.
I threw together a little script in PHP to test the idea, and the results were kind of interesting so I figured I'd throw it on my site - Anyway, here are some examples in action – you can hit re…
Read More / Comment »
In my work, I deal with a lot of very similar codebases - and often if I fix something in one project I'll want to fix it in many others. For a long time this has meant popping open Beyond Compare, which works, but isn't the simplest solution.
I use git on my projects - but they're not similar enough just to be branches. Recently I came up with a way to patch one or more commits from a project to another easily. Here is a simple shell script I wrote to handle the task.
Simply put, you can use it either by fast-patch.sh /z/my_project to patch a project with the latest commit from the project …
Read More / Comment »
With Google recently starting to involve load time in search rankings, there has been a lot of talk about GZIP. Google Webmaster Tools exclaims "Compressing the following resources with gzip could reduce their transfer size by XKB:". Many people listen to this, and go out looking for a quick fix without realizing that poor GZIP implementation has a strongly negative effect on the overall user experience.
There are two main ways in PHP to go about implementing GZIP. The first is ob_gzhandler. Basically all that is really involved in setting this up is adding ob_start("ob_gzhandler…
Read More / Comment »
“There Isn't an App For That” - Windows Apps I haven't been able to replace in Mac OS X
For a very long time I was a Windows guy, I was once a DOS guy. I switched nearly exclusively to Mac for my home use about 4 years ago. I’ve been very happy with it. Its stable, well engineered, and - my favorite part of all - consistent. Yet, in this time there remain a few applications I cannot seem to replace.
Nusphere PhpED
I am a PHP Developer by trade, and PhpED for my money is by far the best development environment for the serious PHP developer. When I do develop on the Mac platfo…
Read More / Comment »
After much ado, Donat Studios is finally live!
There are a few things left to complete. Eventually setting up the documentation and public git repository for CorpusPHP will certainly take up a fair amount of time. I'm still not quite sure what to put in my portfolio, I was thinking of for the time being just throwing a bunch of my sketches in there.
My reasoning and goals behind this site are slightly different than my other sites. More than anything I wanted a place where I could rant about everything web related. I have strong opinions on many topics, and where Oasisband.net is good for mo…
Read More / Comment »
I don’t want anyone take this the wrong way. I am having a torrid affair with JSON. It is so much simpler to parse than XML, and is an all around exceptional way to represent data. I have one caveat though, and that is “JSON with Padding” or “JSONP” as it goes by.
While building this site I was trying to bring in images from my Flickr account, as you may have noticed. Building the module in PHP, I basically ran file_get_contents on the feeds url and passed that directly into json_decode. On print_r’ing the results, it was null. It had failed. As…
Read More / Comment »