general development Posts

Naming things considerately is an act of selflessness

Not sure if I mentioned this in the last post, but what I'm doing right now is essentially building a data warehouse for the company. It's from scratch, there was nothing here beforehand, so I get get to/have had to chose everything from the tech stack to the processes to my favorite part of late: naming things.

The name you give to a piece of software, or a command line flag, or a column in a database is an act of asynchronous communication with another human. You are asking them to care...

Continuous integration at Platform.sh

WTF is "continuous integration"??

So, back in the old days, building websites was simple. You had plenty of options for how to build one but me personally, I was totally fine with Wordpress and Drupal. They didn't force me to know what was going on under the hood to be productive and they provided a way for me to learn that stuff along the way while feeding my family. I learned CSS on the job while building the first couple things I ever built.

Cascading Style Sheets (CSS) is a...

The Little Platform.sh Book - Introduction

The internet is hard these days.

It started simply enough - for instance, all you really needed was a Geocities account and some initiative to learn HTML and you could have your own place to put whatever you wanted and make it available to the entire world. From such simple seeds, complex structures did grow..

Geocities was permanently shut down in 2009, at once both a tragedy for the loss of so much content, so much history, and yet also a wake-up call for so many of us that we needed to...

Platform.sh from scratch, part 0 - explaining Platform as simply as possible.

Hello, and welcome to "Platform.sh from Scratch". In this prologue to the series, I'll go over some of the very highest level concepts of Platform.sh so that you'll have a clearer understanding of what this product is and why it came to be.

Platform.sh is a "Platform as a Service", commonly referred to in this age of acronyms as a "PaaS". The platform that we provide is essentially a suite of development and hosting tools to make developing software applications a smoother end-to-end...

RTFM before you need to

So this is it, my week in between my old job and my new job. And I'm bored out of my mind. So I'm going to do something I've never done before - write a blog post on my phone. We'll see how this goes.


I was texting w one of my former coworkers a little earlier today. He was picking my brain about how the AWS command line tools work and so I was explaining some things to him in too much detail. I've noticed this thing that I have where I want to explain the why of things and not just give...

Know Thy Elders

I'm starting a new gig in a couple weeks. I found out about the existence of the gig in the first place because I follow the guy who will be my new boss on Twitter, since he's been around the Drupal scene and very long time and following the leaders in your industry is basically one of the core things that Twitter is for.

You don't need to necessarily know every single leader in every single lang, but if you work on the web and want to move your career forward, you'd do well to know who...

Knowledge Hunters

I work with a guy. He's incredibly smart. He's the seniormost developer here, and if you need to learn something new and get something large done, he's the guy to do it. We basically dropped him off in the AWS jungle and told him to learn Hadoop and the entire Hadoop ecosystem for a data warehouse project and he did it.

I work with another guy. He's also incredibly smart. But he asks me for the answer before attempting to find it on his own more often than not. He's got a point when...

Prev/Next as linked lists in Django

Problemspace

I want to be able to link a set of posts together in an order. If there is a next post relative to the one I'm on, I want a button to show up that says "next post" and links to it. If there is a previous post relative to the one that I'm on, I want a button that says "previous post" and links back to it. Pretty simple, conceptually. Basically I want to reproduce parts of the Drupal book.module as minimally as possible.

So my first naive attempt was to add 2 ForeignKey...

Goodbye Rails, Hello Django

So here it is. The last version of this blog - a Rails frontend to a Postgres backend - actually stood for almost 2 and a half years. I think that's probably a record.

In keeping with my decided new theme for this blog however, I've decided to rewrite the thing in Django. Not that you can't google it yourself, but Django is (at a high level) basically the Python version of Rails. Actually, it's basically the Python version of every MVC web framework. It's been around for 10 years, so...

What is my $PATH?

I remember being very confused by this one early on. There were boatloads of tutorials on how to change your $PATH, but what that even means in the first place I just kinda had to figure out over the course of it all. It's actually pretty simple. Here's my attempt.

If you're coming from a Windows background, and you were in the habit of being really fussy about where you installed software on the hard drive, you may have just known how to fire up any old piece of software on your system....

What is curl_setopt()?

When I first started getting into this, I read a lot on PHP and remember clearly having my eyes go crossed when I came across code like this --

<?php
// Example code: Creating Drupal 7 nodes by POSTing from cURL in PHP:

$site = "127.0.0.1/d7";
$user = "someusername";
$pass = "theusersassword";
$crl = curl_init();
curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($crl, CURLOPT_USERAGENT, 'PHP script');
curl_setopt($crl, CURLOPT_COOKIEJAR, "/tmp/cookie.txt");
curl_setopt($crl,...

A URL strategy

I've got this decoupled CMS brewing in my head, and wanted to jot down what I think would be a kind of cool method for generating URLs and URL redirects and making sure everything stays in sync without having to maintain a giant table of redirects (ala Drupal).

The basic scheme would look like this -- site.com/{item_type}/{item_id}/{item_slug}. The type parameter could probably be optional, but it's there for now. An example URL could be...

My favorite technical interview question

It's very simple. I work at a publishing company in northern New Jersey. I think we hire pretty smart, but the technical interview tends to be more of a conversation about technology than a series of quizzes on the whiteboard. We've been hiring for a few positions lately, and I've recently hit upon the perfect conversational tech interview question. It's separated a lot of wheat from a lot of chaff for me in the past few months.

"What text editor do you prefer?"


I've recently begun...

Cool Nginx feature of the week

Nginx configs

So I recently had a couple of seemingly disparate tasks come across my desk. We recently launched a HMTL mobile app, an Angular front end to our Drupal sites. We decided to completely decouple the mobile app from the Drupal codebase after a fairly long exploratory period trying out different approaches.

When launch day finally came, we set up the mobile app at app.$BRAND.com, with our main sites at www.$BRAND.com. Acquia has this cool feature in their Varnish layer that...

Where is the Homebrew Memcached config file?

I've finally been getting around to using Redis for caching on this blog and other Rails projects I've got laying around, and I've finally gotten around to Homebrewing PHP 5.5 to use for my local set up at work. Jose's default PHP 5.5 brew doesn't install the new Opcache, so look around and make sure you install that version because it screams.

I guess you could fairly say that caching has been on my mind a lot lately as I also finally got around to installing and using Memcached here in...

Helpful books

This is a little collection of books that I've found helpful over the past few years, ranging from design to development to business to fiction.

Ruby/Rails

Drupal

Step 1 - text editor

May I suggest you download this book -- Learn Python the Hard Way? It's got instructions in the very first bit about getting a decent, free text editor installed. TextEdit that comes with the Mac leaves quite a bit to be desired, and though I haven't personally checked out GEdit, I'm sure it's a step up. Of course if you think you might want to get serious about this, or if you get serious about this down the line, may I suggest dropping $60 on TextMate? I know it's kind of a lot of...

Let's try something.

Does anybody here want to build something? My buddy Jimmy of This Blog fame laid an idea on me the other night. He's a teacher, and a fairly progressive, observant one at that. I believe him when he says that there's nothing out there like this kinda simple, cool idea that he had. I think it must exist somewhere but it's not being properly promoted if it does. So, I thought maybe it'd be a cool idea to try and teach him a little something about web development, and teach myself a lot in...

Thursday morning coffee with the n00b developer - domains and hosting

Welcome back to another installment of the newby web developer series. This morning's entry comes once again from our buddy Jimmy, who the two of you reading might know as the highly technically inclined CT robo-teacher. He'll probably be reforming the state of education in your state soon.

What's up fool. My friend wants me to build him a simple site using wordpress. He already owns the domain name. My question is, once I build the site using MAMP, and get everything upload to our...

Slightly more in depth with Wordpress

I am having a blast. I found a nice photo gallery Gen Next - has lots of cool features; still working on it. I do need some help: 1) how do I keep the 'home' page of the WP site clear of posts? I just want to put some html text and links. It seems to always show the latest posts. I need to understand what is going on with that page. 2) How can I order the posts within a category. example: For Lyrics I have category per album with a post for each song. I need to order them in track...

The newby web programmer. Episode 3.

So, you've spent the last few months teaching yourself Wordpress. Good job. There are lot of crappy websites out there, most of them built by some site-builder commodity crap-stuffer at GoDaddy or Network Solutions or some other budget host. These are God-awful examples of poor web development practices. They're ugly. They don't render correctly in browsers. Many are all but invisible to search engines, which begs the question - if a website fails to show up in the first couple of...

The newby web programmer. Episode 2.

So, you've gone and installed MAMP and WordPress on your computer, or if you wanna sound really hip you call it your "local machine". You've gone and started building out a wordpress site for your school because your current website is an outdated embarrassment. Wordpress is kind of the no brainer choice, or so your buddy told you, because it's super easy for anyone to use who's familiar with a word processor. You'd like to attempt to keep the content on your site fresh, so it sounds good...

Chapter 6b - the layman's introduction to database migrations in Ruby on Rails

This is not for programmers. This is for myself, because when I first started poking at Rails 6 months ago, I didn't have any idea why I needed to edit a migration file, much less what a migration was, except that it must have something to do with a database. I only knew that because of the command

$rake db:migrate

<

p that I was told to perform and the fact that it had the letters "db" in it.

<

p

So here's the deal. This morning I talked about version control and it's place in the...

Chapter 6a - Version Control

So it's been a while, eh? Not too much in the mood to write about what I've learned when most of what I've learned is how much I have to learn, y'know? Anyway, I've been back into Ruby on Rails lately, since Ruby has got to be the dead simplest real programming language out there. Oh yeah, and I have a major project cooking on Rails, but I'll elaborate later. Let's talk about version control...

Let's pretend you're typing that last term paper in college. This is the modern era, so...

Chapter 4 - The API

Facebook made this announcement yesterday through the Developers section of their site:

Today we are excited to announce an important step toward greater openness through Facebook Platform. For the first time, we're opening the core Facebook product experience -- the stream -- with the new Facebook Open Stream API.

What this says to me is that Twitter is having a major impact on the evolution of the internet right now, namely in the heat they're putting on Facebook to innovate.

Now, the...

Chapter3 - devPlatform

As in, what does that mean, anyway?  I'll try and keep it short.

When I spoke of Ruby on Rails the other day as the 'hotsh!t dev platform of the day', I realized that it would need some clarification.  So let me clarify.

Coding pretty much anything is a massive, time consuming job.  That's part of the reason that computer languages have evolved from 1s and 0s to Fortran to C to C++ to Java to Ruby: if you were to try and write the Twitter website in assembly language (binary), you'd be...

Chapter2 - Databases

This part of the blog is going to be tough to write.  Not because I don't have much to say on the topic, but because I have frequent pangs of "dude, you don't really know anything about any of this stuff".  Then the other side of my brain speaks up. "Dude, it's cool.  They know you're not a professor.  That's the point of this whole thing, right?  If someone wants hard facts and a professionally written tutorial on computer science, they'd probably go somewhere else.  If they're here,...

Chapter1b

Step 2. Learn to program


Here's the thing. Computers don't think like you and me. They think in 1s and 0s. Every programming language ever invented has basically been a way to translate what a human wants to have done into a stream of 1s and 0s to be read by the computer. The translation into binary can happen at a couple of different points along the way from programmers head to users computer screen, but there are basically two different methods for how different languages do this. Some...