A good programmer is a lazy programmer...

They say "A good programmer is a lazy programmer..." - That may be true, however I would like to turn the negative into a positive and change the phrase to "A good programmer is an efficient programmer..."

I love patterns. I see them all the time. Throughout music, throughout code, throughout life in general. They're litterally everywhere and I am constantly on the lookout for them. Today I found myself repeating the same task/pattern over and over again and I was curious to see how much time it was actually taking up throughout my day.

Problem:

So the task at hand was to deploy 17 repositories to heroku at the same time and verify that they are deployed and running by simply viewing them in a browser. Pretty simple, right? Yes, simple is NOT the issue at hand, time is. Time is everything when it comes to getting work done, so be sure to use it wisely, as I'm pretty sure you will not get any of it back...

Solution:

Write a simple Shell script that will do the following:

Navigate to 17 local repositories

$ cd ~/path/of/my/local/repositories

Deploy each property to heroku / github / some cloud based git service (in my case, heroku)

$ git push heroku master

Then confirm the site is running and deployed by opening it physically in Google Chrome like so

$ open -a Google\ Chrome http://nameofmyawesomedomain.com

And finally, (optionally) print out some console confirmation that the script completed

$ echo "Deploy complete"

My Script

(Most likley this will not help you, but have a look anyway...)

#!/bin/bash

echo "Deploying admityouhaveaproblem..."  
cd ~/Heroku/admityouhaveaproblem.github.io && git push heroku master  
open -a Google\ Chrome http://admityouhaveaproblem.com  
echo "Deploy complete"

echo "Deploying ColorMyMusic..."  
cd ~/Heroku/ColorMyMusic.github.io && git push heroku master  
open -a Google\ Chrome http://colormymusic.com  
echo "Deploy complete"

echo "Deploying beforeidiei..."  
cd ~/Heroku/beforeidiei.github.io && git push heroku master  
open -a Google\ Chrome http://beforeidiei.com  
echo "Deploy complete"

echo "Deploying convoclothing..."  
cd ~/Heroku/convoclothing.github.io && git push heroku master  
open -a Google\ Chrome http://convoclothing.com  
echo "Deploy complete"

echo "Deploying getanintern..."  
cd ~/Heroku/getanintern.github.io && git push heroku master  
open -a Google\ Chrome http://getanintern.com  
echo "Deploy complete"

echo "Deploying getgearly..."  
cd ~/Heroku/getgearly.github.io && git push heroku master  
open -a Google\ Chrome http://getgearly.com  
echo "Deploy complete"

echo "Deploying hissio..."  
cd ~/Heroku/hissio.github.io && git push heroku master  
open -a Google\ Chrome http://hiss.io  
echo "Deploy complete"

echo "Deploying jogbuy..."  
cd ~/Heroku/jogbuy.github.io && git push heroku master  
open -a Google\ Chrome http://jogbuy.com  
echo "Deploy complete"

echo "Deploying kissvote..."  
cd ~/Heroku/kissvote.github.io && git push heroku master  
open -a Google\ Chrome http://kissvote.com  
echo "Deploy complete"

echo "Deploying kywrd..."  
cd ~/Heroku/kywrd && git push production master  
open -a Google\ Chrome http://kywrd.com  
echo "Deploy complete"

echo "Deploying latched..."  
cd ~/Heroku/latched.github.io && git push heroku master  
open -a Google\ Chrome http://getlatched.com  
echo "Deploy complete"

echo "Deploying madstory..."  
cd ~/Heroku/madstory.github.io && git push heroku master  
open -a Google\ Chrome http://madstory.com  
echo "Deploy complete"

echo "Deploying meetsme..."  
cd ~/Heroku/meetsme.github.io && git push heroku master  
open -a Google\ Chrome http://meetsme.com  
echo "Deploy complete"

echo "Deploying neighborhoodly..."  
cd ~/Heroku/neighborhoodly.github.io && git push heroku master  
open -a Google\ Chrome http://neighborhood.ly  
echo "Deploy complete"

echo "Deploying picksomeone..."  
cd ~/Heroku/picksomeone.github.io && git push heroku master  
open -a Google\ Chrome http://picksomeone.com  
echo "Deploy complete"

echo "Deploying rehearseio..."  
cd ~/Heroku/rehearseio.github.io && git push heroku master  
open -a Google\ Chrome http://rehearse.io  
echo "Deploy complete"

echo "Deploying youmeyoume..."  
cd ~/Heroku/youmeyoume.github.io && git push heroku master  
open -a Google\ Chrome http://youmeyoume.com  
echo "Deploy complete"  

Save the above as deploy_script.sh and then set the permissions to be executable:

$ chmod +x ./deploy_script.sh

Next run the script:

$ ./deploy_script.sh

Conclusion

Now, before writing this simple Shell script, this process was taking up about an hour of my time each and every day (I'm doing the 365 Days of Open Source Contributions). Clearly this was not something that I enjoyed, nor was it even remotely sustainable.

By writing a script, I can now deploy code in less than 30 seconds.

Video Proof

Save yourself some time and write shell scripts locally, or possibly consider using Alfred Mac App.

Happy coding!

They say "A good programmer is a lazy programmer..." - That may be true, however I would like to turn the negative into a positive and change the phrase to "A good programmer is an efficient programmer..." I love patterns. I see them all the time. Throughout music, throughout code…

Read More

LaunchRocket Services

I've been using LaunchRocket for over a year now. It's an incredibly useful tool to start, stop, and monitor services. Just brew install <formula name> and then find the service in the LaunchRocket list by clicking "Scan Homebrew".

I've installed MongoDB, ElasticSearch, Mysql, CouchDB, and Redis within minutes thanks to homebrew. Then ran the services thanks to LaunchRocket.

I just wanted to share one of my favorite helpful tools with you.

Happy Coding!
Eric

I've been using LaunchRocket for over a year now. It's an incredibly useful tool to start, stop, and monitor services. Just brew install <formula name> and then find the service in the LaunchRocket list by clicking "Scan Homebrew". I've installed MongoDB, ElasticSearch, Mysql, CouchDB, and Redis within minutes…

Read More

Resilience: The Must-Have Strength For Entrepreneurs

Becoming a successful entrepreneur is never a straight line. There are lots of ups and downs along the way. As it turns out, how you emotionally handle the downs is key.

Resilience is a one of the defining skills and behaviors of people who make it, according to Jeffrey Pfeffer, author of Power, and Jim Collins, author of Good to Great, writes Denise Brosseau, author of Ready to be a Thought Leader? How to Increase Your Influence, Impact, and Success.

Some of you may say that you don’t have the resilience gene. It’s not in your nature to bounce back after adversity. As it turns out, you’re only half right. Fifty percent of our propensity for happiness is based on genetics, which we can’t influence very much. Ten percent is based on life circumstances (such as getting a new client, receiving funding, or being mentioned in the media). And, 40% is “intentional activity” that we can influence with our behavior. The mind is a very powerful thing, said Jennifer Gilbert. We all have the power to prevail, said Lauren Manning. Both not only survived but thrived after tragedy.

A few months ago, I attended a discussion hosted by Ellevate, a networking and education organization. The panel consisted of four women who had overcome adversity. The setbacks in your life may or may not as dramatic, but these stories are both inspirational and provide lessons that you can apply, no matter the size of the misfortune you face. First, a little about the women.

  • As one of the top women in finance, when Sallie Krawcheck was fired not once, but twice, she made front-page headlines in The Wall Street Journal. Krawcheck is Chair of Ellevate and moderated the panel.
  • Gilbert was followed off the subway and brutally stabbed approximately 37 times with a screwdriver, and left for dead. She is founder of Save the Date, an event-planning company. She is author of I Never Promised You a Goodie Bag.
  • Manning was a managing director and partner at Cantor Fitzgerald, which was headquartered in the World Trade Center and lost 658 employees on 9/11. Manning survived being swallowed by flames; more than 80% of her body was burned. She is a philanthropist, angel investor and author of Unmeasured Strength.
  • Deborah Norville was TV news’ golden girl. She was hand-picked to replace Jane Pauley on the Today Show in 1990. The media demonized Norville as a schemer who made this happen. She is the anchor of Inside Edition, author of Back on Track: How to Straighten Out Your Life When It Throws You a Curve and Thank You Power: Making the Science of Gratitude Work for You.

Their experiences taught them lessons they shared:

Be grateful for what you have

Even when facing very painful events, try to consider the stressful situation in a broader context recommends the American Psychologist Association. Manning knew and cared about so many people who died on 9/11. She felt lucky to be alive. “Appreciate that, as bad as you think you have it, others have it even worse,” said Krawcheck.

Celebrate life’s little wins, advises Norville. That could be just getting out of the house. Research finds that grateful people recover faster from setbacks. Building a practice of gratitude will not only help you personally, but it will help you be a better leader.

Be mentally tough

There were times Gilbert didn’t want to live, but she fought past those thoughts. She did this by taking a short-term view of things — she lived life one day at a time. Despite stares from people Norville knew, she sucked it up and showed up for work at the Today Show. However, she did decide not to return after her maternity leave.

“Ask not that events should happen as you will, but let your will be that events should happen as they do, and you shall have peace,” Norville quotes Epictetus, a Greek Philosopher. “It’s not what happens to you, but how you react to it that matters,” said Krawcheck.

Know your purpose

Norville recommends that everyone write a one-page answer to the question “Who am I?” Knowing who you are should guide all your decisions. For Gilbert, that was bringing people joy. No surprise she became an event-planner, helping people celebrate happy occasions, such as weddings. For Manning, it was her 10-month-old son. “I can’t leave, I can’t leave my son. I haven’t had enough time with him. I worked so hard to have him. I can’t leave him now…” she said.

Nurture yourself

Pay attention to your own needs and feelings, says APA. Engage in activities that you enjoy and find relaxing. Taking care of yourself helps keep your mind and body primed to deal with situations that require resilience.For Krawcheck, having a glass of wine and getting back into exercise was part of her formula.

Paint me a survivor, not a victim

Manning felt belittled by stories in the media that referred to her as a victim. Having heard her speak, Manning is a SURVIVOR not a victim. “I didn’t want to be associated with the word ‘victim,’ “ said Gilbert.

How do you find the grit and determination to keep going, when you experience a setback?

Becoming a successful entrepreneur is never a straight line. There are lots of ups and downs along the way. As it turns out, how you emotionally handle the downs is key. Resilience is a one of the defining skills and behaviors of people who make it, according to Jeffrey Pfeffer…

Read More

15 Incredible 'Aha!' Moments (Infographic)

The brilliance behind the big ideas of Steve Jobs, Sara Blakely, and others.
BY LARRY KIM
Founder and CTO, WordStream@larrykim

How do you come up with new business ideas?

If you're like Steve Jobs, Brad Pitt or Brian Chesky, inspiration and those magical "Aha!" moments come from a place everyone can access: everyday life.

San Francisco's Funders and Founders took a look at how super successful people have found that one thing that took them from struggling to industry icons.

Microsoft founder Bill Gates, for example, had a huge Aha! moment when he realized he would have to sell his product before he could even make it. That just wasn't how things were done then, but he saw the necessity of it if he planned on going forward with development. Now, software and hardware presales are commonplace.

GoPro founder Nick Woodman was inspired to invent a sturdier adventure camera when he wanted to take pictures of himself surfing. There simply wasn't anything on the market to fulfill that need.

Sara Blakely started out in sales and though she liked the support of pantyhose, she hated the way they looked with open-toed shoes. Her Aha! moment came when she realized she could cut the feet off and work on redesigning the women's undergarment. That little idea of hers ballooned into a multi-million dollar business, making her the youngest self-made female billionaire on the planet in 2012!

See how other great inventors, famous founders and super successful people got inspired and came up with the ideas they'll go down for in history in the infographic below:

The brilliance behind the big ideas of Steve Jobs, Sara Blakely, and others. BY LARRY KIM Founder and CTO, WordStream@larrykim How do you come up with new business ideas? If you're like Steve Jobs, Brad Pitt or Brian Chesky, inspiration and those magical "Aha!" moments come from a place…

Read More

I will not do your tech interview.

I am terrible at taking tech interviews. Out of dozens that I’ve done, I may never have passed one. My typical pattern goes like this: A serendipitous contact leads to outstanding phone call with a manager or recruiter. I move on to a phone screen with a hiring manager who comes away very excited. Finally, I go onsite (or online these days) to dig into the nitty gritty with coders and get washed out.

Sometimes they would want to hear something I didn’t know. Other times I just froze on topics that I know very well. (One time I couldn’t even name my favorite video games.) Many times, I failed to perform well on some logic puzzle. Every job I actually got was because a friend made sure that it happened.

For years and years I lived in fear of the interview because I knew that I’d fail. At the same time, I knew that I was a very good developer. I was always a go-to guy on my teams, took on large projects alone, and had success as a lead.

As I struggled with my own interviewing issues, I set up interview pipelines as a manager that mimicked those that I had experienced. Brain-teasers, tests, technical grilling, the whole works. As I informally observed the track record of those pipelines in hiring great people, I began to realize that the only real predictor of great hires was if the candidate already knew someone on the team. You can’t just go off of one guy’s word that his college buddy is great, though. It’s not fair to your current employee to bear the entire burden of the hiring decision. So what do you do?

I finally stumbled upon the cure when I interviewed at a small startup that had a different approach. I met the leads for lunch, then followed up with a social chat with the whole team. We talked tech, but they didn’t try and vet my skills. Instead, they offered me a paid contract to do some work that they actually needed done. They gave just enough direction to get me started and then left me to my own devices to see if I could get it done well, on time, and with good communication. It took me about 10 hours of time in the evenings to complete. Three days later, I had a job offer!

Since that day, I have refused to take traditional tech interviews. I politely suggest that a short contract job might be the best option for a company to evaluate a senior developer. This works very well if they are unsure about you. It works even better if they really want you. As an added benefit, you get to see what it’s like to really work with a team before you take a job with them.

There have been some companies that refused to use my model, which I totally understand. Those jobs are just simply jobs that I am not going to get anyway. I just thank them for their interest and move on.

Succeeding with this approach to interviewing gives you a level of credibility and leverage that you can never get from a traditional interview. I have had a 100% success rate (4/4) in getting job offers from companies that I interview with in this way. The one that I actually accepted was from a company that, instead of hiring me, decided to invest in creating a new startup with me.

Some people do very well with traditional interviews and they should stick with what works for them. However, I’d urge any company to really look hard at what their interview process is screening for. Does it accurately produce employees that do great work and fit well with the team? Does it select people who have heard your particular brain teasers before? Are you just going through the motions on interviews and then going with someone’s gut? Maybe that manager is really good at guessing, but what happens when they leave? Think about whether or not the short term contract approach might give you a better idea about a candidate’s value.

EDIT: Thanks for all the interest, medium, twitter, and hackernews readers! I didn’t expect a response like this. I guess most engineers have had a terrible interview experience or two… or many.

Some quick clarifications to respond to some of the excellent criticism I’ve read today.

None of this applies to conversational interviewing. Ask me about closures or what the mutable keyword means all day long. It’s totally important to know if I’ve worked much with CSS(no) or if I know how A* works(yes). What I’ve opted out of is whiteboard coding, brainteasers, live coding, etc. A rule of thumb… if we can discuss it over beer or a bourbon, I’m game.

I’m not a “hide him in the corner” sort of coder. I’ve been an Executive Producer in the games world and done tons of team speeches, investor pitches, conference talks, publisher calls, etc. The difference in those settings is that I can nearly always say, “I need to think about that. I’ll get back to you tomorrow.” People tend to respect, “I don’t know that off hand,” too. I’ve learned to prepare and rehearse until I feel natural going from the script or diving into the many conversation tree options that I’ve pre-planned for. I haven’t been able to make these strategies work in a tech interview.

On top of that, you never know when you’re walking into an ambush with a tech interview. A great interviewer knows that it’s THEIR job to find out what a candidate is good at, if anything. Most interviewers are not great. Once you’ve got your leg stuck in the bear-trap of a stupid brainteaser, you’ve lost the job. By opting out of entering this minefield, I can filter for the situations where I’m much more likely to succeed and get along with the team.

Thanks again for reading and commenting!

EDIT 2: A former colleague of mine asked if I would refuse to answer a particular interview question of his. I’d never refuse to answer a tech question in an interview. If I’ve gotten myself into that situation, that’s what I get. It’s disrespectful to not even try. As an interviewer, I’d just assume that the candidate didn’t have a clue if they refused.

The goal is to not get into a situation where I’m at the mercy of whatever person is interviewing and have only limited skills in surviving.

Source: https://medium.com/@ikeellis

I am terrible at taking tech interviews. Out of dozens that I’ve done, I may never have passed one. My typical pattern goes like this: A serendipitous contact leads to outstanding phone call with a manager or recruiter. I move on to a phone screen with a hiring manager…

Read More

Successful People Start Before They Feel Ready

In 1966, a dyslexic sixteen-year-old boy dropped out of school. With the help of a friend, he started a magazine for students and made money by selling advertisements to local businesses. With only a little bit of money to get started, he ran the operation out of the crypt inside a local church.

Four years later, he was looking for ways to grow his small magazine and started selling mail order records to the students who bought the magazine. The records sold well enough that he built his first record store the next year. After two years of selling records, he decided to open his own record label and recording studio.

He rented the recording studio out to local artists, including one named Mike Oldfield. In that small recording studio, Oldfield created his hit song, Tubular Bells, which became the record label’s first release. The song went on to sell over 5 million copies.

Over the next decade, the young boy grew his record label by adding bands like the Sex Pistols, Culture Club, and the Rolling Stones. Along the way, he continued starting companies: an airline business, then trains, then mobile phones, and on and on. Almost 50 years later, there were over 400 companies under his direction.
Today, that young boy who dropped out of school and kept starting things despite his inexperience and lack of knowledge is a billionaire. His name is Sir Richard Branson.

How I Met Sir Richard Branson

A few months ago, I walked into a conference room in Moscow, Russia and sat down ten feet from Branson. There were 100 other people around us, but it felt like we were having a conversation in my living room. He was smiling and laughing. His answers seemed unrehearsed and genuine.

At one point, he told the story of how he started Virgin Airlines, a tale that seems to capture his entire approach to business and life. Here’s the version he told us, as best I can remember it:

I was in my late twenties, so I had a business, but nobody knew who I was at the time. I was headed to the Virgin Islands and I had a very pretty girl waiting for me, so I was, umm, determined to get there on time.
At the airport, my final flight to the Virgin Islands was cancelled because of maintenance or something. It was the last flight out that night. I thought this was ridiculous, so I went and chartered a private airplane to take me to the Virgin Islands, which I did not have the money to do.
Then, I picked up a small blackboard, wrote “Virgin Airlines. $29.” on it, and went over to the group of people who had been on the flight that was cancelled. I sold tickets for the rest of the seats on the plane, used their money to pay for the chartered plane, and we all went to the Virgin Islands that night.
I took this photo right after he told that story. A few moments later I stood shoulder–to–shoulder with him (he’s about six feet tall) and thanked him for sharing some time with us.

Sir Richard Branson in Moscow, Russia. Photo by James Clear.

What Makes Branson Different?

After speaking with our group, Branson sat on a panel with industry experts to talk about the future of business. As everyone around him was filling the air with business buzzwords and talking about complex ideas for mapping out our future, Branson was saying things like: “Screw it, just get on and do it.” Which was closely followed by: “Why can’t we mine asteroids?”

As I looked up at that panel, I realized that the person who sounded the most simplistic was also the only one who was a billionaire. Which prompted me to wonder, “What’s the difference between Branson and everyone else in the room?”

Here’s what I think makes all the difference:

Branson doesn’t merely say things like, “Screw it, just get on and do it.” He actually lives his life that way. He drops out of school and starts a business. He signs the Sex Pistols to his record label when everyone else says they are too controversial. He charters a plane when he doesn’t have the money.

When everyone else balks or comes up with a good reason for why the time isn’t right, Branson gets started.

Start Now

Branson is an extreme example, but we could all learn something from his approach.

If you want to summarize the habits of successful people into one phrase, it’s this: successful people start before they feel ready.

If there was ever someone who embodied the idea of starting before they felt ready to do so, it’s Branson. The very name of his business empire, Virgin, was chosen because when Branson and his partners started they were “virgins” when it came to business.

Branson has started so many businesses, ventures, charities, and expeditions that it’s simply not possible for him to have felt prepared, qualified, and ready to start all of them. In fact, it’s unlikely that he was qualified or prepared to start any of them. He had never flown a plane and didn’t know anything about the engineering of planes, but he started an airline company anyway.

If you’re working on something important, then you’ll never feel ready. A side effect of doing challenging work is that you’re pulled by excitement and pushed by confusion at the same time.

You’re bound to feel uncertain, unprepared, and unqualified. But let me assure you of this: what you have right now is enough. You can plan, delay, and revise all you want, but trust me, what you have now is enough to start.

It doesn’t matter if you’re trying to start a business, lose weight, write a book, or achieve any number of goals… who you are, what you have, and what you know right now is good enough to get going.

We all start in the same place: no money, no resources, no contacts, no experience. The difference is that some people — the winners — choose to start anyway.

If you’re having trouble getting started, then these articles should help:

  • How to Stop Procrastinating by Using the “2-Minute Rule”
  • The “Chosen Ones” Choose Themselves
  • How to Stop Procrastinating on Your Goals by Using the “Seinfeld Strategy”
  • No matter where you are in the world and regardless of what you’re working on, I hope you’ll start before you feel ready.

James Clear writes at JamesClear.com, where he shares science-based ideas for living a better life and building habits that stick. To get strategies for boosting your mental and physical performance by 10x, join his free newsletter.

This article was originally published on JamesClear.com.

Source: https://medium.com/@james_clear

In 1966, a dyslexic sixteen-year-old boy dropped out of school. With the help of a friend, he started a magazine for students and made money by selling advertisements to local businesses. With only a little bit of money to get started, he ran the operation out of the crypt inside…

Read More