Neat Stuff

May 21st, 2013 about python and soofw

It's almost been two weeks since I open-sourced the web site and I haven't even written a post about it, so... here's a summary of things:

  • The new home page is alright. I didn't like the thoughts list being the front page, so I just made a small about page or something.
  • Layout, style, and usability improvements turned out pretty well, I think. Some notable improvements are the table of contents feature on each page, bigger line spacing, and a wider column. I also added tags/categories again, but I'm still pretty confident that Google does it better.
  • Updated projects and demos pages seem better as well. I pretty much just reorganized everything and updated the formatting a little bit.
  • A links page to archive all sorts of interesting articles I find.
  • An archive page that just lists all of my post headlines by category. Seems pretty alright.
  • Flask is awesome. I transitioned to it from my own framework and I'm blown away by how easy and powerful it was. The development server that comes packaged inside is phenomenal amnd makes development tremendously easy. Switching between web site projects is vastly easier than mucking with all the Apache configuration files.
  • nginx and gunicorn are awesome as well, and I'm really enjoying them a lot more than with Apache and mod_wsgi. Everything seems much clearer now and I feel like I have a stronger grasp on what's actually happening; whether that's because I've got more experience in general or these are actually easier tools to use is anyone's guess. Probably a combination of both.
  • Linode is magnitudes better than GoDaddy in terms of VPS hosting. Not only is it cheaper, but the dashboard and management web site is less cluttered and easier to navigate. Everything seems much more transparent, and I have more control over the server itself (eg picking my own distro from any possibility rather than a list of two or three). I subscribed for it a few months ago and haven't looked back. I even got a free upgrade, which is something GoDaddy never did in four years. Overall, the company just seems less scummy as well.
  • Delicious is okay. It gives me a quick way to bookmark links I enjoy, tag them, and then export them to a page on this site. It's nothing spectacular and I've encountered some small nuisances, but it works most of the time.
  • GitLab is awesome. I'm not using it for this site, but it's definitely a better option than paying for private repositories from GitHub. Honestly, I think it's better than GitHub in a lot of areas.

Huge update!

March 29th, 2013 about soofw

Well, well, well... where to start. I've added a few new features to the site and made a ton of changes in the source. Here's really simple changelog:

  • SCSS instead of CSS ‒ oh my god why have I never used this before.
  • Some CSS3 transitions ‒ just because they're neat.
  • Projects page ‒ for my personal projects and whatnot.
  • Demos page style update ‒ to be more readable and consistent with the projects page.
  • New page header ‒ you know, up there ^^^ for navigating the site and stuff.
  • No JavaScript ‒ I had some JavaScript loading on each page for no particular reason... now I don't!
  • New error page ‒ because I needed one.
  • Refactored code ‒ because I needed to.
  • Almost open source ‒ the code is almost reaching a level where I feel comfortable letting everyone in the whole world see it.

The end.

Snippets!

March 19th, 2013 about soofw

Huzzah. A new site feature: snippets. At the moment, it only contains a few infrequently used chunks of shell scripts used to configure some stuff, but I have high hopes for it. Beyond the addition of snippets, I've also updated some of the code base and I'm slowly working towards a version that's acceptable for open-sourcing. I'm also working on updating the site's URIs, so a lot of old URIs and legacy URIs will now 301 Redirect to the new URIs. Posts should also have a "view source" link in the top right corner, just in case you want to view an individual post's Markdown source.

Announcing... pyfw

February 24th, 2013 about python and soofw

After about a week's worth of effort, I've finally got a functioning version of soofw based on a Python and mod_wsgi. I wrote my own framework system to get a better understanding of the web environment for Python, but I'm not entirely confident it's the best solution for my needs. Earlier today I finished importing all of the legacy posts to the new system and flipped the switch to transition from PHP to Python.

Overall, it was an enjoyable experience. It felt pretty satisfying every time I got a piece to click into place. Python made it easy and quick to implement all of the features of the previous version plus some new ones. I wrote the new system with the eventual goal of open-sourcing it on GitHub, but at the moment it's a little... messy. I'd like to spend some time with it clean it up and get a chance to see where it misses the mark. I can already tell that it's a much more powerful and flexible setup than my old PHP, so I'm pretty hopeful.

Database

When I first started writing the code, I decided I didn't want to use a(n) SQL database anymore. They're too clunky for such a simple project. I didn't want to use an awkward (and probably insecure) admin system every time I wanted to publish a new post, and I definitely didn't want to write that admin system. I also didn't want to use a standard MySQL admin system like phpMyAdmin and its ilk, because they're ugly and hard to use. Using a database system also comes with some other barriers, like migrating between a production and testing server. It annoyed me.

As a result, I decided to use a filesystem based "database". Within the application directory I have a posts directory, and inside of that posts directory I have a list of plaintext files. A script reads the directory and generates a post listing. Each post file contains some Markdown-formatted source text and some meta properties like publish date and title. From there, the view decides which posts to display and fills a buffer with rendered templates, which the WSGI app returns as the page content.

First, yes, I know that most Python web frameworks come with their own database management system. Yes, I know that databases are much faster than a filesystem set up. Yes, I know that I can't query the filesystem and find posts matching a certain tag, date range, etc. But I also don't need any of that. I did away with tags a while ago; Google does it better anyway. I only have 40-something posts, so the speed a non-issue. I even tested it with 1000 posts and the read times were negligible. As for the management system, I'm much more comfortable using a terminal to manage my posts. I can clone the site's Git repository to my computer, write a new post and preview it locally, and then commit and push back to the site to publish. I'm not missing out on any features, either, because I have the full power of the Linux shell to help me out. I can search my posts with grep and write them with Vim. I don't have to deal with a bad web editor or funky search syntax. At the moment, I'm much more content with the flexibility of a filesystem database than a standard one. I also don't have to store my database credentials in my source files anymore, either.

No more PHP

Where to start... PHP sucks. There's dozens of posts defending it, and some of them have a lot of great points. It does have a really low barrier to entry, and that's the primary reason that I learned it. It was easy. I could make dynamic, templated web sites in a matter of minutes, and it took away all of the pain of updating all my HTML files whenever I made a design change. It was great at the time, but now I can't stand it. I can't stand looking at my old code and seeing foreach($array as $key=>$val) anymore. The $ variable prefix makes code incredibly hard to read, and I still don't even understand the as...=> syntax. There's even more weird stuff in there, like the infamous T_PAAMAYIM_NEKUDOTAYIM error messages and function case-insensitivity (MAX(...) is the same as mAx(...)). Variables are case-sensitive, however. It's just functions that don't matter. Why? I don't know. If you're interested in a more thorough write up, I suggest you read eevee's post.

Markdown

I was mostly just sick of writing <code>...</code> every time I wanted to highlight something in monospaced font. HTML tags are pretty verbose, and when you're trying to get thoughts out of your head it can be a pain in the ass to spend an extra 13 (17 with shift!) keystrokes on formatting. Markdown, as stated in its design philosophy, is easy to read and easy to write. It's such a natural system for formatting, and it has a whole host of features I didn't even know existed until I actually checked John Gruber's official documentation. I never want to go back to writing my posts in HTML. Miserable.

Vim

Oh god. I can write my posts in Vim now, and I don't even have to cat the file, copy it, and then paste it into MySQL. This is easily my favorite feature of the new system. Paired with Markdown formatting, I've made it orders of magnitude easier to write my posts.

Open-Source

I can do this now that I won't expose any possible security holes like the database credentials, schema, server, etc. Huzzah! Beyond that, Steve Losh was a heavy influence on this decision, so I'm just going to redirect you to his article instead.

Directory Structure

Not much to say here, but my last directory structure was bad. I mean it. Insecure, horribly unorganized, unmaintainable, and straight up bad. I've reorganized and toyed with my Apache configuration to create a much more rigid organization.

Portability

Kinda? It's much easier to get my site running on a new machine when it's not tied to a database server. All I need to do is install the dependencies and set up the Apache config files. Lovely!

Maintainability, Readability, Writeability

My code is so much easier to maintain, read, and write now. Python has made my life so much easier than it was with PHP. The post database is also much more accessible and maintainable as well, so that's a giant bonus.

Publishing Method

Again, simplifying my life. I write posts in plaintext on a local copy of the site and then push them to the server when I want to publish. It's simple.

Version Control

I can store my posts in version control now! If I accidentally rm posts/* I can just restore them through Git. Paired with the improved directory structure, this feature is even better. The former structure made it possible but not easy (I still used it, however), so I'm excited for this.

That's it... I think. If you have any suggestions or comments, please feel free to contact me via email! Thanks for reading.

Layout Testing

February 2nd, 2013 about soofw

So, I'm at it again. soofw has a new style. Here's a preview of all the things I plan on using. Up at the top is the standard header level 1 with the post title. Titles with a dotted underline will link to another resource. The date (and its lemniscate) provide a permalink to this article.

If viewed on the home page, the article will break after this paragraph and ask you to continue reading. If viewed as a single article, nothing special happens after this paragraph. Oh yeah, here's some inline code style.

Header level 2 and paragraph

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis suscipit tempor eleifend. Etiam id odio non leo varius tempor. Maecenas lorem mi, rhoncus eu a link for awesomeness interdum eu, sodales ac justo. Sed tellus nunc, elementum in eleifend at, hendrerit ac nisi. Morbi accumsan, nunc nec faucibus hendrerit, lectus lorem luctus diam, sit amet feugiat neque massa placerat quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec enim augue, pretium eu eleifend eget, venenatis in urna. Suspendisse non augue sem.

Header level 3 and paragraph

Fusce justo nibh, pharetra ac volutpat in, condimentum ac nisl. Sed sodales sodales sem nec gravida. Quisque ut ante nec augue tincidunt consectetur at nec magna. Integer fermentum neque sodales tellus semper consequat. Curabitur nec tempus erat. Donec nisl dolor, convallis nec ultricies at, lacinia non orci. Ut id ligula elit, at dignissim enim. Praesent hendrerit, lorem sed fringilla pharetra, nisi turpis consequat ligula, et placerat leo libero nec dui.

Quote

To this end, Markdown's syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. E.g., asterisks around a word actually look like emphasis. Markdown lists look like, well, lists. Even blockquotes look like quoted passages of text, assuming you’ve ever used email.

Block formatted code

Source Code Pro Regular
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(*!?')
0oO()[]{}
1iIl|L

Unordered list

  • Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  • Aliquam eget augue vitae enim lacinia mollis.
  • Praesent tristique turpis quis lectus aliquam at fringilla velit auctor.
  • Nulla eu augue nulla, a posuere felis.
  • Nam a ante non tortor faucibus placerat nec at metus.

Image

Alt Text

Embedded Video

Closing paragraph

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis suscipit tempor eleifend. Etiam id odio non leo varius tempor. Maecenas lorem mi, rhoncus eu interdum eu, sodales ac justo. Sed tellus nunc, elementum in eleifend at, hendrerit ac nisi. Morbi accumsan, nunc nec faucibus hendrerit, lectus lorem luctus diam, sit amet feugiat neque massa placerat quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec enim augue, pretium eu eleifend eget, venenatis in urna. Suspendisse non augue sem.

soofw

November 7th, 2012 about soofw

It's such an inevitable question. "Soof double-you? What's that mean?" Nothing. It means absolutely nothing. "Why'd you pick it then?" It's short, looks elegant, and is really easy to type for me. Those are seriously the only requirements I had in mind when I bought the domain name a few years ago. The lowercase S at the beginning is just for style reasons; I think it looks cleaner. As for the purple, it's my favorite color. The favicon is a purple lemniscate laid across a blue hourglass. I just like those things. Time and infinity are neat. Pronunciation-wise, I say "soo-fwoo" so it rhymes with "Sue flew." You can pronounce it however you want though. It's up for debate.