Tag Archives: django

Image Generation on Granny Squares

It’s been a while since I’ve done anything significant on my Granny Square Pattern Generator (GSC), and since I’ve already contributed to a game release this week, I figured I hadn’t quite checked enough “public-facing actions” boxes this week until I did some work on GSC.

Biggest missing feature (and biggest complaint!) is that blankets weren’t printable. Now they are!

Log in with something like Facebook or Twitter, generate a blanket, and save the blanket. When you look at the details of the blanket, you can now get it as a printable image, and toggle between the two styles of seeing the blanket.

My next task is to make authentication more seamless.

Techie Bits

Continue reading Image Generation on Granny Squares

1 Damn Percent

I’m just about ready for a new release of Granny Squares. I did all my tests and development, merged with the master branch, and ran my tests again.

And one failed.

A trivial case–ensure that there’s one instance of the form in the formset on the main page of the site.

It certainly works. But the response object’s context is None, even though the content, status code, etc., are on point.

Continue reading 1 Damn Percent

Granny Squares, Now in Color

A pretty ugly blanket generated by the Granny Squares app.Many moons ago, I debuted my Granny Squares Color Pattern Generator, a utility to help crocheters randomize their blankets, which can be a daunting task.

I recently got a request for a way to help visualize the blanket that’s generated. It’s hard to work from a list of “r/h/p”-type entries. Not very user-friendly.

So I added in a color picker today, and the generator now shows the colors of the squares. As a warning, if you have a lot of very similar colors, the generated image may be difficult to work from. Then again, if your blanket’s in 15 shades of purple (yes, please!), you may not need this utility.

Continue reading Granny Squares, Now in Color

Chewing on Granny Squares

My knitting colleague E. made the (arguably) goofy decision to refresh her crocheting skills by taking on a granny squares blanket.

It’s a great idea for using up a ton of scrap yarn.

It’s not a great idea if you enjoyed the level of sanity you had when you started.

She quickly ran into the classic self-randomizing problem: given 20 different colored yarns of different weights, how do you put 3 different ones in each square while trying to keep the colors as random as possible? Sounds easy enough, but after 15 or so squares, it gets tricky. If you’re aiming for randomization, the last thing you want is a big diagonal of purple in your blanket when you’re done.

So E. appealed to me and asked me to write her a “script” to randomize her colors. I was on board, look forward to some Python/Django fun before I realized that what I’d been handed was a graph coloring problem with some fun restraints. (Turns out it was easy, but fun to think through.)

Before I get into the technical bits, go make a blanket or two. Then go find some esoteric method to contact me (or comment here) and let me know what you think, especially if you run into an issue.
Continue reading Chewing on Granny Squares

Deployment Automation with Fabric: Bee’s Knees

One immensely valuable thing I learned at Skookum was the value of automated deployments. I worked with a gent who took the time to work up Capistrano scripts for each staging and production environment of the whale of a project I worked with him on.

I appreciated it during development, but I didn’t appreciate it until we were deploying single tweaks out to production on Amazon EC2 in rapid cycles. I haven’t worked with EC2 since then (second half of 2009), but let me tell you, deployments were for the birds.

With his scripts though: run the script, enter your SSH or git password(s) a few times, and you have an automated deployment that runs for each person on the team, despite all our separate setups (Mac, Linux, cygwin, etc.).

It sounds trivial and obvious, but how many deployments did I do by hand, or try (poorly) to document for someone else, or forget how to do before that really sunk in?

Continue reading Deployment Automation with Fabric: Bee’s Knees