Friday, August 31, 2018

My Mom Quit Her Job After 9 Years And It Taught Me How to Value a Talented Employee

When someone quits unexpectedly, chances are you've been messing things up for a while. Here's how to avoid a surprise talent loss.

1 Surprising Sign in a Job Interview the Hiring Manager's a Narcissist

Too much of this could mean the hiring manager might be a nightmare to work for.

The #1 Mistake Companies Make When Promoting People Into Management  

If you're looking to promote someone into a managerial role, ask yourself this one question.

The 1 Retention Tool Companies Don't Utilize Enough  

This is a free tool every company should consider using to retain talent.

4 Telltale Signs That Your Workplace Is Toxic

Most people justify to themselves why they should not have a hard conversation.

Labor Day Lessons From Business Celebrities

Three podcasts and two courses to make your brain sizzle.

Working Too Hard Could Be Harmful to Your Career, Says a New Survey of 52,000 Employees

Logging longer work hours doesn't necessarily give you a career boost, and in fact it might hurt your career, says a new study of 52,000 employees.

Elon Musk is the Master of Taking Action Quickly -- Why That Might Not Be the Best for a Leader

Elon is making headlines again, but could hisrecent series of mistakes have been prevented?

3 Tactics to Build Better Relationships with Strangers

You can use these tactics for building better relationships with new co-workers and even sales prospects.

How Focusing on 'Strength-Based Development' Can Boost Your Profits by Nearly 30 Percent

Leaders need to shift their focus on what's strong rather than what's wrong.

How to Create an Isometric Layered Text Effect in Adobe Illustrator

A 4-Word Master Class in Leadership From Steve Jobs

We love to complicate leadership in countless books, articles, and insights, but there is no formula. However, there is this gem that guides all great leaders.

How to Tell the Difference Between Real Trends and Fads on Social Media

Are you struggling to tell the difference between social media opportunities and fads? Then use this simple 3-step process to never get duped again.

The 1 Thing the Founder of KIND Says You Need to Be Successful

Inc. editor-in-chief James Ledbetter and Daniel Lubetzky, founder of KIND Snacks, talk about the leadership trait Lubetzky says he struggles with the most. Watch the full interview for more.

Forget Winning the Battle Against Fake News and Fake Influence. Instead, Try This

The greater the value of any technology, the greater the disruption and abuse. That's OK as long as we also keep this in mind.

Ask Yourself These 3 Simple Questions to Eliminate Toxic Relationships From Your Life

Succeeding with your career is about much more than talent. To succeed requires that you surround yourself with the circle using these three questions.

4 Easy Steps To Develop Game Changing Bravery

LeadPublic SpeakingProductivityGrow StrategyJoseph PearlmanBusiness How To Get Braver Faster

How This New York Brewery Found a Golden Product Opportunity With 'Game of Thrones'

Jon Snow gets his own 'Game of Thrones' beer thanks to a sudsy partnership between HBO and Brewery Ommegang.

3 Things You Can Learn From the Office Jerk

For one, you can almost always smile your way out of a conflict.

How to Let Go Of An Outdated Requirement And Hire The Best

Job qualification comes in many forms, and a degree is not always an indicator of readiness.

Proof That LEGO Knows Exactly How to Inspire Its Fans? Behold This 1 Million-Piece Drivable Sports Car

LEGO and Bugatti team up to build a life-size, drivable car using over 1 million Technic elements and 2,304 motors.

Why Forgetting Something Actually Helps You Learn, According to a Cognitive Psychologist

Students love to cram, but cramming is not the most effective or efficient way to learn. Here are three evidence-backed strategies that can help.

3 Things Hard-Working Entrepreneurs Must Do Before Leaving for Vacation

Stepping away from work is one of the biggest challenges entrepreneurs face. Here's how to get the time away you need.

Ellen Pao: This Is a Critical Moment for Women in Silicon Valley

Inc.'s editors discuss how the former venture capitalist and CEO of Redditis speakingout about her seminal discrimination lawsuit, harassment online, and privacy. Plus: breaking up with your co-founder.

7 Lessons I Learned From Interviewing Some of the World's Most Successful Leaders

Here are just a few of the lessons I have learned from conversations and interviews with a few of the world's high-achieving leaders.

The Ingenious Way This New York Butcher Sells 3,000 Pounds of Meat a Week

Buy Steaks, Sausage and Pork Chops from a Vending Machine, Thanks to New York-based Applestone Meat Company.

Find It Hard to Get Your Team to Do Things the Way You Want? Here's What You Can Do About It

You're probably missing a important piece of the puzzle.

Why Uber Could Lose the Race to the First Ridesharing IPO

The big ridesharing companies are both expected to go public in 2019.

Smart Ways to Manage These 6 Common Business Travel Challenges

What to Do When These Common Travel Problems Arise

Want to Catapult Your Company Forward? Try Listening to Your People

Looking to improve your workplace? Listening to your employees is a way to save your company money and resources.

3 Core Principles You Need to Attract and Retain Top Talent

Focus on the growth of your employees and watch customers flock and revenue skyrocket.

3 Lessons Every Entrepreneur Can Learn from Aretha Franklin, John McCain and Neil Simon

Reflect on these meaningfulquestions this Labor Day weekend.

Teachers Who Buy Their Own Supplies Are About to Pay More

How the current trade war will increase costs for teachers, makers, crafters, and Girl Scouts too.

Why You Should Encourage Your Employees to Think Like Entrepreneurs

When we hear the word entrepreneur, most people will think of someone running a company. However, being entrepreneurial is a mindset employees need.

An Open Letter to Young People on How to Succeed (From an Aging CEO)

Young people have abundant gifts, but with those gifts come vulnerabilities, including harmful stereotypes. Here's how to grow the gifts while conquering the latter.

Inclusive Innovation Results in 5.5 Times More Revenue Growth

The results are extraordinary when everyone participates in generating new ideas, products, and services.

Why We Need More Women Managers

How we can leverage Diversity in our workforce.

5 Ways To Practice Self-Care, Even as a CEO

September is National Self-Care Awareness Month, but really, these tips are helpful all year round. Here's how you can practice self-care, even as a CEO.

Pressure Is a Privilege: Why You Should Always Seize the Opportunities That Scare You Most

You may feel anxious, nervous, and even scared when you finally get the chance to do what you've worked hard for. And that's a good thing.

Is Believing in Your Business Idea Enough? Not Unless You Add This.

It's the mother of all secret sauces for success.

3 Daily Habits Successful Entrepreneurs Practice to Stay at the Top of Their Game

Use these habits to build a competitive (and sustainable) edge.

3 Good Reasons to Stop Worrying So Much About Your Kids, According to Experts

So much can go wrong in the process of raising successful children, but there's also a place for keeping things in perspective and cutting yourself--and your kids--some slack.

This Best-Selling Author's Secret to Maximum Productivity

Best-selling Die Empty author Todd Henry puts a strict limitation on his creating. You should consider the same approach

Are Your Managers Feeling Overwhelmed and Underappreciated? Here's How to Set Them Up For Success

5 ways to invest in managers to improve employee engagement.

3 Smart Ways To Beat Doubt

Why fast eats slow.

How to Refocus Your Personal Brand With Video

Using video is a great way to give your brand the refresh it needs.

What Is a Webinar (Definition)? +How Does It Work?

This 30-Minute Workout Builds Muscle and Burns Fat in Less Than Half the Time of a Normal Workout

Inspired by a former Army Ranger, This optimal workout helped me achieve twice the results of my workouts in less than half the time.

20 Ways To Improve Your Emails Today

With hundreds of emails received and sent every day, professional e-communication skills continue to be an important skill set to maintain.

Do Your Tattoos Mean You Won't Get Hired? Studies Say Yes (Unless This Happens)

Studies show people with tattoos are still less likely to be hired and tend to start at lower pay rates -- unless the hiring manager has tattoos.

Manipulating images in PHP using GD

Are You Cut Out to Be a Mentor? These 6 Questions Will Help You Find Out

Everyone in the workplace, especially millennials, would like a leader as a mentor, no matter what their age or work experience.

If You Haven't Hired Women You May be Missing Some of the Best Talent, According to Walmart.com CEO

Walmart.com CEO, Marc Lore, says hiring a diverse group of individuals for your teamisn't just the fair thing to do, it's essential to your success.

No Marketing Budget? Here Are 4 Creative Ways to Land New Customers

Your small business needs leads. To grow you need new customers. But how do you get new business with a tight marketing budget?

The Subtle Discrimination Parents Face at Work--and 1 CEO's Effective Solution

The service addresses a sinister bias that typically flies under the radar.

Ivy League Universities Are Seeing Crazy High Enrollment in Courses on This Surprising Subject

America's brightest students are rushing to wise up on this topic. Maybe it's time you did, too.

5 Red Flags of Small Business Fraud--and What You Can Do to Snuff it Out

Even the most trustworthy employees might be robbing you blind. Learn what signs you need to watch for to stop fraud at your small business.

Two Grown Men Got Into a Fight On a Plane. A 13-Year-Old Girl Gave Them Sage Advice

Sometimes, it takes a kid to teach adults about behavior.

Forget Company Culture -- Managers Should Focus On This

The term company culture is overused and misrepresented far too often. It is time to shift focus from why to how we work together.

KIND's Daniel Lubetzky on Getting His Start, His Legacy, and Knowing When to Step Back

Inc. editor-in-chief James Ledbetter sits down with Daniel Lubetzky, founder of KIND Snacks, to talk about what inspires his never-ending grind.

10 Workplace Behaviors You'll Regret (and How to Avoid Them)

Manage your emotions at work so that they don't manage you

The 3 Best Infographics Templates for Adobe After Effects

7 Reasons Getting Your Employees to Vote Will Help Your Business  

Just because your workers don't support the same politician doesn't mean they can't respectfully disagree and move on to get their work done.

Middle Class and Struggling Financially? Math Says You Shouldn't Blame Yourself  

A new book digs into why getting ahead in America feels so incredibly difficult these days.

15+ Best Online Business Logo Makers (Free + Premium for 2018)

4 Ways You Can Feel Successful Now Even if You're Failing

It could be as simple as sitting still and quiet for 20 minutes.

7 Android Templates to Inspire Your Next Project

How Celebrity Kids Made This Startup's Product the Biggest Hit of the Summer

Babiators sunglasses bring in $5 million a year, and have developed a cult following. The famous babies probably don't hurt.

Are You to Blame for Your Company's Toxic Culture? Here's How to Fix It

Nothing productive you do for your company matters if you're operating in a toxic environment. Follow these steps to make your workplace as uncontaminated as possible.

How This Mother of 5 Turned Scrap Leather Into One of the Fastest-Growing Companies in America

She never planned to have a full-time job. What she got was a fast-growth business.

Meet the Woman Behind a $2 Million Superfood Business Helping Women Farmers in Africa

Lisa Curtis discovered moringa as a Peace Corps volunteer. She's turned a superfood into a sustainable company that enriches farmers in the developingworld.

Why Do Women Entrepreneurs Pay Themselves 28 Percent Less Than Men?

Most say they still wouldn't go back to being employees.

Please Quit Saying Serena Williams Is a Great Tennis Player (She's an Icon)

The moment is only visible in retrospect--and it's when people who don't follow sports, or haven't ever watched a tennis match, know and respect her.

Thursday, August 30, 2018

This One Simple Rule Can Save You Pain in Your Next Venture

It can be tempting to disrupt before understanding the lay of the land. In a recent Business Rockstars interview, I share a better way to have impact

Good Design Is Crucial to Business Success. Here's Why

Good design can make or break your business. Here's why you should invest more in your design team.

Use These Secrets to Sell More on Amazon, Faster

A Q&A session with experts who share all the secrets, tricks, and strategies that work.

This American Airlines Flight Turned Into a Nightmare. So Did the Flight on the Replacement Plane

Bad luck? Or something else?

How to Supercharge Your Team's Development for the Long-Term

Invest in each team member's professional development to help them reach their full potential.

What 'Love Language' Does Your Employee Speak?   

It may take more time upfront to identify everyone's motivators, but it beats time spent managing turnover.

5 Things Good 'People' Managers Have In Common

There's a distinct different between good managers and good 'people' managers.

How to Free Up Your Time to Focus on Building Your Business

Avoid confusing your efforts with results with these three tips.

How to to Recover Your Business From a Natural Disaster

It takes serious heart to pick your business back up after a natural disaster. These business owners made it happen.

3 Steps to Help Lower Your Post-Vacation Anxiety

A little planning ahead can help ease your transition back to work.

WhatsApp Has a New Feature That Will Charge Businesses if They Don't Respond in 24 Hours -- And It's Genius

WhatsAppis rolling out a new feature, read why it could make them very profitable in the future

The Guys Who Designed YouTube Just Re-Designed the Coffee Break

Everything you thought you knew about drinking coffee at work is probably wrong.

If Quitting a Job Is Just Too Stressful, This Service Will Do It for a Fee

The Japanese startup Senshi S LLC takes the stress out of quitting for nervous employees looking for a painless escape.

Avoid These 3 Pitfalls During High-Stakes Conversations

One of the biggest challenges you will face in business is handling conflict.

There's Only One Real Measurement for Great Leadership. Do You Have it?

Proving yourself to know more than others isn't leadership. Inspiring others is.

Know Someone Who Needs Help at Work? Try These 3 Approaches to Offer Your Support

Stressed colleagues respond well when you show empathy, and the effects of doing so improve workplace culture.

19 Job Perks Millennials Have That Baby-Boomer's Didn't 

Gym memberships and shorter work weeks weren't as common decades ago as they are today.

5 Early Warning Signs It Might Be Time to Quit Your Job

Here's how to make your exit a graceful one.

Logistics Is Incredibly Complicated. This Company Is Making It Simple--With Some Help From Emojis

San Francisco startup Flexport discovered a rather playful idea to help run its business more efficiently.

According to an MIT Study, This Is the Best Time in Life to Start a Business

The average age of entrepreneurs is probably higher than you think.

4 Tips to Help You Nail Your Next Startup Interview

Interviewing is hard, but interviewing at startups can be mystifying. Here are four tips on how to nail your next startup job interview.

In-N-Out Has a Big New Problem That Could Seriously Threaten Its Business (Or Could It?)

Its low-key. It's cultish. But now, controversy.

This Viral Chick-fil-A Video Points Out 2 Vital Things the Company Offers Its Employees

Whether you love Chick-fil-A or hate it, the company continues to teach lessons for us all to learn.

How This Musician and Others Continue to Take a Stand for Unjust Rules

How this musician and others continue to take a stand to change the status quo

How to Get Your Product in a Major Retail Store

Ever dream of getting your product in a major retailer? Here's how to reach the masses.

Looking to Close the Deal? Avoid These 5 Presentation Pitfalls

Avoid these five common presentations mistakes if you want to make a great impression and land the deal.

5 Questions You Need to Ask Your Best Employees If You Want Them to Stay

Once your employees decide to leave, it's too late.

18+ Best PowerPoint Template Designs for 2018

Aisha Tyler's Perfect Comedy Rule Applies to Your Business, Too

Acting and directing comedienneAisha Tyler learned how to handle hecklers in stand up. Here's how to thrive with unfair criticism

Should You Work at a Startup or an Established Company? Ask These 3 Questions to Decide

Goals, structure, and culture all play an important role in choosing the ideal job environment.

Checking Work Email After Hours Is Harmful to Employee Health, According to New Research

The easiest way to blur the boundary between your work and private lives is to answer email outside of normal working hours.

How Mentors Can Close the Tech Diversity Gap

For an inclusive workplace, diversify your mentor network.

Amazon Fights Back Against Bernie Sanders's Claims About Low Wages and Poor Working Conditions

The e-commerce giant says the senator's allegations are "inaccurate and misleading."

So You’re Selling a WordPress Theme: Best Practices for Demos

Why Getting Face Time with Your Source is a Brand Accelerator

Moving off email and getting some face time with your supplier is re-emerging as the business growth necessity and biggest time and money-saver.

5 Questions You Should Ask Immediately After a Failure

If failure prevention is your goal, mediocrity will be your outcome

3 Questions You Must Ask During Your Next Job Interview

You know it's coming. The inevitable question that ends every interview. "So, do you have any questions for me?" These are the 3 questions you can't go wrong asking.

How to Use Material Design in Angular 6

The One Question You Should Ask That Will Make You A Better Leader

Nothing encourages critical thinking and instills confidence more than simply asking for someone's opinion.

Van Jones on How to Find Talent and Open Opportunities

People from underrepresented backgrounds are less likely to work in STEM fields. Here's how to open opportunities.

3 Foolproof Ways to Make Your Remote Team More Productive

Get the most out of your remote workforce with these time-tested tips.

What Are the 10 Most Common Presenter Mistakes

And by identifying them we might avoid making them.

1 Thing Netflix Did Successfully That Took It From Commodity to Category Leader

Netflix owns home entertainment, but it didn't get there because of streaming. Here's its secret.

Most Companies Treat This Detail as an Afterthought Even Though It Has a Big Impact on the Customer Experience

Cracks and holes in your customers' journey cause confusion, pain, and frustration, which adds unnecessary friction into your customer experience.

How to Create an Education Infographic in Adobe InDesign

8 Tips for Effective Leadership

No matter where you are in your career, it's never too late to learn how to be an effective leader.

3 Keys to Deliver An Amazing Presentation Suited to the Room

Whether you're speaking to thousands of people from a big stage, or a few hundred in a conference room, there are certain things to remember to ensure your presentation is a success.

Your Worst Hire Might Be the Secret to Building Your Best Culture

Feel like you wasted your time on a bad hire? Course-correct with these five questions and you'll still come out on top.

What's the Future of Software as a Service? The Answer May Surprise You.

Do new advancements in technology foretell the end of SaaS as we know it? Scott Maxwell disagrees. Find out why here.

4 Steps to Launch a Lead Broker Business

Lead flipping could be a lucrative new revenue stream for you and your business.

How to Network With Important People, According to a Harvard-Educated Startup Founder

Why it doesn't matter if you've got nothing but a dream and come from Nowheresville. You can get yourself connected.

Why 'Early to Bed, Early to Rise' Is a Myth (and Night Owls Can Finally Rejoice)

We're in a sleep crisis and it's only increasing. With that said, the answer isn't just to sleep more. It's time to pay attention to our chronotypes.

Where the Best 'Aha' Moments Really Come From

Visionaries think with their hearts.

How to Write A Blog in 30 Minutes

Don't obsess; relax and unleash your creativity

How Culturally Aware are You?

Don't dismiss it PC posturing. Recognizing the varied backgrounds of your team and accommodating those differences in positive ways can help maximize any group's output.

Serena Williams Just Played in a Tutu--Twice--and Teaches an Incredible Lesson that Actions are More Powerful than Words

The lesson is actually quite simple: don't mess with Serena.

The Inspiring Reason Why This Entrepreneur Gave Up His Role as CEO

"Sometimes, to move forward, you need to step back."

Why Paying Attention to This Overlooked Office Feature Might Have a Huge Productivity Payoff

Lighting Science Group wants you to consider your employees' circadian rhythms.

33 Quotes That Will Inspire You to Increase Your Emotional Intelligence

These quotes will help you understand what emotional intelligence is, why it's so necessary, and how you can build yours.

3 Things Nobody Tells You About the Stress of Selling a Business

Entrepreneurs just can't get away from stress. Even when you sell your business, there's stress involved. See how to deal with it here.

6 High-Tech Apparel Products to Give You a Confidence Boost at Every Job Interview

Look sharp, and don't sweat it. These clothing products are high-tech and trendy.

How to Nurture Your Kids' Creativity--and Future-Proof Their Skills

8 ways you can nurture their creativity and help make them "future proof" career-wise

9 Ways to Get Rid of Anxiety in 5 Minutes or Less

Ridding yourself of anxiety will make you more productive, successful, and a better leader. Plus, you'll feel calmer, more in control, and happier.

Traditional Thinking Is Holding You Back as a Leader. Here's How to Change Your Perspective

How to accept the challenges you face and create creative, outside-the-box solutions to the problem at hand with the resources at your disposal.

A Starbucks Customer Asked For Her Starbucks Drink To Be Remade. When It Was, She Got a Real Shock

A breakdown in standards?

What 1 Sentence in John McCain's Final Statement Should Teach You About Leaving a Legacy

The senator's last words to the nation were heartfelt, and held a one-sentence gem.

Elon Musk's Recent Nervous Breakdown is a Warning Sign to Business Owners Everywhere

Working 24/7 and pushing yourself to the brink is never an entrepreneurial badge of honor. Here's how to stay healthy while building your company.

This 32-Minute Morning Routine Is the Best Way to Start Your Day, According to Science

The simple habits of the happiest people start in the morning.

5 TED Talks That Will Make You Feel More Powerful

Want to feel a little more confident and in charge? All you need is 20 minutes and an internet connection.

How This Toy Startup Spent $4 Million to Save Its Holiday Sales When Everything (Literally) Fell Apart

A shipping disaster right before the holiday sales season could have tanked Anki. Instead, it turned into a case study in problem-solving under pressure.

The Big Lie Facebook and Twitter Tell Themselves (And Us)

Facebook and Twitter say they want to promote real conversation, but that's not what they're built to do.

American Airlines Flight Attendants Will Picket Their Own Airline Today Over Its 'Inhumane' and 'Punitive' New Policy

If your American Airlines flight attendant doesn't seem happy today, maybe this is why.

Delta Air Lines Flight Stopped by Guy Doing Push Ups on the Runway (That's When Things Got Really Weird)

Los Angeles International Airport (LAX) was closed for 20 minutes after a bizarre incident that stunned passengers and crew alike.

How to Create an Evil Photo Effect With an Adobe Photoshop Action

She Started a Gym for Your Face, Thanks to Ayahuasca and a Helpful Shaman

Inge Theron is a former beauty editor who got the idea for FaceGym while on vacation in Mexico. Will her facial workouts catch on back in New York City?

When's the Best Time to Book Your Flight for Thanksgiving? It's a Lot Sooner Than You Think

Google Flights and Hopper use algorithms to help you plan your travel purchases.

3 Unexpected Office Tweaks for Happier and More Productive Employees

If you want happy and productive employees, give them a space where they can thrive.

This Founder Had to Completely Start Over at 40. She Responded By Building One of the Fastest-Growing Companies in America

Debbie Madden has experienced the extreme highs and lows of entrepreneurship for almost two decades.

Want to Raise Successful Daughters? You May Be Making This Mistake Without Knowing It

New research suggests parents aren't as evenhanded as they think.

Twitter's CEO Asked Elon Musk to Speak to All of Twitter's Employees. Here's the Truly Surprising Way It Changed 1 Musk Fan's Life

Oh, and did we mention the Dalai Lama? Yeah, he's in this story, too.

3 Changes America Needs to Make to Revive Our Entrepreneurial Spirit

New business creation in the U.S. is near a40-year low.

3 Business Clichés You Should Actually Embrace

Originality isn't all it's cracked up to be. Before you dismiss these old saws, consider their essential truths.

No Airline Pilot Has Ever Done This Before and No Pilot Will Likely Do It Again (Let's Hope)

Sometimes, even those in the cockpit get caught up in a certain madness.

Wednesday, August 29, 2018

Fast Food Chain Fires Woman Because She's Pregnant, Calls for Additional Staff Training

She got the news via text.

Learning from Paul Manafort's Crimes Can Save You $100,000. Here's How

Paul Manafort may have just helped small business owners avoid this $100,000 penalty.

How Not to Panic and Other Leadership Tips From the Astronaut Who Survived a Seriously Scary Space Walk

"The more you know, the less you fear. The former International Space Station commander offers valuable lessons in how to be a better leader.

These 3 Job Interview Tips Are So Easy (and Successful) That They Feel Like Cheating

After giving 1,000 interviews, I've identified three tips that every single candidate needs to know to land the perfect job.

How to Decide Between Etsy, Amazon, and Shopify for Selling Online

Starting to sell something online can feel intimidating. Here's three platforms that make it easy to sell.

The 3 Times Criticizing a Competitor Can Actually Help Your Startup

There are times when it's appropriate to criticize your competition. But you have to know the right and wrong time to do so.

How An 18-Year-Old Kid Turned The Death Of His Father Into A Positive Experience

Youinvest in yourself, you put yourself in the right room, you be a giver, and you be open and vulnerable. Joshua did all of these things.

3 Sure Signs Your Company's Branding Is Outdated (Plus, How to Fix It)

Think it's about time to rebrand? Be sure to take these important factors into account before making the final decision.

What a New NAFTA Means for You

The agreement offers new opportunities for American tech and e-commerce companies.

Steve Job's Alternative to the Open Plan Office

Pixar got it right. Either spend big money on individual offices and open spaces, or don't bother.

How to Get the Green Light for Your Next Business Trip

There are several benefits to business travel, especially in a digital world where human interaction is scarce.

Over 50 Airlines Allow Passengers to Fly Business Class at a Fraction of the Cost--Here's How

An upgraded experience awaits.

4 Lifestyle Habits That Will Make You Successful

Like peer pressure, habits can make you do stupid things or spur you on to achievement. Cultivating these four habits will help you become your best self.

Teenage Entrepreneurs Are Your New Start-Up Competition

Why this UCLA-partnered high school accelerator is giving money to teenagers and how you can benefit too.

How Your Tone of Voice Can Make People Appreciate Your Feedback (Instead of Thinking You're a Jerk)

Before you confront your coworker, make sure to plan ahead. Here's how you can give feedback in a constructive way.

International Artist Feature: Israel

Why Didn't Prince or Aretha Franklin Leave a Will?

prince, aretha, aretha franklin, carol roth, futurefile, estate, estate planning, wills

Trump Accuses Google, Facebook and Twitter of Biased Search Results 

Trump says U.S. tech companies are burying conservative news in search results.

How to Make an Attractive PDF Photography Portfolio

Top 10 Marketing Conferences for Fall 2018

Top 10 Marketing Conferences for Fall 2018: Learn, network and grow at these must-attend events!

Instagram Wants You to Apply for a Verified Account. Here's Why

The new verification process is part of a larger effort to make Instagram safer for users.

Here's How Google Search Works, Mr. President

President Donald Trump recently took to Twitter and demonstrated a striking misunderstanding of how Google's search function actually works.

10 Best Photoshop Effects to Add Beautiful Bokeh to Photos

Think Instagram is Your Best Marketing Tool Because of Its Popularity? Think Again

Which image-based platform can offer your brand the most value in your current position: Instagram or Pinterest?

Leaders Can Burn Out Really Easily. Here Are Five Steps to Fix It

Our rapid growth was causing burnout--and I risked losing my top leader as a result.

1 Way Mark Cuban Uses Personal Branding to Redefine What It Means to Be Rich

According to this billionaire, everyone should strive to be wealthy. Here's why...

How To Handle Personal Criticism Just Like Serena Williams Did

Tennis star Serena Williams just got called out by one of the most powerful men in tennis. How she handled the criticism is priceless.

How Every Entrepreneur Should Use Technology to Build Stronger Relationships

New technology can help us find people by filtering out the noise on the web -- so that we can focus on building relationships.

Need Money? Here's Why SBA Loans Are Great Resources--Even If You Don't Think You Qualify

The SBA seems to be the only government agency that is working well in these partisan times.

3 Essential Questions to Ask Before Hiring a PR Agency to Help You Attract Media Attention

Hiring the wrong PR agency could do more harm than good.

How to Use the Symfony Filesystem Component

In this article, we're going to explore the Symfony Filesystem component, which provides useful methods to interact with a file system. After installation and configuration, we'll create a few real-world examples of how to use it.

The Symfony Filesystem Component

More often than not, you'll need to interact with a file system if you're dealing with PHP applications. In most cases, you either end up using the core PHP functions or create your own custom wrapper class to achieve the desired functionality. Either way, it's difficult to maintain over a longer period of time. So what you need is a library which is well maintained and easy to use. That's where the Symfony Filesystem component comes in.

The Symfony Filesystem component provides useful wrapper methods that make the file system interaction a breeze and a fun experience. Let's quickly look at what it's capable of:

  • creating a directory
  • creating a file
  • editing file contents
  • changing the owner and group of a file or directory
  • creating a symlink
  • copying a file or directory
  • removing a file or directory
  • and more

In this article, I'll show you how to unleash the power of the Symfony Filesystem component. As usual, we'll start with installation and configuration instructions, and then we'll implement a few real-world examples to demonstrate the key concepts.

Installation and Configuration

In this section, we're going to install the Symfony Filesystem component. I assume that you've already installed Composer in your system as we'll need it to install the Filesystem component available at Packagist.

So go ahead and install the Filesystem component using the following command.

That should have created a composer.json file, which should look like this:

So that's the installation part, but how are you supposed to use it? In fact, it's just a matter of including the autoload.php file created by Composer in your application, as shown in the following snippet.

A Real-World Example

In this section, we'll create an example which demonstrates how you could use the Filesystem component in your applications to perform various filesystem operations.

To start with, let's go ahead and create the index.php file with the following contents.

Here, we've initialized the Filesystem object to $fsObject and saved the current directory to $current_dir_path. In the upcoming sections, we'll use $fsObject to perform different operations.

Make a New Directory

First, we'll create a new directory.

Here, we've used the exists method to check if the foo directory already exists before creating it.

Next, we used the mkdir method to create the foo directory with the 0775 permissions, which means readable and executable by all, but only writable by the file owner and their group. (This is the octal notation for filesystem permissions—to learn more, check out this breakdown of octal notation.) Further, we've used the chown and chgrp methods to change the owner and group of the foo directory.

Create a New File and Add Contents

In this section, we'll create a new file and add contents to that file.

Here, we've used the touch method to create a new file and then used chmod to set its permissions to 0777—globally readable, writable, and executable.

Once the file is created, you can use the dumpFile method to add contents in that file. On the other hand, if you want to add contents to the already existing file, you can use the appendToFile method, as shown in the above example.

Copy a Directory

So far, we've created the foo directory and the bar.txt file using the $fsObject object. In this section, we'll see how to copy a directory along with the contents.

As you can see, first we built the path names with string concatenation. Then, once we made sure the directory didn't already exist using the exists method, we used the mirror method to copy the foo directory into the foo_copy directory.

Remove a Directory

Finally, let's see how to remove a directory.

Again, it's pretty straightforward—to delete a directory, you just use the remove method.

You can find the complete code to index.php in our GitHub repo.

Conclusion

So that's a brief introduction to the Symfony Filesystem component. The Symfony Filesystem component provides methods that make interaction with a file system a breeze. We looked at how to install the component, and we created a handful of examples to demonstrate various aspects of the component.

I hope that you've enjoyed this article, and feel free to post your thoughts using the feed below!

How to Get Your Employees to Respect You by Respecting Them

A benevolent boss has far less trouble motivating employees.

Companies Are Selling Vapable Vitamins. Don't Inhale the Hype

Vaping is a now part of America's culture, but inhaling vitamins likely has no health benefits, experts warn.

How to Quickly Edit Creative Chart Template Designs in PowerPoint

17 Ways to Be More Productive This Fall

Ready to get back to business? Here's how to get everything done

6 Tools Your Business Should Try This Fall

Being an entrepreneur is hard. These 6 tools make it easier to run your business in 2018.

This Shark Tank Startup Wants to Help You Crush the GMAT and Get Into a Top B-School

Mark Cuban's Shark Tank investment in Prep Expert, a provider of SAT, ACT, and GMAT test-prep courses, has helped fuel sales. And growth.

Want to Build a Great Culture? Start By Leaving Your Ego at the Door

As the founder of a startup, it's not about you. It's about company -- and your team's -- results.

Do You Do This Simple Thing Jeff Bezos Associates With the Smartest People? (You Probably Do, But Not Enough)

The Amazon founder says the key to be right is knowing when you're wrong. A lot.

The Best Industries for Flexible Jobs

These industries all are effective at addressing the real need for work-life balance.

3 Lessons Millennial Entrepreneurs can Learn from Big Business Failures

Successful leaders and entrepreneurs (whether Millennials or not) know that learning from the failures of others is the most efficient way to grow.

3 Things Great Leaders Build

Great leaders are great builders, specifically in these three areas.

Need To Move Your Marketing Up a Notch? Try Hiring a Fractional CMO

Many companies find themselves needing marketing help that goes beyond a consultant, but is less than a full time person. Enter the fractional CMO.

Don't Make These Two Common New Leader Mistakes When Trying To Build Your Credibility

Some behaviors get you short term credibility wins but have unanticipated effects that can actually damage your credibility down the road. Here's what you can do instead.

I Set out to Uncover Who Ran the "Fake Warren Buffett" Twitter Account. Here's What I Learned

It was never about the messenger. It was about the message.

Are You Using Slack Correctly? Try These These 4 Tips to Remove Distractions and Be More Productive

How to utilize Slack to its full potential by implementing a few settings, integrations, and best practices.

We Tested the Best Beef Jerky on the 2018 Inc. 5000 (Because There Was A Lot)

Healthy beef jerky and snack stick products are becoming more and more popular -- enough to land Chomp's Snack Sticks, Chef's Cut, and Country Archer on the Inc. 5000. We set out to find which one tastes the best.

The Notion of Work-Life Balance Is Unrealistic. Here's a Better Way to See It

Balance is not an end game. Here's why you should embrace the constant juggle.

17 Amazing Quotes from Equally Amazing Women

Some of these women have overcome obstacles we can only imagine and have come out the other side as inspiring role models. You can become an inspiration too.

Need More Space in Your Home? A Former Apple and Tesla Engineer Invented a Clever Solution

Startup Bumblebee Spaces disrupts the idea of a room by moving furniture and possessions in and out on command.

Overwhelmed by Stress? These 5 Things Will Help Find a More Productive Head Space

Keeping track of all you've achieved, as well as all you have to be grateful for, can give you a lift when stress becomes overwhelming.

5 Questions That Will Challenge Your Team to Think Beyond the Short Term

Stuck in business complacency? Ask yourself these questions to break free.

1 Simple Way to Instantly Improve Your Leadership That Most Bosses Are Probably Overlooking

Depending on how you answer this question, it may forever change how you lead others.

This Major League Pitching Coach Found the Secret to Productivity. It Works for Any Entrepreneur

This simple strategy helps Major League baseball pitchers stay on top of their game. It can also help fuel your focus and boost your business success.

OK, Open Plan Offices Kill Collaboration But at Least They Won't Kill You From Sitting All Day

A new study shows there are real health upsides to open plan offices.

Wegmans, Virgin and Southwest Airlines Know the Secret to a Winning Culture

Psychologists say leaders often overlook this powerful motivational tool.

How to Create a Surreal Dance Scene in the Rain in Affinity Photo

7 Surefire Tips To Ace Your Next Q&A

Even great communicators don't always shine when fielding unpredictable queries in a public forum. Here's how to respond well, whether you know the answers or not.

NBA Star Steph Curry Writes Impassioned Essay: I want My Daughters to Have Equal Pay

Here's how much would have to change for that to come true.

How a Harvard-Trained Lawyer Built a $2.2 Million Company on Hand-Painted Chocolates

A corporate lawyer turned chocolatier creates dazzling products--and the packaging to ship them in.

These Are the 7 Fastest-Growing Companies in New Orleans This Year

Thirteen years after Hurricane Katrina, these fast-growing companies are making their mark.

It's Time To Call BS On Waking Up Early, Night Owls Rejoice: Here's Why

We constantly hear about the benefits of wakingearly. It's what successful people do, right? Wrong.

Why Creating an Investor's Deck Should Be One of Your First Steps as an Entrepreneur

One of the first things you need to spend time creating is an investor's deck, which ends up helping you more than anyone else.

3 Things All Great Leaders Have In Common

3 Things All Great Leaders Have In Common

United Airlines President Says If Families Want to Sit Together, They Should Pay Extra

He offers a difficult analogy to support his claim.

This 1 Verizon Customer Support Mistake Impacted Thousands of People and It Could Have Been Prevented

A lesson in why investing in company culture and policies can have a significant positive impact when you least expect it.

Tuesday, August 28, 2018

When Over Half of Communication Comes Through Body Language, Do You Understand How You Interact With Others When You're Not in the Room?

digital, communication, sales, marketing

This Labor Day Give the Gift of Prioritizing Employee Feedback

Employee engagement and purpose is an important topic. Here are 3 ways to show your employees that you value them by listening and acting on what they have to say.

NBA Champion Magic Johnson's Brilliantly Practical Mindset for Success in Business

To succeed on and off the court you need to be prepared and give attention to detail.

What Every Entrepreneur Can Learn From the 5 Most Successful Tech Companies Ever

You can study how the Big 5 operate and implement some of their business practices.

How Amazon, Netflix, and Facebook Avoided Falling into the Trend Trap

Some startups don't have the endurance to be more than a passing trend, but this was never an issue for these three companies.

The Brilliant Way the Last Blockbuster Video in America is Staying Relevant

It was once the place to start the weekend, now its last store wants to be the place to party.

How to Handle the 4 Most Common Meeting Saboteurs

Follow this guide to taking on meeting saboteurs and ultimately running the most effective meetings.

Inc. Uncensored: Why Boutique Fitness Is Winning the Category

On this week's Inc. Uncensored podcast, Inc. editors discuss the Inc. 5000 list and which fastest growing private companies were their favorites to write and read about.

Finding and Solving an Important Customer Pain

An experienced entrepreneur says empathy and focus matter.

A Passenger Catches an Airport Worker Doing Something Unconscionable (Did It Delay the Flight?)

You think you've seen it all. Oh, no you haven't.

How to Create a Stunning Photography Portfolio for Your Tablet

The Simple, 11-Word Formula to Becoming a Thought Leader

Looking to become a thought leader? By applying this simple formula, you'll make the process a whole lot easier.

Why You May Be More Powerful Than Taylor Swift

Even one of the most-lauded performers doesn't have complete control over her music. Here's how Taylor Swift represents the past, not your future.

The 3 Simple Questions Jeff Bezos Asks Himself Before Making a Hiring Decision

Jeff Bezos had a personal playbook for hiring protocol.

Are You Traveling for Work More Often Than Not? Don't Let It Knock You Off Balance

There are real advantages to your business to hitting the road but the drawbacks, including burn-out and exhaustion, can be devastating. Here's how to "micro-balance" to your advantage.

Why Every Small Business Owner Needs to Start Their Succession Planning Now

Proper succession planning calls for careful consideration and preparation.

35 Powerful Pieces of Advice to Give You a Lift When Your Self-Esteem Takes a Hit

Many of us struggle with self-esteem at some point in our lives.

How This Schoolteacher Beat 30,000 People to Become the World Champion of Public Speaking

Ask the audience questions every one of them can relate to.

How to Draw People

The Scathing New Book by the Daughter of Steve Jobs Teaches Us the Value of Relationships

Lisa Brennan-Jobs wrote a new book entitled Small Fry, which shows the harsh reality of her father's temper

From Pet Supplies to Pre-Packaged Beverages: Interview with Lemonkind Founder and CEO, Irene Rojas Stanbury

LemonKind is an environmentally and socially-driven company that makes all-natural fruit juices and teas that are 100% good for you and good for the planet.

7 Signs It's Time to Expand Your Team

A small business is only as good as its team. If you're considering expanding, here are 7 signs that may prove it's time.

Laugh to Win in Business and Life: The Surprising Benefits of Comedy

Could a little laughter improve your leadership profile? This entrepreneur went out on a limb to hone his stand-up comedy skills.

How to Cure Your Employees' Fear, Doubt and Procrastination

There is nothing more crippling then fear, doubt and procrastination. Especially when it comes to employee productivity. If you struggle with coaching your employees through these rough patches, keep reading to find out to guide your employees to victory.

7 Ways Entrepreneurs Can Take Advantage of the Booming Economy in 2018

We are lucky to be Americans. Here's why the U.S. is still the best place in the world to be an entrepreneur.

Forget Past Experience. These Are the 4 Superior Traits to Look for in Your Next Hire

If your team only focuses on prior experience during the interview process, you risk hiring poor candidates who aren't a fit for your team. Here's what you should do instead.

In 1 Simple Sentence, Warren Buffet Explains the Power of Personal Branding

Buffet says personal branding is a powerful predictor of career success. Here's why...

5 Annoying Buzz Phrases Entrepreneurs Need to Stop Using

Startup lingo is unique but these terms are getting old and annoying.

How Poor Cybersecurity and One Bad Hire Could Cost Your Company Millions

A recent lawsuit illustrates the old truism that a company can prosper or perish as a result of one hire.

Ideation in Design Thinking: The Zone of Infinite Creative Possibilities

Code Your First API With Node.js and Express: Connect a Database

Build a REST API With Node.js and Express: Connecting a Database

In the first tutorial, Understanding RESTful APIs, we learned what the REST architecture is, what HTTP request methods and responses are, and how to understand a RESTful API endpoint. In the second tutorial, How to Set Up an Express API Server, we learned how to build servers with both Node's built-in http module and the Express framework, and how to route the app we created to different URL endpoints.

Currently, we're using static data to display user information in the form of a JSON feed when the API endpoint is hit with a GET request. In this tutorial, we're going to set up a MySQL database to store all the data, connect to the database from our Node.js app, and allow the API to use the GET, POST, PUT, and DELETE methods to create a complete API.

Installation

Up to this point, we have not used a database to store or manipulate any data, so we're going to set one up. This tutorial will be using MySQL, and if you already have MySQL installed on your computer, you'll be ready to go on to the next step.

If you don't have MySQL installed, you can download MAMP for macOS and Windows, which provides a free, local server environment and database. Once you have this downloaded, open the program and click Start Servers to start MySQL.

In addition to setting up MySQL itself, we'll want GUI software to view the database and tables. For Mac, download SequelPro, and for Windows download SQLyog. Once you have MySQL downloaded and running, you can use SequelPro or SQLyog to connect to localhost with the username root and password root on port 3306.

Once everything is set up here, we can move on to setting up the database for our API.

Setting Up the Database

In your database viewing software, add a new database and call it api. Make sure MySQL is running, or you won't be able to connect to localhost.

When you have the api database created, move into it and run the following query to create a new table.

This SQL query will create the structure of our users table. Each user will have an auto-incrementing id, a name, and an email address.

We can also fill the database with the same data that we're currently displaying through a static JSON array by running an INSERT query.

There is no need to input the id field, as it is auto-incrementing. At this point, we have the structure of our table as well as some sample data to work with.

Connecting to MySQL

Back in our app, we have to connect to MySQL from Node.js to begin working with the data. Earlier, we installed the mysql npm module, and now we're going to use it.

Create a new directory called data and make a config.js file.

We'll begin by requiring the mysql module in data/config.js.

Let's create a config object that contains the host, user, password, and database. This should refer to the api database we made and use the default localhost settings.

For efficiency, we're going to create a MySQL pool, which allows us to use multiple connections at once instead of having to manually open and close multiple connections.

Finally, we'll export the MySQL pool so the app can use it.

You can see the completed database configuration file in our GitHub repo.

Now that we're connecting to MySQL and our settings are complete, we can move on to interacting with the database from the API.

Getting API Data From MySQL

Currently, our routes.js file is manually creating a JSON array of users, which looks like this.

Since we're no longer going to be using static data, we can delete that entire array and replace it with a link to our MySQL pool.

Previously, the GET for the /users path was sending the static users data. Our updated code is going to query the database for that data instead. We're going to use a SQL query to SELECT all from the users table, which looks like this.

Here is what our new /users get route will look like, using the pool.query() method.

Here, we're running the SELECT query and then sending the result as JSON to the client via the /users endpoint. If you restart the server and navigate to the /users page, you'll see the same data as before, but now it's dynamic.

Using URL Parameters

So far, our endpoints have been static paths—either the / root or /users—but what about when we want to see data only about a specific user? We'll need to use a variable endpoint.

For our users, we might want to retrieve information about each individual user based on their unique id. To do that, we would use a colon (:) to denote that it's a route parameter.

We can retrieve the parameter for this path with the request.params property. Since ours is named id, that will be how we refer to it.

Now we'll add a WHERE clause to our SELECT statement to only get results that have the specified id.

We'll use ? as a placeholder to avoid SQL injection and pass the id through as a parameter, instead of building a concatenated string, which would be less secure.

The full code for our individual user resource now looks like this:

Now you can restart the server and navigate to http://localhost/users/2 to see only the information for Gilfoyle. If you get an error like Cannot GET /users/2, it means you need to restart the server.

Going to this URL should return a single result.

If that's what you see, congratulations: you've successfully set up a dynamic route parameter!

Sending a POST Request

So far, everything we've been doing has used GET requests. These requests are safe, meaning they do not alter the state of the server. We've simply been viewing JSON data.

Now we're going to begin to make the API truly dynamic by using a POST request to add new data.

I mentioned earlier in the Understanding REST article that we don't use verbs like add or delete in the URL for performing actions. In order to add a new user to the database, we'll POST to the same URL we view them from, but just set up a separate route for it.

Note that we're using app.post() instead of app.get() now.

Since we're creating instead of reading, we'll use an INSERT query here, much like we did at the initialization of the database. We'll send the entire request.body through to the SQL query.

We're also going to specify the status of the response as 201, which stands for Created. In order to get the id of the last inserted item, we'll use the insertId property.

Our entire POST receive code will look like this.

Now we can send a POST request through. Most of the time when you send a POST request, you're doing it through a web form. We'll learn how to set that up by the end of this article, but the fastest and easiest way to send a test POST is with cURL, using the -d (--data) flag.

We'll run curl -d, followed by a query string containing all the key/value pairs and the request endpoint.

Once you send this request through, you should get a response from the server.

If you navigate to http://localhost/users, you'll see the latest entry added to the list.

Sending a PUT Request

POST is useful for adding a new user, but we'll want to use PUT to modify an existing user. PUT is idempotent, meaning you can send the same request through multiple times and only one action will be performed. This is different than POST, because if we sent our new user request through more than once, it would keep creating new users.

For our API, we're going to set up PUT to be able to handle editing a single user, so we're going to use the :id route parameter this time.

Let's create an UPDATE query and make sure it only applies to the requested id with the WHERE clause. We're using two ? placeholders, and the values we pass will go in sequential order.

For our test, we'll edit user 2 and update the email address from gilfoyle@piedpiper.com to bertram@piedpiper.com. We can use cURL again, with the [-X (--request)] flag, to explicitly specify that we're sending a PUT request through.

Make sure to restart the server before sending the request, or else you'll get the Cannot PUT /users/2 error.

You should see this:

The user data with id 2 should now be updated.

Sending a DELETE Request

Our last task to complete the CRUD functionality of the API is to make an option for deleting a user from the database. This request will use the DELETE SQL query with WHERE, and it will delete an individual user specified by a route parameter.

We can use -X again with cURL to send the delete through. Let's delete the latest user we created.

You'll see the success message.

Navigate to http://localhost:3002, and you'll see that there are only two users now.

Congratulations! At this point, the API is complete. Visit the GitHub repo to see the complete code for routes.js.

Sending Requests Through the request Module

At the beginning of this article, we installed four dependencies, and one of them was the request module. Instead of using cURL requests, you could make a new file with all the data and send it through. I'll create a file called post.js that will create a new user via POST.

We can call this using node post.js in a new terminal window while the server is running, and it will have the same effect as using cURL. If something is not working with cURL, the request module is useful as we can view the error, response, and body.

Sending Requests Through a Web Form

Usually, POST and other HTTP methods that alter the state of the server are sent using HTML forms. In this very simple example, we can create an index.html file anywhere, and make a field for a name and email address. The form's action will point to the resource, in this case http//localhost:3002/users, and we'll specify the method as post.

Create index.html and add the following code to it:

Open this static HTML file in your browser, fill it out, and send it while the server is running in the terminal. You should see the response of User added with ID: 4, and you should be able to view the new list of users.

Conclusion

In this tutorial, we learned how to hook up an Express server to a MySQL database and set up routes that correspond to the GET, POST, PUT, and DELETE methods for paths and dynamic route parameters. We also learned how to send HTTP requests to an API server using cURL, the Node.js request module, and HTML forms.

At this point, you should have a very good understanding of how RESTful APIs work, and you can now create your own full-fledged API in Node.js with Express and MySQL!

National Geographic Sent a Big Message with a Big Apology

And sent a powerful message to those of us in business.

20 Free Creative Resume Templates (Word & PSD Downloads)

Happiness Is Tied to Your Emotional Intelligence. Here Are 3 Traits Happy People Have in Common

Learn what works for you.

Need an Entrepreneurial Boost? The Top 7 Podcasts for Inspiration in Business and Life

Here's what you can learn from some of the world's top business luminaries.

Want Your Team to Be More Creative? Turn On the Music

Music can inspire, motivate, energize, and spark creativity. Why don't more startup founders encourage their team to listen to music?

Why Southwest Has Been Profitable 45 Years in a Row

Why Southwest Has Been Profitable 45 Years in a Row Because they understand that price and cost are unrelated.

I Landed 2 Consecutive Companies on the Inc. 500 List--Without Any Funding. Here's How

The 2018 Inc 500 is an exclusive ranking of the nation's fastest-growing private firms. Here's how a CEO led two consecutive companies onto the list.

Why Cleaning House Can Create a Bigger Mess

Replacing the CEO of a struggling startup is relatively easy. But when the new boss then decides to obliterate existing top management, the troubles seem to multiply.

Want to Be a Better Communicator? Eliminate These Two Words From Your Vocabulary

If you use them at the wrong time, they can rob you of power.

One Industry Absolutely Dominates the List of 25 Highest-Paying Jobs in the U.S.

Success in your professional life helps includes financial success. Leaders in the industry when it comes to money may not be what you expect.

In 5 Words, This Former Netflix Executive Reveals the Key to Employee Motivation

The former Chief Talent Officer of Netflix provides powerful insight into what trulymotivates employees.

Avoid Making a Bad Sales Hire By Reading Resumes This Way...and weed out the un-hireables in a flash

Avoid Making a Bad Sales Hire By Reading Resumes This Way...and weed out the un-hireables in a flash

23 More Exercises to Boost Your Creativity Every Day

Use these 23 exercises to hone your creativity, one of the top 3 skills required for the future of work according to the The World Economic Forum 2016 Future of Jobs study.

This May Be the Best Piece of Email Marketing You'll See This Week (and Maybe Even This Year)

Anyone who opened this email must have been startled.

Pink Stopped a Concert to Console a Grieving 14-Year-Old Girl, and It's a Great Lesson In Leadership

The star performer performed an admirable act of leadership. But the signs aren't always as clear as the one Pink had.

Feeling Stuck in a No-Win Situation? These 4 Steps Will Lead You to What's Next

We've all felt backed into a corner at some point in our lives. Here is the roadmap for moving forward, even when options seem limited.

This University Professor Ate at McDonald's for an Entire Month and She Didn't End Up Supersized

Drexel University professor Nyree Dardarian proved that your diet choices determine your outcome -- even at a fast-food giant like McDonald's.

Fake Warren Buffett's Twitter Feed Is Suddenly Sharing the Secrets to a Fulfilling Life

Warren Buffett may be brilliant, but fake Warren Buffett is an absolute genius.

How to Create Transparent Water Droplets With Gradient Mesh in Adobe Illustrator

Read This List of Books (Suggested by Super-Successful People) to Get Ahead in Business and Life

Instead of wasting your minutes, hours and days coasting by, it's in your life-clock's best interest to strive for continuous self-improvement so you can be the best version of yourself as soon as possible.

What's 1 Top Reason for Employees Quitting Their Jobs? Research Says It Comes Down to 2 Words

It's common sense for every workplace, but not common practice.

This Startup Wants to Help You Give Your Employees up to a $4,000 Raise Without Spending a Penny

It's all down to the magic of using tech to make pre-tax spending super easy.

The Simple Productivity-Boosting Method You're Probably Overlooking

Good sleep is essential for staying productive. Here's how to set yourself up for an optimal night's rest.

From Bug Zappers to Bedding With Zippers, These Utah Companies Are Growing Like Crazy

Virginia is for lovers, but Utah means business.

After Their Own Manufacturer Betrayed Them With a Copycat Product, These Founders Fought Back

Chuck Shirley and Relina DeDios-Shirley had a novel idea for a business. Then a manufacturer became a competitor.

For United Airlines, These 4 Short Words Are Utterly Crucial. (United's President Said Them. But Does He Really Believe Them?)

And if he doesn't believe them, I've got a short poem he really needs to read.

1 in 5 Americans Have No Retirement Savings. Here's Why Not

Another 10 percent have less than $5,000.

5 Amazing Assets for Amazing Autumnal Photos and Video

Here's the Surprising New Thing American Airlines Is Trying to Make Passengers Hate Flying a Little Bit Less

That's the bar now: 'a little bit less horrible.' But we'll take it.

I Sleep Until Noon and Maybe You Should, Too

New research from UC Berkeley shows that night owls should set their own sleep schedules to be more productive.

Monday, August 27, 2018

A Sports Star's Flight Was Very Late. Then He Filmed What Baggage Handlers Did With His Luggage

He laughed. Would you?

The 3 Best Templates for Adobe After Effects to Promote Your App

Trump Struck a Deal With Mexico That Could Reshape or Possibly Replace NAFTA

The deal could majorly impact auto manufacturers.

Is Google's Flagship Retail Store Coming to Chicago?

With so many hardware products to sell, a bricks-and-mortar store just makes sense.

1 Surprising Thing That Leaders' Brains Do Differently, According to Science

The discomfort youfeel when deciding something for others reflects your innate potential to be a leader.

In 1 Sentence John McCain Explains How to Be a Successful Leader

This one sentence shows the high character and morals of the late Senator.

With 1 Quote John McCain Taught 3 Vital Lessons on What It Means to Be a Leader

Regardless of your political views, this man taught us all an important lesson.

Serena Williams's Catsuit Should Make You to Revisit Your Dress Code (Not For the Reason You Think)

You can change your company culture for the better when you let your team wear their 'superhero costumes' to work.

Don't Let Lawsuits Destroy Your Business. Here's How to Stay On Track

Make sure to save time for crucial business operations.

Entrepreneurs Have High Job Satisfaction, and Their Spouses Should Too

Living with purpose allowsboth partners to be happier, healthier, and live longer.

Why Keeping Your Startup Idea to Yourself Is a Horrible Move

A stealth startup is a startup with no feedback.

10 Fun Photo Effects and Look Presets for Photoshop

This Is How Tech Should Be Evolving Your Business Model

You don't adopt new technology just because it's there. You adopt it for all the things it allows you to do.

5 Aspects of a Healthy Team Culture You Can't Afford to Ignore

Hint: it's the stuff your high school counselor always went on about.

27 Things You Need to Know to Start and Scale a Successful Business

This founder learned some of these the hard way so you won't have to.

3 Physiological Tricks That Help New Bosses Earn Respect Faster

Show your employees that you can do the job.

This 1 Type of Content Will Dramatically Increase Traffic to Your Website

Visual content can increase engagement, traffic, backlinks, and conversions--in short, transform your SEO. Here are 5 reasons visual content can help.

Google Flutter From Scratch: Animating Widgets

Entrepreneurs, Make the Most of Your Vacation With These Six Tips

Learn how to actually disconnect if you want to come back energized and ready for new challenges.

From Olympic Diver to Top Tech Executive, This Is the Kind of Leader Every Employee Dreams About

Ralf Jacob, Head of Digital Media Services at Oath (a Verizon-owned company), embodies the very human traits of a servant leader.

What to Expect from Apple's New iPhones--All 3 of Them

The company is expected to unveil the newest iPhones in September.

How to Use 'Negative Motivation' to Accomplish Your Goals

Ever have someone tell you that you can't or shouldn't do something? Follow your heart and do what you know you are capable of.

American Airlines Just Showed Why It's So Different From Southwest (and Not in a Good Way)

It isn't just about the product.

Too Much Focus On Metrics Hinders Your Growth. Do This Instead

Want fast growth? Stop focusing on the metrics and develop your team.

The People in These Industries Have the Best (and Worst) LinkedIn Profile Photos

Just like anywhere online, people do better or worse jobs of curating their online profiles, starting with the first thing others notice--the photo.

Kickstarting a Web Design Using an Image as a Base

5 Ways Solitude Can Make You More Successful, Backed By Science

Set aside 10 minutes a day to be alone with your thoughts and watch what happens.

6 Companies on the Inc. 5000 List That Defy What You Think of High-Growth Companies

It is possible to grow a business fast without venture capital and still put people and profit first.

33 Years Ago the Father Made a Racist Remark. Now Eli Lilly Diabetes Pulled His Son's Sponsorship. Smart Business?

Eli Lilly pulled sponsorship from Conor Daly's car because of a comment his father made -- before Conor was even born. What would you have done?

Facebook Removes 5,000 Ad Filters and Will Soon Start Certifying Advertisers

To prevent discriminatory ads on their network, Facebook removedmisused ad filters and will start training advertiser on avoiding ad discrimination.

5 Creative Content Hacks That Build Brand Loyalty

Here are the do's and don'ts to keep top of mind when building a business with content.

I Don't Want to Hire My Former Employee

...And four other tricky workplace dilemmas.

Get Started With Node.js Express in Our New Course

VC Fred Wilson on Duty, Honor, Country

The late Senator John McCain exemplified these American values.

How to Set Up & Run a Professional Online Webinar

The 10-Minute Daily Meeting That Can Change the Way Your Startup Operates

Most meetings are like Kryptonite to a startup. But not this one.

VC Fred Wilson on Being Public

Elon Musk should accept the challenges as well as the benefits of running a public company.

How to Encourage Every Employee to Speak Up, Share Ideas--and Set Your Organization Up for Success

Use These 5 Techniques to Create A Culture of Dialogue

To Fix Your Toxic Culture, You Must Do 1 Thing: Get A Culture

Toxic, disconnected, or broken cultures aren't the problem. The problem is an absence of culture itself.

Want to Make More Friends? Stop Wearing Fancy Clothes and Wear a Walmart T-Shirt, Research Shows

Stop wearing fancy clothes if you want to make new friends. Research shows high status-markers make you less attractive, not more.

Tom Brady's Opinion on Kneeling for the Anthem Is Pure Emotional Intelligence. You Can Learn From It

Love him or hate him, the football legend gave a legendary response to a tough question.

Want to Anticipate Problems Before They Happen? Use This Planning Strategy

Scenario planning will make your business more agile.

What Leaders Can Learn About Tenacity From One of the NFL's Most Stunning Comebacks

It's easy to stay optimistic and excited about the future when things are going well. But what about when it isn't? Here's how to handle those moments

Marketing to Generation Z? Here's What You Need to Know

Better position your product or service with Generation Z by understanding their values, how they make purchases, and how they differ from Millennials.

Don't Get Stiffed! 7 Ways To Make Sure You're Paid On Time Every Time

Fifty percent of freelancers say they haven't gotten paid by a client at least once (and nearly everyone else has been paid late). Here's how to make sure you're first in line when checks get cut.

This New Research Lab Is Dedicated to Helping Your Workplace Perform Better

It's about to be your go-to for information on creativity, coaching, mental health, motivation and more.

Will These Smart Home Gadgets Change Your Life? Try Them to Find Out

Vivint, Whirlpool, and Rachio (among others) want to make things easier for you at home

Stanford Professor: These 3 Small Actions Make You a Magnet for Attracting Luck

A crash course on creating your own luck in business and life.

Want to Get an Angel Investor's Attention? This Dollar Shave Club Investor's 10 Rules for Pitching Will Do It

Angel investors want to see certain things from the startups they may invest in. This angel investor has 10 pitching rules for you to follow.

The Comeback Story of Mars Wrigley U.S. President Berta de Pablos-Barbier Will Inspire Your Success

If the company you quit is willing to take you back, it can often be a win-win outcome for everyone involved.

Ever Wonder Why Your Favorite Apps Are Starting to Look the Same? It Might a Good Thing.

Now designers can spend more time focusing on what really matters.

How Unconscious Bias Almost Killed My Friend

Diagnosed unconsciously as fat and female, multiple doctors tried to send my seriously ill friend home

Are You a Procrastinator? This Simple 5-Minute Trick Will Completely Change Your Life

"The trailer" will give you the motivation you need, majorly increase your productivity, and help you do the best work of your life.

How One Stylish and Scrappy Startup Designed Its Office in a Single Weekend for $5,000

Beauty runs deep at Modsy's San Francisco headquarters. And it goes beyond the really beautiful wallpaper.

3 Research Findings That Will Make You a Happier Parent

Studies show parenthood can be rough on happiness. They also show it doesn't have to be that way.

Get Ready for the World's Shortest Film Festival

Giphy made a confusing announcement this week. Here's what it meant.

20+ Best Classic Typewriter Fonts With Old (Vintage) Machine Styles

Google Helps Its Managers Create a Team Vision With This Simple 5-Step Formula

Learn how to turn conceptual vision statements into actionable objectives.

How to Create an inFamous Inspired Text Effect in Adobe Photoshop

At 40, He Found Out He Had Parkinson's Disease and Was Fired. Now He Runs a $3.2 Million Company

Bill Evans lost his job at a staffing business after a faulty diagnosis. So he started his own company--and landed Comcast as a client.

The 1 Big Mistake Nearly Every Boss Makes, According to LinkedIn CEO Jeff Weiner

In an interview with CNBC's Adam Bryant, Weiner explains what compassionate leadership really means.

This Family Lost Its Footwear Company in the Iranian Revolution. Now, it Makes 1.2 Million Shoes a Year in Georgia

Iranian heritage, Japanese design, and a made-in-America commitment powered three decades of growth. Now Okabashi is letting its green flag fly.

This Change Can Help You Read Faster and Make Your Writing More Readable. But There's a Catch

New research casts doubt on what's become a standard practice.

Infographic: The Traditional Businesses Acquiring Platform Innovation

There are two approaches to acquiring platform innovation, complementary and disruptive.

Was John McCain a True Leader? Read These 8 Sentences to Know for Sure

He described his ultimate test of leadership. Here's how he fared.

Sunday, August 26, 2018

4 Myths That Could Be Keeping You From The Success You Seek

Clearing these four common business myths from your thinking is a great first step toward business success.

Ditch Those Ping-Pong Tables and Embrace the Real Workplace of the Future

We're finally figuring out the best ways to modernize the workplace. New tech promises to reduce operating costs and increase productivity for businesses of all types and sizes.

Serena Williams Just Proved She Has More Class Than the French Officials Who Banned Her Catsuit

Official says it goes "too far," but offers no specifics.

These 30 Seconds Offer John McCain's Most Poignant Lesson in Leadership

How many leaders would have said or done this?

You May One Day Have to Live Without Wine, Say Some Experts. Here's Why

The purveyors of a bonny doom paint a dark scenario.

How to Create a Back to School Icon in Affinity Designer

How to Make a Great PowerPoint Title Cover Slide - Quickly

3 Ways to Make Anything More Shareable Online

Here's how to create content that will be seen -- and shared -- by more than just your mom.

This is the Astonishing Amount of Time It Takes To Calm Down When You're Angry (According to a Police Organization)

Can this be true?

American Airlines CEO Finally Flew in the Airline's New, Maximum Discomfort Planes. Here's His Review

Many passengers, especially those in Economy Class, will want to know. So here is his verdict.

United Airlines CEO: We Don't Hold Aircraft For Anyone (Well, Except For These People)

Absolutes are hard in the airline world.

Southwest Airlines Is About to Charge a Lot More for Something United and American Give Away for Free

If you're a fan of the Southwest Airlines EarlyBird Check-In perk, get ready to pay a lot more money for it.

How To Hire Friends And Family (Without Ruining Your Relationships and Wrecking Your Business)

If done right, this can be the best decision you make for your business.

19 Wise John McCain Quotes That Will Inspire Your Success and Your Heart

In a time when true heroes in government are an increasingly rare commodity, John McCain was a true hero. Fair winds and following seas.

Saturday, August 25, 2018

United Airlines Just Announced Great News For Business Class Passengers. But Will It Mean More Hell In Economy?

Something, or somebody, has to give. Usually, it's Economy Class passengers.

Papa John's Takes a Knee and Begs For Forgiveness. A Good Strategy or a Little Desperate?

When your brand has become synonymous with your founder's bad words, what do you do?

Mayo Florida Temporarily Changes Name to Miracle Whip, Supposedly Fooling 1,232 Residents

Seriously, did they think it would work?

3 Things You Can Learn From the Most Toxic People in the Office

A little exposure to toxic people can help you learn what to do instead.

This Is the Most Amazing Photo Ever Taken From a Commercial Airplane. Now, a Southwest Passenger Explains How He Did It

It's a truly beautiful photo. (But Alaska Airlines is going to hate this story.)

Five Strategies to Help You Manage Well Without Authority

And Still Influence Your Team Successfully.

These are the 4 Biggest Innovation Challenges We Must Solve Over the Next Decade

Ultimately, it's about humans rather than technology

How to Create a Music Poster Using Bitmap Mode in Photoshop

United Airlines Has a 1 Million Mile Contest. The Entries Are Quite Beautiful (It Ends Tuesday)

Even the most cynical traveler will find this one beautiful and inspiring.

The Most Potent Gen-Z Entrepreneurial Panel Assembled

These kids care about big and small things going on in the world. They are highly motivated to create solutions to the world's problems.

At United Airlines, They're Making a Big Change That Will Save Money. It's Quite Brilliant, In Its Way

Who would have ever thought of this?

8 Things to Do Right After Deciding You Want a Career Switch

Are you part of the staggering 86 percent of workers who are not satisfied with their career? Maybe now is a good time for change.

No, Coffee Is Not a Carcinogen But One Ingredient Can Be Deadly

California probably won't put warning labels on every cup of coffee but maybe they should rethink that decision.

American Airlines Just Made a Truly Surprising Change. (The Reason Why Is Even More Surprising)

You didn't think they were just doing this to make things better, did you?

The Way This Famous Airline Handled a Flight Delay Is a Lesson For United, American and Every U.S. Airline

Why can't U.S. airlines think this way? Because it costs money, perhaps?

Friday, August 24, 2018

Personal Branding Isn't Rocket Science. But, Doing It Wrong Can Cost You a Job at NASA

In one tweet, a young professional learned how personal branding impacts your career.

How to Lead a Successful Business Meeting Over Drinks

Meeting and closing a deal when alcohol is involved doesn't have to mean you have to compromise.

This Successful Young Entrepreneur Has Figured Out and Shares the Secret to Hustle

Hard work isn't enough. To build your company, you need to be scrappy and smart, too.

The Downside of Disruption: Is Your Startup Destined to become a Fad?

What started out as a promising new startup could easily turn into a fleeting fad. Here's what to avoid.

3 Questions That Will Immediately Make You a Better Interviewer

The classic questions like "tell me about a time when..." completely miss the boat for interviewing effectively. These 3 interview questions will change how you hire.

Forget Parental Leave. This Company Is Offering 'Fur-ternity' Leave for New Pet Owners

Nina Hale has found an unusual way to attract and retain millennial employees.

6 Elements of Today's Customer Buying Journey That Can Make or Break Your Business

If you are still focusing on selling, rather than how your customers are buying today, you may be missing some great business potential.

How to Create a Punk-Rock Portrait in Procreate

Amazon Is Paying Twitter 'Ambassadors' to Combat Negative Stories About Working Conditions

When regular workers won't defend you on their own, recruiting a special group isn't the solution.

Skip the Free Snacks - Here's What Your Tech Startup Should Really Be Investing In

You'll run into problems down the road if you under-invest in this area.

Why Preachers, Teachers, And Savvy Businesses Are Turning to Drake and Cardi B As Sources For Relevant Content

This is the kind of content your audience wants to consume.

4 Ways to Make Your Career Futureproof

Dorie Clark discusses how to be productive and build a brand in 2018.

Think the Best Students Skip Going Out to Stay In and Study? New Research Says Think Again

Mastering the life-work balance could begin with perfecting the party-study balance.

Hiring an HR Leader? Look for a Candidate With These 3 Skills

One of the biggest mistakes startups make is overlooking the importance of HR. Hire an HR leader sooner rather than later and look for these key skills.

Amazon Hired People to Defend It From Criticism on Twitter

Their job is to respond to tweets that criticize Amazon's treatment of workers.

Women's Equality Day Is Perfect For Kicking Off Company Diversity Initiatives. Here's How to Get Started

Think of it as an opportunity to have a conversation about women, diversity, and the role they play in your company.

Gmail's New 'Confidential Mode' Is Laughably Insecure and Very Silly

Gmail offers a new security feature for email. It is not that secure at all. Anyone who uses MS Paint can easily copy and paste your message, and compromise the entire system in about ten seconds.

Looking to Build Your Network? Please Avoid This 1 Mistake

People bond over common interests and experiences, not hors d'oeuvres.

Top CEOs Warn Changes to Immigration Policy Will Hurt the U.S. Economy

A group of 60 executives called out policy changes that have caused an increase in H-1B visa denials over the past year.

Facebook Hires a New Chief Marketing Officer to Help Fix Its Image

The company's pick, Antonio Lucio, previously served as CMO at HP, Visa, and Pepsi.

How To Make The Best of The End of Summer

When leaders slow down, so does everyone else. Use these tipsto turn the end of summer intoa productive fall.

What Hundreds of Giant Reptiles Can Teach Us About Business Planning

Things might be bad at your business, but at least you (probably) don't have hundreds of hungry crocodiles to deal with. See how to keep it that way.

Leaning Back is the New Leaning In -- One Expert says All Women Need to do This in the Workplace

Acknowledge that the hyper-competitive, achievement-at-all-costs model of traditional male leadership is at odds with traditional feminine values.

A Beginner's Guide to Drawing 2D Graphics With Two.js

Two.js an API that makes it easy to create 2D shapes with code. Follow along and you'll learn how to create and animate shapes from JavaScript.

Two.js is renderer agnostic, so you can rely on the same API to draw with Canvas, SVG, or WebGL. The library has a lot of methods which can be used to control how different shapes appear on the screen or how they are animated.

Installation

The uncompressed version of the library has a size of around 128 KB, while the compressed version is 50 KB. If you are using the latest version, you can further reduce the size of the library using a custom build.

You can either download the minified version of the library from GitHub or you can link directly to the CDN hosted version. Once you have added the library to your webpage, you can start drawing and animating different shapes or objects.

Creating Basic Shapes

First, you need to tell Two.js about the element on which you want to draw and animate your shapes. You can pass some parameters to the Two constructor to set things up.

Set the type of renderer using the type property. You can specify a value like svg, webgl, canvas, etc. The type is set to svg by default. The width and height of the drawing space can be specified using the width and height parameters. You can also set the drawing space to the full available screen using the fullscreen parameter. When fullscreen is set to true, the values of width and height will be disregarded.

Finally, you can tell Two.js to automatically start an animation with the help of the Boolean autostart parameter.

After passing all the desired parameters to the constructor, you can start drawing lines, rectangles, circles, and ellipses.

You can draw a line using two.makeLine(x1, y1, x2, y2). Here, (x1, y1) are the coordinates of the first end point, and (x2, y2) are the coordinates of the second end point. This function will return a Two.Line object, which can be stored in a variable for further manipulation at a later point.

In a similar manner, you can draw normal and rounded rectangles using two.makeRectangle(x, y, width, height) and two.makeRoundedRectangle(x, y, width, height, radius) respectively. Remember that x and y determine the center of the rectangle, instead of its top left coordinates like many other libraries. The width and height parameters will determine the size of the rectangle. The radius parameter is used to specify the value of the radius for the rounded corner.

You can also render circles and ellipses on a webpage using two.makeCircle(x, y, radius) and two.makeEllipse(x, y, width, height) respectively. Just like the rectangles, the x and y parameters specify the center of the circle or ellipse. Setting the width and height to the same value in the case of an ellipse will render it like a circle.

One useful method in Two.js that you will use frequently is two.makeGroup(objects). You can either pass a list of different objects or pass an array of objects, paths or groups as the parameter to this method. It will also return a Two.Group object.

Manipulating Objects in a Group

After you have created a group, you can manipulate all its children at once using properties that the group makes available to you.

The stroke and fill properties can be used to set the stroke and fill color for all children in a group. They will accept all valid forms in which you can represent a color in CSS. This means that you are free to use RGB, HSL, or hex notation. You can also simply use the name of the color, like orange, red, or blue. Similarly, you can set values for all other properties like linewidth, opacity, miter, and cap. It is possible to remove the fill and stroke from all children in a group using the noFill() and noStroke() methods.

You can also apply other physical transformations like scale, rotation, and translation. These transformations will be applied on individual objects. Adding new objects to a group and removing them is easy with methods like add() and remove().

Defining Gradients and Writing Text

You can define both linear and radial gradients in Two.js. Defining a gradient does not mean that it will be rendered automatically on the screen, but it will be available for you to use when setting the fill or stroke values of various objects.

You can define a linear gradient using two.makeLinearGradient(x1, y1, x2, y2, stops). The values x1 and y1 determine the coordinates of the start of the gradient. Similarly, the values x2 and y2 determine the coordinates of the end of the gradient. The stops parameter is an array of Two.Stop instances. These define the colors of each part of the array and where each color transitions into the next. They can be defined using new Two.Stop(offset, color, opacity), where offset determines the point on the gradient where that particular color has to be fully rendered. The color parameter determines the color of the gradient at the particular point. You can use any valid CSS color representations as its value. Finally, the opacity parameter determines the opacity of the color. The opacity is optional, and it can have any value between 0 and 1.

You can define radial gradients in a similar manner using two.makeRadialGradient(x, y, radius, stops, fx, fy). In this case, the values x and y determine the center of the gradient. The radius parameter specifies how far the gradient should extend. You can also pass an array of stops to this method in order to set the color composition of the gradients. The parameters fx and fy are optional, and they can be used to specify the focal position for the gradient.

Check out some of the types of gradient and their code in the CodePen below.

Remember that the x and y position of the gradients are with respect to the origin of the shape they are trying to fill. For instance, a radial gradient which is supposed to fill a shape from the center will always have x and y set to zero.

Two.js also allows you to write text on the drawing area and update it later according to your needs. This requires the use of the method two.makeText(message, x, y, styles). It might be evident from the name of the parameters that message is the actual text that you want to write. The parameters x and y are the coordinates of the point which will act as the center for writing the text. The styles parameter is an object which can be used to set the values of a large set of properties.

You can use styles to set the values of properties like font family, size, and alignment. You can also specify the value of properties like fill, stroke, opacity, rotation, scale, and translation.

Creating a Two.js Project

After learning about all these methods and properties, it is time to apply them to a project. In this tutorial, I will show you how we can use Two.js to render the first ten elements of the periodic table with electrons rotating around the nucleus. The nucleus will also have some slight movement to improve the visual appeal of our representation.

We begin by defining some variables and functions which will be used later.

The above code stores the coordinates of the center of our window in the variables centerX and centerY. These will be used later to place our atom in the center. The elementNames array contains the names of the first ten elements of the periodic table. The index of each name corresponds to the number of electrons and protons of that element, and it begins with an empty string. The styles object contains properties for styling the text object.

We have also defined a function intRange() to get a random integer value within given extremes.

This creates an instance of Two and defines two radial gradients. The red/black radial gradients will represent protons, and blue/black gradients will represent neutrons.

We have used the intRange() function to place all these neutrons and protons within 20 pixels of each other. The makeCircle() method also sets the radius of these protons and neutrons to 10 pixels. After that, we iterate over nucleusArray and fill each circle with a different gradient alternately.

Placing neutrons and protons inside the nucleus was easy. However, properly placing the electrons at a uniform distance will require a little maths. We use the shellRadius variable to specify the distance of different electron shells from the nucleus. A whole circle covers an angle equal to 2 PI radians. We can place different electrons uniformly by distributing the 2 PI radians between them equally.

The Math.cos() and Math.sin() functions are used to separate the vertical and horizontal components of the position vector of different electrons based on their angle.

This part of the code puts electrons from different shells as well as neutrons and protons in their own separate groups. It also sets the fill colors for all electrons in a specific orbit at once.

This part of the code sets the opacity of individual electrons and protons to zero. It also tells Two.js to rotate the electrons and protons at specific speeds.

The final part of the code allows us to iterate through the elements by clicking the mouse or tapping. To load the next element, we make one more electron and one more proton or neutron visible and update the element name. After clicking on the last element, all the particles are hidden again so we can start over. The visible variable keeps track of the number of atomic particles that are currently visible so that we can show or hide them accordingly.

Try clicking or tapping in the following CodePen demo to see the first ten elements of the periodic table.

Final Thoughts

We began this tutorial with a brief introduction to the Two.js library and how it can be used to draw shapes like rectangles, circles, and ellipses. After that, we discussed how we can group different objects together to manipulate them all at once. We used this ability to group elements to translate and rotate them in synchronization. These tools all came together in our animation of the atoms of the first ten elements in the periodic table.

As you can see, creating animated 2D graphics is very easy using Two.js. The focus of this post was to help you get started quickly, so we only covered the basics. However, you should read the official documentation to learn more about the library!

More China Tariffs? Why Some Business Owners Say Bring Them On

Some U.S. businesses welcome the tit-for-tat trade war between the U.S. and China, even as new tariffs kicked in this week.

Why Entrepreneurs Should Think Like Salespeople

In reality, entrepreneurs are salespeople.

How to Write (Perfectly Tailor) a Resume to a Job Posting

How to Get the Most From the Transport Window in Pro Tools

This Study of 1.2 Million People Reveals the 1 Exercise That Most Improves Overall Mental Health

Physical activity is statistically linked with improved mental health, but these forms of exercise make the biggest impact.

Stop Believing You Have the Same 24 Hours as Beyonce

Sure, the megastar Beyonce works within the same 24 hours, but she doesn't have the same constraints. You've got power, too. Here's how to maximize your time

Hindsight is 20/20: Insights and Growth Hacks from a Self-Described Accidental Entrepreneur

Sure, you'll work 24/7 and never enjoy another totally unplugged vacation, but the freedom to impact society on your own terms is well worth it!

When to Take Your B2B Brand From 'Good Enough' to 'Amazing'

Give your brand the visual upgrade it needs.

Is Money Tight at Your Business? Try Bartering Instead--Here's How

Just because you don't have money doesn't mean you can't get what you need.

What's the Secret Sauce That Turns Skepticism to Success? A New Harvard Study Explains

New research out of Harvard identifies the one thing that transforms skepticism into success. Here are five ways to make sure it happens at your company.

Sitting Near a Multitasker Decreases Your Intelligence By 17 Percent

Research from Stanford and other top universities suggest that multitasking may be damaging our brains.

20 Best Fonts for Making Monograms & Logo Designs in 2018

Delta's CEO Just Offered a Superb Lesson in What It Means to be a Leader Today (the NRA Won't Like It)

Ed Bastian acknowledges that leadership is much harder than it used to be.

How to Achieve Realistic Glow in After Effects With Deep Glow

Southwest Airlines Bans Peanuts (But Your Trained Service Miniature Horse Is OK)

If you fly Southwest Airlines, you are welcome to bring along your emotional support or trained service dog, cat, or miniature horse -- but leave your peanuts at home.

How Evil Are You? Psychologists Have Developed an IQ-Like Test to Measure Your 'Dark Core'

IQ is basically steady no matter how you measure it. Apparently, so is evilness.

4 Elements of a Great Pitch--Thanks to the Female Founder of a $3 Billion Startup

Stitch Fix CEO Katrina Lake has perfected a company overviewthat covers all the elements of a great pitch.

Want to Raise Your Emotional Intelligence? Avoid These 11 Behaviors

Emotional intelligence is integral to a successful, happy life. Unfortunately, it's all too easy to engage in behaviors that hold us back. Here's how to break their hold and move forward with confidence.

How the 90/90 Rule Could Save Tesla

Many young firms, including Tesla, struggle with deadlines. You have to get real about setting production schedules.

How This Couple Combined Their Expertise to Become a Major Contractor for the Government

The couple behind 2M Research broke into government consulting without any experience.

Putting This 1 Thing in Place Can Make Breaking Up With Your Co-Founder Easier

Dissolving a business partnership doesn't have to be an agonizing process.

A Big New Study Says the Least Sexist States Are Among the More Conservative (You Read That Right)

The real joy of this research comes from wondering why the results are as they are.

Steve Jobs Was a Creative Genius. Steve Jobs Was a Total Jerk

An innovative genius. A total jerk. Where's the surprise?

Thursday, August 23, 2018

How One Young Woman Lost Her Dream Job and Learned the Hard Way to Be More Cautious on Twitter

If you use Twitter, don't let this happen to you.

Influencer Marketing: Apple v Samsung, Canon v Nikon, Amazon v Google, and Oculus v Vive

influencers, influencer marketing, marketing, CMO, social media, engagement

This is 1 of the Biggest Mistakes Marketers and Brands Make with their Content

If you want to see serious ROI on your content, you need to refocus on consistency and relevancy--not the next big thing.

Avoid These Top 5 Mistakes With Your Company's Messaging Platform

Every office has a communication platform--and you're probably making these common mistakes while using it.

5 Expert-Approved Habits to Improve Brain Health

We all know that exercise is important for physical health. Here's what you should be doing for optimal brain health.

9 Things You Need To Do If You Want Your Corporate Event To Succeed

events, event planning, corporate events

5 Ways to Boost Your Employees' Morale That Doesn't Involve a Job Promotion

When your employee tells you they're bored, don't panic. Use these 5 strategies to prevent them from quitting.

As This Plane Takes Off, An Engine Catches Fire. Naturally, Passengers Start Filming

If you're a member of cabin crew, you surely have to wonder about human behavior sometimes.

Kroger Just Made a Huge Announcement That Will Have Other Supermarkets Wondering What Happened

It's fascinating to see supermarkets leading the way.

Newsrooms Are Shrinking--Especially After More Recent Layoffs. Use These 4 Strategies to Get Your Story Out Anyway

First, know what your story is. Second, understand that topics are topics, not stories.

How to Make the Most Out of That Work Trip

Though it can sometimes be a pain, traveling for work is a luxury. But sometimes we can forget how to have fun when we've got business and meetings on the brain. Try these tips for getting the most out of your work travels.

3 Unique Challenges Women CEOs Face Today

Female CEOs often have to deal with questions or problems that simply aren't an issue for men.

$3.2 Billion Autonomous Car Startup Zoox Suddenly Fired Its CEO and Won't Explain Why

Tim Kentley-Klay, who co-founded the company, said "the board chose a path of fear" in voting to remove him.

Lyft to Offer Free and Discounted Rides on Election Day

The company wants to help improve voter turnout on November 6.

How to Improve Your Leadership Skills for Different Scenarios

All leaders may have the same goal--to get the best performance out of their teams--but they set out to achieve them very differently.

Code Your First API With Node.js and Express: Set Up the Server

How to Set Up an Express API Server in Node.js

In the previous tutorial, we learned what the REST architecture is, the six guiding constraints of REST, how to understand HTTP request methods and their response codes, and the anatomy of a RESTful API endpoint.

In this tutorial, we'll set up a server for our API to live on. You can build an API with any programming language and server software, but we will use Node.js, which is the back-end implementation of JavaScript, and Express, a popular, minimal framework for Node.

Installation

Our first prerequisite is making sure Node.js and npm are installed globally on the computer. We can test both using the -v flag, which will display the version. Open up your command prompt and type the following.

Your versions may be slightly different than mine, but as long as both are there, we can get started.

Let's create a project directory called express-api and move to it.

Now that we're in our new directory, we can initialize our project with the init command.

This command will prompt you to answer some questions about the project, which you can choose to fill out or not. Once the setup is complete, you'll have a package.json file that looks like this:

Now that we have our package.json, we can install the dependencies required for our project. Fortunately we don't require too many dependencies, just these four listed below.

  • body-parser: Body parsing middleware.
  • express: A minimalist web framework we'll use for our server.
  • mysql: A MySQL driver.
  • request (optional): A simple way to make HTTP calls.

We'll use the install command followed by each dependency to finish setting up our project.

This will create a package-lock.json file and a node_modules directory, and our package.json will be updated to look something like this:

Setting Up an HTTP Server

Before we get started on setting up an Express server, we will quickly set up an HTTP server with Node's built-in http module, to get an idea of how a simple server works.

Create a file called hello-server.js. Load in the http module, set a port number (I chose 3001), and create the server with the createServer() method.

In the introductory REST article, we discussed what requests and responses are with regards to an HTTP server. We're going to set our server to handle a request and display the URL requested on the server side, and display a Hello, server! message to the client on the response side.

Finally, we will tell the server which port to listen on, and display an error if there is one.

Now, we can start our server with node followed by the filename.

You will see this response in the terminal:

To check that the server is actually running, go to http://localhost:3001/ in your browser's address bar. If all is working properly, you should see Hello, server! on the page. In your terminal, you'll also see the URLs that were requested.

If you were to navigate to http://localhost:3001/hello, you would see URL: /hello.

We can also use cURL on our local server, which will show us the exact headers and body that are being returned.

If you close the terminal window at any time, the server will go away.

Now that we have an idea of how the server, request, and response all work together, we can rewrite this in Express, which has an even simpler interface and extended features.

Setting Up an Express Server

We're going to create a new file, app.js, which will be the entry point to our actual project. Just like with the original http server, we'll require a module and set a port to start.

Create an app.js file and put the following code in it.

Now, instead of looking for all requests, we will explicitly state that we are looking for a GET request on the root of the server (/). When / receives a request, we will display the URL requested and the "Hello, Server!" message.

Finally, we'll start the server on port 3002 with the listen() method.

We can start the server with node app.js as we did before, but we can also modify the scripts property in our package.json file to automatically run this specific command.

Now we can use npm start to start the server, and we'll see our server message in the terminal.

If we run a curl -i on the URL, we will see that it is powered by Express now, and there are some additional headers such as Content-Type.

Add Body Parsing Middleware

In order to easily deal with POST and PUT requests to our API, we will add body parsing middleware. This is where our body-parser module comes in. body-parser will extract the entire body of an incoming request and parse it into a JSON object that we can work with.

We'll simply require the module at the top of our file. Add the following require statement to the top of your app.js file.

Then we'll tell our Express app to use body-parser, and look for JSON.

Also, let's change our message to send a JSON object as a response instead of plain text.

Following is our full app.json file as it stands now.

If you send a curl -i to the server, you'll see that the header now returns Content-Type: application/json; charset=utf-8.

Set Up Routes

So far, we only have a GET route to the root (/), but our API should be able to handle all four major HTTP request methods on multiple URLs. We're going to set up a router and make some fake data to display.

Let's create a new directory called routes, and a file within called routes.js. We'll link to it at the top of app.js.

Note that the .js extension is not necessary in the require. Now we'll move our app's GET listener to routes.js. Enter the following code in routes.js.

Finally, export the router so we can use it in our app.js file.

In app.js, replace the app.get() code you had before with a call to routes():

You should now be able to go to http://localhost:3002 and see the same thing as before. (Don't forget to restart the server!)

Once that is all set up and working properly, we'll serve some JSON data with another route. We'll just use fake data for now, since our database is not yet set up.

Let's create a users variable in routes.js, with some fake user data in JSON format.

We'll add another GET route to our router, /users, and send the user data through.

After restarting the server, you can now navigate to http://localhost:3002/users and see all our data displayed.

Note: If you do not have a JSON viewer extension on your browser, I highly recommend you download one, such as JSONView for Chrome. This will make the data much easier to read!

Visit our GitHub Repo to see the completed code for this post and compare it to your own.

Conclusion

In this tutorial, we learned how to set up a built-in HTTP server and an Express server in node, route requests and URLs, and consume JSON data with get requests. 

In the final installment of the RESTful API series, we will hook up our Express server to MySQL to create, view, update, and delete users in a database, finalizing our API's functionality.