What This Site Runs On – Part 1

Having gained a lot of new front-end skills with my newish job at Staplegun, I decided to give my site a revamp. The old site was a pretty minimal (ahem…terrible) landing page that just gave basic information about myself, as well as external links to some of my projects. Now, I felt like I could finally develop a site that houses more than just external links – so I decided to rebuild it all. I’m pretty happy with it, and I thought I’d share the tools, languages, and frameworks I used to build everything

Where does the name The Societea come from? We’ll save that for another post.

I’m breaking this topic up into 2 posts; this one will specifically deal with my choice on whether I decided to use a database for my site, and furthermore, a CMS. Let’s get to it:

My Initial Planning

I initially planned to revamp my site into a completely static project that was just straight HTML, CSS, and JS. I was planning to have a static page blog where each blog post would be its own Markdown file, and then to use a server-side build tool like Middleman to use ERB and build/rebuild out the pages after each blog post. I would use nginx to load the pages super fast, and most importantly, I would only need a simple Git repo to manage the entire site; no database whatsoever.

But, then I started wanting to take it further. What if I wanted to tag my blog posts, and maybe even give some dynamic options on the page to filter blog posts based on tags? I also wanted to show off my projects that I’ve worked on as well and give them sortable tags as well (languages used, role, company, etc.). Could I make the projects modular code-wise on the site, and split them up into template-like blocks so I didn’t have to code the exact same html multiple times? Would it be difficult managing posts, projects, and other repeatable chunks? The more I got down to it, the more I felt like I needed to get a database involved.

How It’s Implemented

Based on my needs, I ended up using a database. I ended up using a CMS. Yes, I ended up using WordPress. I’m using WordPress, and it’s exactly what I needed. Through a CMS I’m able to handle code chunks incredibly easy with posts, projects, and more, and updating anything is so simple. I coded my projects page initially sans-CMS, and I was looking at over 150 lines easily since I was duplicating so much html. Now, by pulling my images and text from a database, that’s down to 43 lines (including whitespace lines) — and I’m using the same template for my blog posts parent page!

Now I know CMSs aren’t the cool things developer-wise anymore, but I’ve come to realize what they are. A tool – nothing more. As a developer, I’ve gone through 3 phases of WordPress acceptance:

Phase 1 – What’s WordPress? *is shown WordPress* …. Wow, this is awesome! I can make a decent looking site in no time with free themes and plugins!!

Phase 2 – WordPress? Nah, that’s not cool once you’re a real web developer. Custom build all the things!

Phase 3 – I know what I need. I know what WordPress does. WordPress is what I need to organize my site and manage the things I need to manage. I’ll custom build the site structure and styles myself.

So, yes, this site runs on WordPress, and I’m loving it. I custom built the theme and have all the visual plugins running purely through javascript, so I’m literally using a CMS just to manage the content that actually needs managing. Not everything though, mostly just repeatable things.

Cons of Using a CMS

There are some things that were very important to me that I can’t reap the benefits of anymore due to using a CMS:

Slower Page Loads – Since the site now interacts with a database, it’s certainly not faster than purely static pages being served up by nginx. Though I really can’t tell much, I still know that’s a fact.

Version Control Complexity – Having a database complicates code management. I initially wanted to just be able to push my files up to a Git repo, clone it anywhere, and know it will just run as is. However, now I need to dump the DB into a local dump SQL file, put that in the repo, and then restore the DB based on the dump file. And, if it’s an initial clone at a new location, I’ll also need to create the DB user and the actual database itself. It’s not too much extra work, but it’s more complicated than just a ‘git clone xxx’.

So there you have it. My site uses a CMS, and while there are some cons associated with that, I chose to use one because the benefits outweigh the negatives by a longshot. I know I didn’t cover much here, but I really wanted to explain my rationale and some of the struggles I was…well…struggling with as I was planning this site.

Next post will cover specific tools I used to build the site, js plugins, preprocessors, and page optimization. Stay tuned!

Vim as Your Editor?

I’ve been using Vim as my editor for the past couple years, and just like most people who use it, I’ve grown to live and die by it. Vim is a wonderful text editor specifically geared towards coding (even though I’m known to use it for building shopping lists, and other gangster….lists), and you should really check it out if you work with the Linux terminal a lot.

Let’s review what Vim is. Vim is a modal text editor that is incredibly customizable – you can pick your own color schemes, look and feel, key mappings, plugins, and even build your own plugins as well. Modal means that vim has different modes such as insert, visual, and normal mode. Due to these different modes, vim allows you to never have to use the mouse to interact – it’s all keyboard (this might blow your mind if you’ve never heard of this concept before). People use Vim for a variety of reasons, and usually don’t ever look back once they’ve started using it. Let’s review why you should start using Vim, if you don’t already:

  • Vim makes you lightning fast

It’s true, the top reason people love vim is because once you’ve gotten decently good at it, you become so quick at editing code. Vim is also a skill that you can keep getting better at, so that means you can keep getting faster and faster. Being able to completely, and I mean completely, code all day without ever having to lift a single finger off of your keyboard….that’s power, my friend. Raw power

  • Vim is super customizable

Yes, I’m sure your editor allows you to choose color themes. If you’re using one of the proprietary text editors like TextMate and Sublime Text, I’m sure you are granted a lot of customizable options as well, but vim…it’s just different. Sure you can customize your colors and key shortcuts, but that’s just baby steps. Vim has such a following of developers that build cool plugins…it’s just amazing. You can find such powerful plugins (and powerful pre-built combinations of plugins like Janus or spf13) that allow you to do exactly what you need, with nothing but a few keystrokes. Heck, you can even develop your own plugins if you’re badass enough.

  • Vim is cross-platform completely (Even for you Windows guys)

You can use Vim on any platform – Windows. Mac OS, and all the Linux distributions. TextMate is a popular editor (costs about $50), but it only works on Mac. Sublime Text is also a big editor that is indeed cross-platform too, but still costs a good $70ish bucks for a full license to use it. This leads me to my next point…

  • Vim is absolutely free

No Gimmicks. Nuff’ said here.

  • Vim is used in the terminal itself

This might not be as a big of a deal to some developers, but if you program on a VPS that uses linux (sorry TextMate), then it’s often much easier to do everything you need to by just ssh-ing into your server and coding straight from the terminal. This is where vim is in its native environment, and thrives like a pure machine. Sure, vim has a graphical version as well (MacVim for Mac OS, GVim for everything else), but it’s basically the same as Vim with a larger default color sets. If you do own a VPS and don’t use vim, then I really recommend you look into it.

There are many more reasons why you could and would want to use vim, but if I haven’t convinced you already, then nothing’s gonna do it. Do some googling on vim though and see if you want to check it out. If you do, then stay tuned; the next blog post will be on the best ways to learn Vim (and trust me, there’s a bunch of them).

Where I Buy Tea

I have been drinking tea for about 6 years now, and the quality of tea I have chosen to drink has risen throughout those years. I have moved from purchasing local grocery store tea bags to buying “whole leaf” tea that is still in tea bags, all the way to purchasing loose leaf teas by the ounce at local tea stores and Teavana (Amazon, too!)

However, as I have done more research about teas, I have learned that certain teas are kept in storage better than others, and some teas are freshest only in the first year of their life. That means from the moment they’re picked, they will only have that superior magnificence for a single year. Since the vast majority of teas (not tisanes) are produced in Asia, it typically takes a while before the new season’s tea leaves are shipped in great quantity to the United States and other western nations.

I have never actually seen a tea company, be it a commercial tea bag producer, quality loose-leaf tea retailer like Teavana, and other online tea shops, disclose when their teas were plucked and/or shipped to them. However, I have found one tea retailer that goes above and beyond their call of duty to truly try to acquire the freshest and highest quality of tea leaves, and fully disclose all information related to tea quality:

Tea Trekker

Mary Lou and Robert Heiss are the owners of this Massachusetts tea shop, and have been in the tea business for decades. They have established personal relationships with tea farmers in Asia and frequently travel to see the new season’s pluck, as well as create more relationships with new tea farmers. This enables them to source incredibly high-quality teas and have them shipped to the United States very soon after plucking, which allows tea enthusiasts like me to purchase and drink them while knowing exactly when and in what region the tea leaves were plucked. This is perfect and almost necessary knowledge when trying to plan how long each tea can be stored in order to brew them while they are in the freshest state.

The Heiss’ also have a wonderful book, which much of The Societea’s tea data is based off of:

The Tea Enthusiast’s Handbook

I have read this book front-to-back at least twice, and use it often as a reference. If you currently drink tea and wish to learn more about it, and possibly purchase high quality tea as well, then I highly encourage you to check out this book. Beware though, this is a no-fluff book which contains rock solid facts and detail; make sure you’re in a mental state that’s ready to learn!

So for those of you who have purchased tea in the past and are curious as to where a high-quality tea seller is, look no further; Tea Trekker has got you covered.