Empathy: the Cornerstone of Your Company Culture

Hard skills change constantly. Every year, developers must level up their skills to keep pace with the ever-changing landscape that is hardware and software. Technology moves so fast many of us have to upgrade our wearables and handheld devices every 18 months—and sometimes sooner. Having a good base of knowledge—or, at least, knowing how to learn new concepts quickly—will always be the number one job requirement of any position you as a developer will hold.

There’s another skill, though, that will always serve you well, and that skill is empathy. As mentioned above, hard skills are always evolving. Soft skills will always remain the same, and they’ll always be important. Empathy, then, is going to be the cornerstone of culture because it requires of you a few things. You and your team members must be open to people different from you; you must resist the urge to rush processes; and, you must devote more energy to hearing your coworkers when they are speaking.

True empathy is inclusive. It’s so inclusive, in fact, it is impossible for any divisiveness to grow. Empathy is inclusive because it promotes conversation over silence, and it encourages understanding over willful ignorance. Inclusion is important on tech teams because it allows for different viewpoints, something that can, unfortunately, be relatively rare in an industry with little diversity.

When you make empathy the cornerstone of your culture, you will attract people from varying walks of life. The more diverse your team is, the more unique ideas you’ll come up with collectively. Being an inclusive company also means you’ll make decisions that will embrace the needs of different types of people. As a result, you’ll appeal to a wider array customers. Being inclusive internally means being empathetic both in the office and out of it.

True empathy is patient. How many times have you been annoyed when someone needed a further explanation on a concept you’ve already explained? Maybe you hate talking to the marketing staff because they always ask so many questions. Whatever the situation is, it’s very difficult to slow down. Waiting is actually against what we’ve become accustomed to. We barely have the patience to wait for a text message, and we have zero for a bad Wi-Fi connection.

When it comes to dealing with humans, however, patience is key. Allow your coworkers to do tasks at their own pace without insult or pressure. When you give them the space they need to work through their process, they will, in turn, be more patient with you. This may seem to be at odds with productivity, but in actuality patience fosters productivity. No one will be made to feel slow or incompetent. Therefore, everyone will work smarter.

True empathy puts the emphasis on listening. This is the biggest point here. Empathetic people aren’t just people that go out of their way to like everyone. They might not be the first person to rush to give you a hug or tell you their life story. They will though go out of their way to listen to what you have to say. Listening is imperative to empathy because it tells us—the listener/empathizer—how to approach any and every situation.

Herein lies the value of empathy at work. Empathy in your company culture means your employees will be more invested in listening to their coworkers. They’ll be patient in every situation, and diversity will no longer be just an initiative but a way of life. All of this will result in a more collaborative culture, and collaboration always drives the bottom line.

Source: Laravel News

Testing File Uploads With Laravel

Laravel now includes a new system for testing file uploads through two new fake methods, one on the UploadFile class and another on the Storage facade.

As the documentation shows here is a full test showing it in use:

<?php

namespace TestsFeature;

use TestsTestCase;
use IlluminateHttpUploadedFile;
use IlluminateSupportFacadesStorage;
use IlluminateFoundationTestingWithoutMiddleware;
use IlluminateFoundationTestingDatabaseMigrations;
use IlluminateFoundationTestingDatabaseTransactions;

class ExampleTest extends TestCase
{
    public function testAvatarUpload()
    {
        Storage::fake('avatars');

        $response = $this->json('POST', '/avatar', [
            'avatar' => UploadedFile::fake()->image('avatar.jpg')
        ]);

        // Assert the file was stored...
        Storage::disk('avatars')->assertExists('avatar.jpg');

        // Assert a file does not exist...
        Storage::disk('avatars')->assertMissing('missing.jpg');
    }
}

You can also customize the files width, height, and size for testing validation:

UploadedFile::fake()->image('avatar.jpg', $width, $height)->size(100);

Or create other types of files like PDF’s:

UploadedFile::fake()->create('document.pdf', $sizeInKilobytes);

This feature is in the latest Laravel release and you can find out more details in the official documentation.

Source: Laravel News

Amazon releases a summary of the recent S3 outage

Amazon released a summary of the S3 Service Disruption on US-EAST-1 yesterday. The outage affected many sites, apps, and utilities that rely on the service.

An S3 team member running an established playbook to remove a small number of servers accidently entered a command wrong and a larger set of servers was removed.

The servers that were inadvertently removed supported two other S3 subsystems. One of these subsystems, the index subsystem, manages the metadata and location information of all S3 objects in the region. This subsystem is necessary to serve all GET, LIST, PUT, and DELETE requests. The second subsystem, the placement subsystem, manages allocation of new storage and requires the index subsystem to be functioning properly to correctly operate. The placement subsystem is used during PUT requests to allocate storage for new objects. Removing a significant portion of the capacity caused each of these systems to require a full restart. While these were being restarted, S3 was unable to service requests. Other AWS services in the US-EAST-1 Region that rely on S3 for storage, including the S3 console, Amazon Elastic Compute Cloud (EC2) new instance launches, Amazon Elastic Block Store (EBS) volumes (when data was needed from a S3 snapshot), and AWS Lambda were also impacted while the S3 APIs were unavailable.

They go on to say that because of the massive growth over the last several years the process of restarting these services and running the necessary safety checks to validate the integrity of the metadata took longer than expected.

Finally, because the status board relied on S3 they were unable to update the status icons and had to rely on Twitter and the note at the top.

Source: Laravel News

Laravel Countries and Currencies Package

Antonio Carlos Ribeiro recently launched a new package that gives you a powerful setup for dealing with the different Countries of the world, all through a comfortable Laravel syntax using Collections.

The package does a lot. Everything from geology and topology, to states, currencies, and time zones.

As I was reviewing it I tried to think of some common use cases that almost every app needs and here are a few examples:

Generate a list of Countries

Need a list of all the countries in the world? It’s as simple as calling:

Countries::all()->pluck('name.common');
[
    "Aruba",
    "Afghanistan",
    "Angola",
    "Anguilla",
    "Åland Islands",
    ....

Generate a list of States

In a lot of registration forms, you need to allow people to pick their state.

Countries::where('name.common', 'United States')
    ->first()
    ->states
    ->sortBy('name')
    ->pluck('name', 'postal')

This gives you a result of the states that can then be used in a select list:

{
    "AL": "Alabama",
    "AK": "Alaska",
    "AZ": "Arizona",
    "AR": "Arkansas",
    "CA": "California",
    ....

Get the timezone for a State

Another typical pattern is figuring out a timezone. If you already have the users country and state it’s now super easy:

return Countries::where('name.common', 'United States')->first()->timezone->NC;

Returns:

America/New_York

Get a countries currency

Need to get information on a specific countries currency? With this package it’s very easy:

Countries::where('name.common', 'United States')->first()->currency;

Which returns:

[{
    "alternativeSigns": [],
    "ISO4217Code": "USD",
    "ISO4217Number": "840",
    "sign": "$",
    "subunits": 100,
    "title": "U.S. dollar",
    ....

These examples are just the basics of what can be done. It supports the following countries, states, and currencies:

  • Countries
    • name (common and native)
    • currency
    • languages
    • states
    • timezone
    • flags (sprites, flag icons, svg)
    • tld
    • multiple ISO codes
    • calling code
    • capital
    • alternate spellings
    • region & sub region
    • translations (country name translated to some other languages)
    • latitude and logitude
    • borders (countries) – you can hydrate those borders (like relatioships)
    • area
    • topology
    • geometry
  • Currencies
    • sign
    • ISO codes
    • title
    • subunits
    • usage (dates)
  • States
    • adm codes
    • name & alt name
    • type (state, city, province, canton, department, district, etc.)
    • latitude & longitude
    • language
    • (and many more)

For more information on this package check out the GitHub repo.

Source: Laravel News

Extract CSS to a Dedicated File

It’s very possible that you don’t want to inline all of your CSS into the page, using style-loader. Instead, let’s review the ExtractTextWebpackPlugin, which allows Webpack to extract your CSS to a dedicated, traditional stylesheet.
Source: Laracasts

Sass Compilation

You’ll likely want to use some form of CSS preprocessor in your workflow. In this lesson, I’ll demonstrate how to compile Sass, as part of your Webpack build. It’s easy!
Source: Laracasts

Laracon Online Schedule Announced

Laracon Online has just announced the event schedule for the conference that will be held on March 8th. All times are in EST:

  • 8:00am – Mingle in Slack
  • 8:45am – Opening remarks
  • 9:00am – Jeffrey Way
  • 10:00am – Evan You
  • 11:00am – Break & Mingle in Slack
  • 11:15am – Rachel Andrew
  • 12:15pm – Adam Wathan
  • 1:15pm – Break & Mingle in Slack
  • 1:30pm – Taylor Otwell
  • 2:30pm – Nick Canzoneri
  • 3:30pm – Break & Mingle in Slack
  • 3:45pm – Jason McCreary
  • 4:45pm – Matt Stauffer
  • 5:45pm – Closing remarks
  • 6:00pm – Mingle in Slack

With almost 3,500 tickets sold this will be the biggest Laracon ever, and you can still purchase your tickets. Even if you can’t make the event with a ticket purchase you’ll get the videos after the conference ends.

Source: Laravel News

Laravel Include When Directive

A new feature in Laravel Blade is an includeWhen directive. This allows you to simplify a typical if statement into a single line.

“I think it’s a cool feature as it tidies up so much boilerplate”, said James Brooks, the author of the pull request.

To see this feature in use pretend you have this common setup:

@if(Auth::user())
    @include('nav.user')
@endif

Now, this can be simplified using includeWhen:

@includeWhen(Auth::user(), 'nav.user')

Or as another example for those using Laravel’s Authorization system:

@if ($user->ownsPost($post)
     @include('posts.edit-controls', ['post' => $post])
@endif

Can be changed to the following:

@includeWhen($user->ownsPost($post), 'posts.edit-controls', ['post' => $post])

This feature is now included in Laravel and you can run a composer update to be sure you are on the latest release. For more Blade features check out the Laravel Blade category here on Laravel News.

Source: Laravel News

Minification and Environments

In this episode, we’ll learn how to minify our JavaScript with Webpack and Uglify. However, in the process, we’ll also need to review environments. Often, you’ll want to use one set of configuration for development, and another set for production. I’ll show you how.
Source: Laracasts

Laravel Forge API

Laravel Forge just announced it’s first official API that allows you to create and interact with your servers and sites.

This was a highly requested feature and the API includes support for all the features Forge provides including Servers, Services, Daemons, Firewall Rules, Sites, SSL, and more.

To get started login to your Forge account and from your account, you can generate your API token:

After you have your token, you can then start making requests with the bearer token:

Authorization: Bearer API_TOKEN_HERE

If you are using Guzzle here is an example:

$client->request('GET', '/api/v1/servers', [
    'headers' => ['Authorization' => 'Bearer '.$forgeApiToken]
]);

Check out the Forge API documentation for all the details.

Source: Laravel News

1 2 3 49