Monday, April 21, 2014

A better way to zip archive a git project

Why have I been zipping up my git projects with the .git directory intact?  Here's the right way:

 git archive my_branch --format zip -o ../myproject.zip

Creates a zip file from branch my_branch and leaves out the .git files.  Useful for upload to build.phonegap.com.



Friday, April 04, 2014

Change bash comment color in Vim




Ever notice that it's almost impossible to read the dark blue comments on a black background in a Vim file?  What a bitch.

Change them to light blue:

Open ~/.vimrc

Add this line:
hi Comment term=bold ctermfg=lightblue guifg=lightblue


Thanks David C. Rankin!
http://lists.opensuse.org/opensuse/2008-11/msg01212.html





Tuesday, April 01, 2014

Musings on art



Many of us spend countless hours of our lives on art projects.  There are many reasons to make art.  For some it is about perfecting a craft or technique.  Others make art to communicate ideas or feelings.  Some are simply makers for whom art is a means for either making new stuff or reinventing old stuff in new ways.

We consume or enjoy art for different reasons.  Sometimes a piece simply strikes as a beautiful, unusual, or interesting.  But more often than not, we really appreciate art that successfully communicates with us, that reflects us, or that gives us insight into who or what we are.

Think of the song writer whose lyrics seem to describe you exactly, as if the writer understands you personally---completely.  Or think of the movie or book that moves you to tears.

This is the most successful art, as it satisfies both the maker and the observer.

Most of the art I make is musical, and though I also enjoy writing and drawing, I think my musical efforts are the most mature.  I can tell you that, for me, making art has always just been about play and experimentation.  I find satisfaction in being able to imagine sounds or music and turning those ideas into something audible for others to hear.

The artist who says they don't care if anyone else really appreciates or understands their work is probably not being honest with themselves.  Art is a conversation between the maker and the audience, and it takes two parties to have a conversation.

Art matters.  In it we see human potential.  It's so easy to become disgusted with the world, with the selfishness, the greed, the cruelty, the hatred.  But art reminds us of our better selves, or at least it has the potential to do so, because in it we see the spark that ignites, the seedling pushing up through the dirt, the breath of air that keeps us alive for another few moments.

We're alive, and yet, we for some reason we are frequently unable to marvel at it.  I'm thankful for the artists who spend their hours working to remind us, who serenade and shock us into seeing life for what it is or could be and for who and what we are.


Thursday, March 13, 2014

PhoneGap and offshore development lessons



I've spent the last two months working on a PhoneGap app.  In an attempt to keep momentum going even when I'm sleeping, I hired several offshore developers to assist.  Lessons:

1.  Time is not on your side

It takes time to communicate design and implementation details to a third party.  It takes most developers some time to ramp up.  (Okay---all developers.)  I set the expectation that I would be able to build this app in a month because I thought I could build it if I worked on it 24/7, but none of the resources I hired had agreed to such a schedule.  In fact, in my experience, most if not all offshore developers are working multiple contracts and will give you at best a few hours of effort per day.

2.  Good help is hard to find

How do you really know if an offshore resource is quality?  The amount they charge per hour?  Their odesk rating?  No, none of this is a true measure.  The only way to really know what an offshore developer is made of is to give them access to source, assign them a task, and see how they perform.  You can generally tell within 48 hours if you have a keeper or not.  But Lesson 1 is the downside.  I found too many that were not keepers, so too much of my time was spent hiring and testing and then retiring developers that didn't work out.

3.  One offshore trip up can cost you big

Actually I had two offshore trip-ups.  The first, I found a competent PhoneGap developer.  He went to work but didn't check in soon enough.  When he finally did I discovered that he'd changed our whole approach to development, replacing our Twitter bootstrap multi-page based layouts with jquery-mobile and a single-dom layout for the sake of gaining the page transitions.  He'd implemented new functionality, but broke the existing.  Three weeks into the project I was left with two bad options: rewrite several ajax handlers to use the new dom structure and styles and stay with the jquery-mobile approach,  or rewrite his new functions, adapting him to the (three week old) style.

Did I mention that I had told this resource explicitly NOT to add any new libraries without first getting my approval?  After struggling with the decision, I decided to stay with the new approach and fire the developer.  After all, how could I work with a developer who wouldn't follow directions?

The other trip-up?  Giving an "Apple IOS expert" access to your developer account.  Without going into details, I will only say that I spent a week trying to figure out why push notifications were not working on our production system.

4.  Don't fire your only competent developer

After a week of churning through other resources, I couldn't find anyone who was qualified to do the work who was also available.  Oh sure, I found some that said they were qualified.  And I found some that said they were available.  But in the end, they wouldn't work, or couldn't do the work.

Remember the developer I fired?  I rehired him. What else could I do?

5.  Build it yourself

This advice won't help a non-technical manager, but in my case, I faced the reality that no one else could get this done but me.  The fact that I could no longer meet my deadline was crippling for me, as this is not typical for my projects.  Frankly, I shutdown under pressure, which is one of the reasons I ordinarily front-load my projects.  Without pressure, I think carefully, methodically, and with intention.  With time pressure, I have to make bad choices and that's really hard for me to do.  I'd rather not do the job at all than to do it wrong.  But of course, this is reality, and I don't always get to control everything.  So I struggled through.

6.  CSS selectors can be evil

Developers know that css rules are used to style web pages, controlling every detail of the look and layout.  Javascript is the language that does, and javascript code controls most dynamic behaviors, control flow, api communication with the server.

CSS selectors let you chose elements in the DOM (on the page) and manipulate them one way or another.  A CSS selector is like a query tool, allowing you to grab an element by its ID, class or even its ancestors or descendants' ID and classes.

So what happens if you let a resource who doesn't really know javascript, but who is good with CSS styling, update your stylesheets?  Unless careful attention is given to any selectors, the selectors get broken, meaning bugs are introduced.  Any time the DOM is modified post-initial-development, such as the introduction of a new element in the hierarchy, there is a risk (no a probability) that javascript selectors will no longer work.   And the stylesheet rules, which are often hierarchical, may also break, so styling will be destroyed.

This means that you can't really bring a CSS resource back to do more work in the middle of the project.  In fact, you had probably better lock them out once the initial styling is done.

A good best practice for the future:  Lock down the DOM.  Tell your resources it simply can't change without your approval.

7.  Too many cooks in the kitchen

Even when working with competent developers, it's really difficult to collaborate on a jquery-mobile project.  All pages are embedded in single DOM, leading to CSS rules that are more complex than would exist with smaller, dedicated pages.  It's too easy for developers to break each-other's CSS rules.  Some best practices for my future projects:

  • With CSS Selectors, prefer IDs to Classes, except in cases where a Class is the only solution (such as selecting every matching element). $(".wrapper .red .spanky .britches") is more likely to become invalid as development progresses than $("#the_britches_element").
  • Commit to the completion of HTML, CSS and layout before introducing the javascript and logic
  • Consider using a templating engine to reduce code duplication


8.  You can find a good offshore resource

I found a really great PSD-to-HTML resource last year and I really enjoy working with him.  He's responsive.  He does a good job.  He replies quickly.  He does what he says he's going to do.  Going it alone is not the best approach.  It should be possible to proceed as a team, and I'll continue in my efforts to build an effective one.  But throwing together a team to complete a project within one month?  Probably too ambitious.


Tuesday, January 21, 2014

When you're as old as a single on vinyl



I'm 45.  I've owned a few 45s.

Here's a short history of the music that made me me.

Though I grew up in the 70's, I didn't hear a lot of Carley Simon or Three Dog Night.  Other than the occasional pop hit overheard while shopping with mom at the ladies shoe store, my typical exposure to music was at church.

The piano and organ were the primary instruments played there.  I sang along to the hymns and played piano after church and sometimes during the week while my dad took care of church business.

In the fourth grade, my Elementary school teacher Mrs. Treat let us listen to her old 45s when we were good---The Beach Boys, The Crystals and Elvis.

My fifth grade music teacher introduced us to Beethoven by playing an disco-instrumental based on Beethoven's Fifth from the Saturday Night Fever soundtrack.  We begged and she let us listen to the whole album.  I loved it and the The Bee Gees.  It was the first "secular" 8-track tape my parents ever let me purchase.  I played it in the large, wooden furniture-case stereo in the living room.

About that time, contemporary Christian music was popular.  The songs were modern feel, but the lyrics were like the old gospel hymns.

My parents, who approved of this kind of music, started listening to radio station KXOJ.  I remember liking DeGarmo and Key and Kerry Livgren.

Livgren, also a member of the rock band Kansas, released Seeds Of Change as his first faith-based solo album.  His epic styling still sounds good today.  My mom let me buy the Kansas album Audiovisions from 1980, based on premise that Livgren, a good Christian, was in the band.  After listening to all the lyrics, I played it quietly, certain that my parents wouldn't approve of everything I was hearing.  It was my second vinyl purchase, my first a KTEL collection I ordered off TV.  Rapture by Blondie was on it.

7th grade was the first year of my serious flirtation with non-religious music.  I became a fan of Ted Nugent, AC/DC, Journey, Styx, Billy Squire, Van Halen, Queen and REO Speedwagon to name a few.

MTV came to my town in the 8th grade.  A new world opened up.  Devo, Gary Numan, Pat Benatar, Motley Crue, Michael Jackson, Joe Jackson, The Talking Heads performed for me in the privacy of my living room.

That year I listened to a Tulsa based A.M. radio station known as 14K.  New Wave hits were heard there for the first time, most memorably The Human League's Don't You Want Me, long before I saw the video.

By high school I found myself gravitating toward strange bands, in sound or appearance.  Anything with a strong bass line and a synthetic sounding snare drum struck my fancy, songs that made you want to dance.  From Men Without Hats to Ebn Ozn to Dead Or Alive, if it grooved, I moved.

The album with the biggest impact was Depeche Mode's Some Great Reward.  Dark and seriously electronic, it was the first time I couldn't visualize the instruments making the sounds.  It blew me away.

Soon after, I was introduced to Tulsa's punk scene, and with it, American Hardcore music.  The first "punk" record (actually it was a cassette tape) I heard was probably by The Circle Jerks.  I listened to it over at Chuck Upshaw's dad's trailer.

The music was loud, rude and full of energy.  I liked it.  To my surprise, only about a month later, The Circle Jerks came to Tulsa and played a little hole in the wall downtown called 424.  It was my first show of this type and, man, what and introduction.  Skinheads, freaky kids with spiked hair, drag queens, all in attendance.  I was 16.   The next day I started tearing and burning holes in my clothes, ready to join the disillusioned.

I met some other New Wave kids at a teen club called Images.   At teenie-bopper Images, we were considered the punks, the freaks.  But out at the real grungy venues, we were considered wanna-bes. In both worlds,  I was digging the music, from Tears For Fears to Kurtis Blow, from Public Image Limited to The Pet Shop Boys, from The Dead Kennedys to Jermaine Stewart.







Tuesday, December 31, 2013

7 tips on how NOT to be a Lonely Guy


I re-watched Steve Martin in The Lonely Guy not long ago.  It was disappointingly not as funny as I remembered, though still worth the watch.  But, WOW, does it remind me of all of the lonely guys I've known.  You know the type: the guy who never recovers from a bad relationship, or simply can't quite figure out how to have a relationship with a woman...even though he really wants one.

Why am I qualified to comment? Well, if nothing else, I know how to get into a relationship.  I'm on my fourth (and final if I can help it) marriage, and there weren't many gaps between marriages where I didn't have a girlfriend.  I may not know much about how to keep a woman...but I do know a bit about how to get things started.

1.  Let Her Go

Dude, she's gone.  I know you were so happy, so complete when you were with her.  But that was a long time ago (or maybe just last month).  She's not coming back.  Do you really need to stop bathing, grow a floor-length beard, or sell all of your furniture and move into a box?  Do you think your brooding, crying, self-loathing and woman-hating is making you more attractive to the opposite sex?

Hit the reset button.  She wasn't your soul mate like you thought.  She was just a woman and there are billions of others.  Take it from me, you can be happy again, but not until you Let Her Go.

2.  Don't let the world know you are jaded

Yeah, life sucks and then you die.  But it primarily sucks because you are latching on to the idea that it sucks.  You probably think your non-stop observations about life's obvious pains makes you witty and insightful.  Nope. It makes you come across as negative. How many women are looking for a man who can clearly articulate life's suckage?  

If you meet a woman who begs "Please tell me why life isn't worth living!  I was so hopeful before I met you.  Please do something---anything---to dash my dreams!" run the other way.

3.  Don't be pitiful out loud

This should be obvious.  If you are resorting to pity for attention, seek counseling.  I'm surprised at the number of guys who do this.  

4.  Don't pretend you're All That when you're not

If you are constantly telling everyone who will listen how awesome you are, you are not awesome.  You know it and so does everyone else.  Be confident, not stuck up.  Nobody likes a braggart. 

If you are truly awesome, you don't need this advice.  Women already flock to you.  Don't get down about the fact that you are not awesome---figure out how to become awesome.

5.  Quit feeling sorry for yourself

Even if you aren't telling everyone on facebook, it comes across when you are.  The only way to fix this is to really quit feeling sorry for yourself.  If you don't like the way your life is going, then change.

6.  Don't be hyper-focused on You

Are you your own favorite subject?  When you get around women, do you launch into conversation about your true love, yourself? No one is as interested in You as you are.  

People, including women, care about the people who take a genuine interest in them.  So you like a girl?  Then ask her questions about herself.  Be interested in her family, friends and hobbies.  Don't launch right into your life story.  Wait until she asks you about You.

7.  Be your own person and love who you are

It's really pretty simple.  You don't have to be rich or good looking to attract women.  You just have to embrace who you are, find a way to enjoy living, and love yourself.  Women are attracted to confidence.  Women are just people who want to be happy, and when you are happy, they want some of what you've got to offer.








Sunday, December 15, 2013

Disco and Mint Green Suits

Want to listen to something funky?  Check out bibio:

http://open.spotify.com/track/7cXF6ZVxPFfIaTuHkfit7U

Ever since the 5th grade, I've been a sucker for Disco and funky dance music.  I can't remember the name of my music teacher, but she turned us on to the Saturday Night Fever album.  It was during our study of Beethoven, and she was wisely trying to bring pop culture into the conversation in order to make the subject relatable.  The soundtrack contained a lively disco instrumental of Beethoven's Fifth, and it was pretty good, but I was really interested when she played a little bit of the other tracks.

Speaking of funky, Tarynn and I saw the funkiest old man as we were walking into Duffy's this morning.  He was walking in ahead of us, decked out in in mint green from hat to foot, the whole package wrapped up in a full length, white fur coat.  If I had to guess, I would say it was rabbit fur.  "Now that's pimp," I said to her.

I didn't want to stare but I really wanted to study the details, down to his belt.  "Maybe you should ask to take a picture with him," Tarynn suggested.  I would have liked to, but he was a older black gentleman and I didn't know how he would interpret it.  While it's true that he did look like the stereotypical pimp from the 70's movie Superfly, I was actually in awe and impressed by his personal sense of style.  I wanted to strike up a conversation, but what if he thought I was making fun of him?

While waiting in line to pay for our breakfast I decided to say hello.  I moseyed up to him.  He was sitting alone at a table for two, a plate of eggs and toast in front of him, his fork halfway to his mouth when I said, "How you doing?"  His eyes looked up, a bit startled I think.  Up close I could tell he was older than I initially thought, maybe 70 or 80 years of age.  "Hey, I wanted to tell you that I really like your mint green suit.  That's really sharp," I said.  He nodded to acknowledge me and I retreated awkwardly back to the pay line.

And that was it.