Ignored By Dinosaurs 🦕

This is part of an IRC transcript between a buddy and I, wherein I try to explain a little bit about how the internet works and why knowing at least a little bit of database theory will go a long way in demystifying learning how to build stuff. (It's a technical term.) He's trying to learn a bit about Drupal and about how you build sites with it, so I'm going to tag him in on a project for a friend of mine who runs a yoga studio. Hers was the first site I ever built, in Wordpress. I've been thinking about porting it to Drupal and having some more fun with it, as she'd kinda like a database of her registered students among a few other niceties that would be fairly easy to pull off in Drupal.


grubb: And it basically works fine, but I wanted to have a bit more fun with it and integrate the calendar into the site

[4:21pm] grubb: but it's pretty much a prefect easy Drupal site.

[4:21pm] grubb: When I say “there'd be a couple of different content types

[4:21pm] grubb: “

[4:21pm] Keith__: ok

[4:21pm] grubb: does that mean anything to you?

[4:24pm] grubb: So I'll just go ahead and explain it

[4:24pm] Keith__: ok, sorry multitasking

[4:24pm] grubb: Pretty much everything you interact with on the internet is an interface to a database somewhere.

[4:25pm] grubb: no sweat.

[4:25pm] grubb: I assume you're familiar with super-basic database theory

[4:26pm] grubb: basically a database is a bunch of data, and that data is ordered in a very structured way so that it's easy to tell a computer how to go get the specific data you're looking for

[4:26pm] grubb: Example – http://ignoredbydinosaurs.com/

[4:27pm] grubb: if you scroll to the bottom, the blog – that's one content type on my site, which means more or less that each one of those posts is located in one row of the “blog” table in the database.

[4:27pm] grubb: I'm the only user on that site, but if there were more we'd each occupy one row in the “user” table in the database.

[4:28pm] grubb: My portfolio is another content type – each portfolio entry is one row in the “portfolio” table in the database.

[4:28pm] grubb: (This is a simplified explanation, but basically accurate)

[4:28pm] grubb: If you go to Facebook, each user is a row in the “user” table in the FB database.

[4:29pm] grubb: Each post on everybody's wall is a row in the “wall_posts” table in their database.

[4:29pm] grubb: The “wall_posts” table in the database would have a column for the “post” and for the “user” who posted it.

[4:30pm] Keith__: ok

[4:30pm] grubb: So if I post something on my Facebook wall, that particular row would have “blah, blah blah” (whatever the post is) and my user_id

[4:31pm] grubb: So by linking that table with the post on it with the table that contains my profile info (including my user_id), you can put all of that info onto my post on someone else's wall.

[4:31pm] Keith__: ok

[4:31pm] Keith__: based on user id

[4:31pm] grubb: and that post would have all the meaningful shit that you want to see on FB

[4:31pm] grubb: right

[4:31pm] Keith__: ok

[4:31pm] grubb: so the user_id is important

[4:32pm] Keith__: what browser do you work in?

[4:32pm] grubb: it appears not just in the user table, but also in the posts table so you can link the two together

[4:32pm] grubb: I use Chrome

[4:32pm] grubb: is this making sense?

[4:32pm] Keith__: somewhat

[4:32pm] grubb: the point is obviously that whenever you go to a web page, you're looking at HTML

[4:32pm] grubb: (scuse me, it's not that obvious)

[4:33pm] Keith__: ok

[4:33pm] grubb: But there's not a mountain of programmers writing each page of HTML that anyone could possibly look at

[4:33pm] grubb: on the entire internet

[4:33pm] Keith__: right

[4:34pm] grubb: When you go to your Facebook homepage, a computer on the other end of that is putting that particular page of HTML together “dynamically”

[4:34pm] grubb: it says “okay, database, give me the 50 most recent posts from all of Keith Hick's friends. put the most recent one at the top”

[4:35pm] grubb: and that is fundamentally what a database does

[4:35pm] Keith__: ok

[4:35pm] grubb: and so it hands that information back to the computer which then puts that specific page together for you

[4:35pm] Keith__: right

[4:35pm] grubb: If you go to the front page of my website it does the same thing

[4:36pm] Keith__: complex filing system deciphered?

[4:36pm] grubb: you mean this/path/or/wahtever?

[4:36pm] grubb: to get that particular page?

[4:36pm] Keith__: huh

[4:36pm] Keith__: yeah

[4:36pm] grubb: what do you mean?

[4:36pm] Keith__: never mind

[4:37pm] grubb: OK

[4:37pm] Keith__: let's plan on rebuilding this site

[4:37pm] grubb: OK

grubb: so basically, start looking at most webpages as a thing that has been lovingly crafted for you by a computer at that specific point in time, because that's what a lot of them are

#databases

I dunno. I'm not really sure what I'm trying to say yet, but I'll give it a whirl.

There's a really interesting conversation going on right now, initially spearheaded by Pandolfi, but now spilling out into the wider stream. The whole “what is bluegrass” conversation, and it's almost certain that it's always been going on but just never showed up on my radar.

I've been, in the most nominal sense, a bluegrass musician for close to 10 years now. Jeremy from the Dusters asked me the other night how long I'd been playing bluegrass. I wasn't sure what answer to give him. Less than a year? Almost 10 years?

Then yesterday I read that Devol interview and the part where he says that the Avetts brothers are “in NO way a bluegrass band” struck a chord. Pardon the pun.

Now here's a bass player that I love like a brother, in one of those bluegrass bands that gets routinely and deliberately ignored by the IBMA, the supposed torch-bearing organization of bluegrass music, succumbing to the same trap of bluegrass judgmentalism that drives musicians like us crazy. I, for one, happen to think the Avetts ARE bluegrass, whether they care to be considered that or not.

I think RRE and Cornmeal are bluegrass, even if they are loud as fuck and have drum kits and electric guitars. I think Avetts and Mumford are bluegrass, even if they're poppy and successful. I think the Stringdusters are bluegrass even if they sound increasingly like a really good jamband. I love bluegrass music, but honestly, the shit I can't listen to for much longer than an hour or so is that SPBGMA (pronounced Spig-ma) style that is arguably the “most” bluegrass of all these subgenres. I surely wouldn't stoop to calling any of it “not bluegrass”. It just seems hypocritical.

Is there a “problem” with bluegrass? By every available metric bluegrass and all it's dialects is doing better than ever. Is the problem just that it's gone beyond it's traditional borders and has a lot more people involved in the conversation and the scene than ever before?

Is that really a problem?

I could see how it would be if you were the organization that used to be the authoritative voice on the subject for the community that used to be easy to contain within defined borders. I don't know. The Church analogy still seems fitting. The gated community one, also.

I recently joined the IBMA to see if there's any interest of this conversation within that community, rather than being one of these folks sniping from the outside. I guess we'll see.

#music

I'm just going to attach this note to a rock and toss it over the wall here. Maybe someone will notice it. Maybe it will even be read.


Hi. I'm one of the barbarian bluegrass players on the other side of the wall. I've been looking at your gated neighborhood my entire professional life, and it looks very nice from the outside.

A guy that I respect a lot also happens to be a member of your community. He and his band come outside the gates all the time to play for the masses out here, and we love them. I'm actually in another band that plays the same circuit out here in the world, and we have a great time. I've never really worried about whether or not I would be able to afford a house in your neighborhood because as far as I'm concerned, we've got it all out here. I just assumed that you guys would rather not mix with the riff raff (I say that with fondness) and that's fine. You're welcome to, but you shouldn't have to.

Please forgive me if I've got some of the facts wrong here, I've never actually been inside your neighborhood. But some things I've heard lately have surprised me. There are apparently some empty houses in there, and the number of houses that are being filled with new residents is not keeping pace with the number of houses that are coming up on the market. Some of those houses have been vacant for a while now? The tax base is dwindling, lawns aren't being kept and the neighborhood committee is starting to worry that this decline is accelerating. The idea of opening the gates has been proposed. To make the community inclusive rather than exclusive. To relax some of the requirements for membership. This guy I'm talking about is one of the most articulate proponents of this idea.

He has rightly figured that we make a lot more hay out here than you guys are able to in there. It's just supply and demand – there's more of both out here. The tax base you need to keep the neighborhood thriving is right outside the gate.


You all are more than welcome out here. That's the entire point of out here. We take everybody. There's plenty of land and having it worked rather than lay fallow only makes it that much more more fertile for the rest of us, which leads to more fans enjoying the fruits of bluegrass, which brings more young bands into the fold. A virtuous cycle.

I'm just not so sure about us coming in there.

I have 2 young kids and they're loud and a lot of times their toys get left in the yard, and admittedly it doesn't look that great but we live on some land where you can't really see the house from the road. Sometimes the grass gets a little shaggy. I still have part of a tree down from that hurricane, but I'll get to it.

If I move in there, then either I'm going to have to hire someone to keep my grass in line with the neighborhood covenant or I'm going to get dirty looks from my neighbors. Now, I refuse to pay someone else to mow my lawn, and you most certainly shouldn't have to be aggravated every time you look outside your window. Part of the reason you live in that neighborhood is because everyone there keeps their grass a certain way, and I can appreciate that as much as you can.

If the new committee does away with that covenant then it might make it easier for me to be who I am, but what about all the people that have lived in that neighborhood for a long time because they like it the way it is?

Where are they going to be able to go?

#bluegrass

Spotify.

My favorite thing on the internet ever so far.

Share music with my Facebook friends. Great idea. Find all kinds of new music without having to commit to buying it. Great idea. Subscription feature that lets me take it on a plane trip. Great idea.


Today I have to reconnect to Facebook for some reason. I look at the ridiculous list of permissions that Spotify wants me to grant them. Access to my data when I'm not online. Permission to post on my behalf. To name my third son Spotify. I wouldn't have thought twice about dismissing and going about my day, but for two things.

  1. Connecting to Facebook is apparently the only realistic way to find your friends in the world with whom you might want to share music.

  2. The words of my friend Teddy, who works at Facebook. When I first signed up with Spotify i was reluctant to connect it to Facebook for the mental discomfort it caused me to grant any application the rights for which it was asking. To paraphrase,

“You gotta realize, though. If they go and take a bunch of your data and post a bunch of stuff on your wall that you don't want there, it makes them look bad and Facebook look bad too.”

How true.


Luckily I wasn't indulging my Katy Perry sweet tooth this morning when I get a message from an acquaintance on Facebook that Spotify is indeed posting every single song that I listen to on my behalf. Exact same permissions that were granted two months ago, but now being used in the exact way that I didn't want.

It took me about 5 minutes of incredulous tweeting to figure out that I could go 3 levels down into the settings on Facebook and remove this particular permission from the Spotify app. I decided while I was at it to remove every other permission for the Spotify app as well delete about 30 apps that I had idea were even there. One bad apple.

The question I have

How can this sort of app behavior be opt-out?

Obviously Facebook and app developers in general would plead to the FCC before congress that any of this behavior is opt-in in the first place, that Spotify asked me up front for these permissions and I said “yes”. This is technically true, but total bullshit.

When an app asks for permission to do this and this and that on your behalf, why isn't there a simple little checklist of those things that you do and don't want it to do up front, instead of buried 3 levels deep in settings that are continually being moved around Facebook?

Cue the title of this post.

And by “Great”, I don't mean awesome.

For those of you who don't know what I mean when I say Lorem Ipsum, it's standard gibberish copy put in place of the real copy that's going into your design. It's been used for decades if not centuries to allow creative teams to test out different visual designs and know what it'll look like when some words get put in there.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

~ a standard paragraph of Lorem Ipsum...

So what's wrong with this?

I just built a website for a friend over the last half of last week. The designer and I worked together marvelously, which is great because it was our first gig. She was totally into trying out the cool, new tool that launched last week to see if it would help keep us organized while in a hurry (our launch date is today – Monday). The project manager was the one in charge of dealing with the ADD client, so it was really a perfect scenario. We went with Wordpress since everyone was familiar with it.

Friday evening I got a Word doc of the site's copy. I don't like placing copy in websites, but whatever. At least it wasn't in all caps.

This morning I open it up and at least half of the pages are “coming soon”. Approximately half of the remaining pages are four sentences or less. I'm all about white space, but this is a bit too much.

That's when the title of this post popped into my head.

Simple Rule for Marketing Websites

If you do the design first and the copy last, you lose. If you do the copy first and the design second, you stand a much better chance at succeeding with both.

So here I sit, at the end of another brief tour, watching the sky get lighter outside the windows at the St. Louis airport. Listening to a bit of the new Bon Iver record, which is beyond terrific to the point of being maybe the record of the year for me. We'll see.

It's not that I haven't had much to say (though I haven't had quite as much to say), it's just that the time in which I used to say it has been filled by the consequence of my prayers for work being answered. I've been very, very busy this year and not a moment too soon. I jumped off my last gig in desperation; desperation at a job that I just wasn't feeling anymore and that finally qualified itself as being the wrong path. To wander that far down a path such as that one and then decide to bushwhack my way back up to where I could see the landscape again was a life/career move I'd probably have considered a bit more carefully had I known just how hard it would be. The undergrowth was dense. The way was dark. Had I not found the way back to be already overgrown I'd probably have turned around and asked for my old job back. Or maybe not.

Forgive all the flashy metaphor, but I've just driven 4 hours to the airport after a gig in the middle of Nowheresville, Missouri and I've got the perfect balance of coffee buzz, time, exhaustion, and an itch to write.

So anyway, I get the title question a lot this year. In short -

I split RRE with grand ideas and a grander mouth to broadcast them. The crusade was to put together the solution to the music industries problem. Because there weren't enough smart, capable, connected people working on the issue already, apparently. Part of last year's journey was a pretty extreme pruning of my ego, and it hurt. I had (and still sort of have) a pretty good idea about an open source angle to the music business that hasn't been done before, in my opinion because it explicitly doesn't make anyone any money except for the artists who implement the solution. I had a few other people convinced it was at least part of a good idea, and a few of them were kind enough to trot me in front of business types who could give me some feedback. The conversation generally ended shortly after they asked me “so how does it make money?”. Well, the idea is that it doesn't make you money. Kthx.

I understand of course, and learned a hell of a lot about early stage startups in the process of all this. Chiefly, I learned that I was seriously lacking in the ability to implement any ideas that I might have, either now or in the future. So I decided to fall back and work on what I could work on, which I chose to be the technical end of the equation. Always was good with computers.

I picked up a very few clients last year, those who were desperate enough to hire me. I went to a few networking things, mostly centered around Drupal, and went to several job interviews. I received some fairly harsh smackdowns at these interviews, typically during the technical part of the interview, and did not receive any jobs.

Somewhere around last November I was pretty damn close to the edge of “all I could take”. That's when I saw the ENB gig up for grabs, so I grabbed it. It wasn't much (by design) but it was a direction, it was good music with guys I already knew, it was at least a tiny bit of income. I started in February.

About 10 days into my tenure with ENB, I got a couple of emails on the same day that have turned out to be all the work I need. But it didn't stop there.

Somehow in the process of all this, I've become a fairly well-rounded, intermediate programmer, and one who has a pretty good sense of how to figure out the infinite number of problems that he's never encountered before. I've learned more programming languages, acronyms, protocols, tools, toolkits, best practices and shortcuts for being an effective (hireable) programmer than I could've guessed I'd be capable of. In April something amazing happened. I had a technical interview for a freelance gig based out of Austin TX that went astonishingly well. We talked about Git and Drupal and Ruby and handwriting SQL for half an hour. It was fun. I got the gig, and that was the little gig I got that month. I've been getting gigs left and right all year. It's insane. It's wonderful.

So basically, I'm making about 90% of my income on this computer here, and I do the ENB thing for fun and to stay connected and relevant to the scene I really care about. I've been in technical woodshedding mode all year, but I sense that it's about time to start trying to crack the nut that beat me this time last year. I've had a few things fall in my lap in the last couple weeks that are pointing me in that direction again, to try and see what I can come up with that could contribute to the music scene. I'm not trying to “save” it anymore. I'm not really sure that “saving” the music industry is what needs to happen right now anyway. As much as I am completely in LOVE with Spotify for the last month, they pay the artists about 1/10 of a piece of dog shit for royalties on the tunes that they stream. Nobody could make a living on what they pay out. Excuse me, no artist could ever make a living on what they pay out. I hear the labels have found a way to keep making nice profits in the midst of all this supposed bloodshed. So the brass ring is still sitting there, waiting to be grabbed.

#life #bluegrass

Sass is a programming language. It's purpose is to take some of the repetitive drudgery out of writing CSS (don't get me wrong, I love writing CSS). It does this by letting you define things such as constants and functions, things that other programming languages give you but CSS doesn't. The end purpose of Sass is to be digested and spit out as plain old CSS.

There are a couple of best parts. One of them is being able to define constants, referred to as variables in Sass. This lets you do things like define a standard color palate at the top of your sheet like this:

$dark_blue: #064463
$green: #68db1e
$med_blue: #0089c7

Then, any time you need to use that shade of dark blue, rather than having to go find (or remember) #064464 you just put $dark_blue. That's it.

background: $dark_blue

Done.

Sass also has what are called mixins, but are more like functions in other languages. My personal favorite use of mixins is this one -

@mixin gradient($color1, $color2)
  background: -webkit-gradient(linear, left top, left bottom, from($color1), to($color2))
  background: -moz-linear-gradient(270deg, $color1, $color2)
  background: linear-gradient(270deg, $color1, $color2)
  -pie-background: linear-gradient(270deg, $color1, $color2)
  behavior: url(/sites/default/files/pie/PIE.htc)

This defines all those different vendor specific ways of writing a CSS background gradient (with a dash of css3pie to boot!) and lets you simply drop this in your sheet :

@include gradient($dark_blue, $med_blue)

And again, done. It gets compiled and spit out exactly how you need it to be. Still experimenting with the exact colors of that gradient? Change the color once for the whole thing and you can't forget to do it for Firefox after you've spent 10 minutes getting it just right in Chrome.

It starts getting really fun when you do things like this :

background: lighten($dark_blue, 10%)

Oops, that's too light.

background: lighten($dark_blue, 7%)

Perrrrfect

Mix them all together!

@include gradient(lighten($dark_blue, 10%), $dark_blue)

This is how Sass saves you time. You can even try it out with existing stylesheets with the sass-convert command. The syntax is sass-convert input-file.css. This spits out your CSS file as Sass at standard output, so try this to get it into a file -

sass-convert style.css > style.sass

Sass has a handy watcher function that you can invoke to automatically convert your Sass files into CSS files when you update them. Separate the Sass source file and the target CSS files by a colon.

sass --watch style.sass:style.css

Enjoy!

Edit 7/27 —

There are some damn handy additions in Sass 3.1. for instance, foreach loops -


@mixin grad($color1, $color2)
  @each $browser in webkit, moz, o, ms
    background: -#{$browser}-linear-gradient(top, $color1, $color2)

  • spits out this

          background: -webkit-linear-gradient(top, #e7e7e7, #b4b4b4);
          background: -moz-linear-gradient(top, #e7e7e7, #b4b4b4);
          background: -o-linear-gradient(top, #e7e7e7, #b4b4b4);
          background: -ms-linear-gradient(top, #e7e7e7, #b4b4b4);

So, there!

#css

I use Git. I'm relatively new to the party and it's all I've ever used. I tried to get SVN working for me back when I was first gettings started and it felt like hand-wiring a tube amplifier – slow, tedious, and you don't know if it's going to work until you're totally done. I've more recently taken on a client who uses a nifty issue tracker called Jira, but they have their source checked in to SVN. I thought I was going to to have to get familiar with it until I rediscovered a tool that comes with Git called git-svn. It works pretty transparently after learning a couple of new commands.

This morning however, I tried something new and was greeted with this (after 5 hours of work).

src/sites/all/modules/eloqua
580e5a6480dfae9ee8aa39e2ff14e4b3604d8827 
doesn't exist in the repository at /usr/local/git/libexec/git-core/git-svn line 4771
Failed to read object 580e5a6480dfae9ee8aa39e2ff14e4b3604d8827 
at /usr/local/git/libexec/git-core/git-svn line 573

This is a Drupal site that I'm working on. To make a long story short, I decided to pull a new module over via Git from drupal.org instead of using Drush like I always do. I figured I might want to chip in on some of the development of this module while I'm already here. Everything went fine, I added the .git folder within the module to .gitignore and went on my way. After finishing up enough of the work to send it over to staging and attempting a git svn dcommit I get the horrifying error above.

I found this post that got me started down the right track. I used a different approach, though. I used the technique of rewriting the history with the info found here. I'm pretty familiar with removing accidentally committed DB passwords, and wasn't familiar with the technique that he had commented out in that post. Worked like a charm, and am now back on track.

To sum up, you delete the offending directory and then run something to the effect of

git filter-branch --index-filter \ 'git rm --cached --ignore-unmatch path/to/the/formerly/misbehaving/module'

from the base path of the git repo. By the way, that backslash doesn't do anything but allow you to wrap a command to two lines. You can leave it out if you want and just type all that as one long line.

The culprit of all this is that git-svn specifically chokes on git repos below the main one, as is the case if you git clone a module straight off of d.o. So, sorry kids, you'll have to contribute that code in some other way.

#devops #git

This is the list I've spent a half hour hacking around in TextMate trying to figure out how to not manually build. Couldn't quite do it, so here it is, that you may find it and use it when building a Drupal form that has a select list of all 50 states and the District of Columbia.

'#options' => array(
 '' => t('Please Select'),
 'AL' => t('Alabama'),
 'AK' => t('Alaska'),
 'AZ' => t('Arizona'),
 'AR' => t('Arkansas'),
 'CA' => t('California'),
 'CO' => t('Colorado'),
 'CT' => t('Connecticut'),
 'DE' => t('Delaware'),
 'DC' => t('District of Columbia'),
 'FL' => t('Florida'),
 'GA' => t('Georgia'),
 'HI' => t('Hawaii'),
 'ID' => t('Idaho'),
 'IL' => t('Illinois'),
 'IN' => t('Indiana'),
 'IA' => t('Iowa'),
 'KS' => t('Kansas'),
 'KY' => t('Kentucky'),
 'LA' => t('Louisiana'),
 'ME' => t('Maine'),
 'MD' => t('Maryland'),
 'MA' => t('Massachusetts'),
 'MI' => t('Michigan'),
 'MN' => t('Minnesota'),
 'MS' => t('Mississippi'),
 'MO' => t('Missouri'),
 'MY' => t('Montana'),
 'NE' => t('Nebraska'),
 'NV' => t('Nevada'),
 'NH' => t('New Hampshire'),
 'NJ' => t('New Jersey'),
 'NM' => t('New Mexico'),
 'NY' => t('New York'),
 'NC' => t('North Carolina'),
 'ND' => t('North Dakota'),
 'OH' => t('Ohio'),
 'OK' => t('Oklahoma'),
 'OR' => t('Oregon'),
 'PA' => t('Pennsylvania'),
 'RI' => t('Rhode Island'),
 'SC' => t('South Carolina'),
 'SD' => t('South Dakota'),
 'TN' => t('Tennessee'),
 'TX' => t('Texas'),
 'UT' => t('Utah'),
 'VT' => t('Vermont'),
 'VA' => t('Virginia'),
 'WA' => t('Washington'),
 'WV' => t('West Virginia'),
 'WI' => t('Wisconsin'),
 'WY' => t('Wyoming'),
),

#drupal