teleren/devto huggingface dataset:
A Time without a Zone
Tags: communication, learninpublic
Published: 2020-02-28 22:32:33

Here is a story. Some friends and I just agreed to meet for coffee tomorrow at 8am. Even if one of us is running a bit early or a bit late, I expect that we'll all show up to the coffee shop right around 8am central time. This is a reasonable assumption. We all live in Chicago and people who live in Chicago tend to talk about time from the perspective of the Central (CST or CDT) time zone.

Here is another story. I scheduled a phone call with a prospective client over email. We agreed to talk at 9am. However, when I called this person at 9am, they seemed a bit caught off guard. And for good reason, from their perspective it was 7am. I thought we were talking 9am CST and they thought we were talking 9am PST. Two hours is quite a difference, especially at 7am PST.

I'll take the blame here. I suggested a time without including the time zone that I was thinking. And I'm kinda surprised I did. I nearly always include my time zone when emailing or messaging about times. This time I made an assumption and I came up quite wrong.

I'm taking this opportunity to remind myself, and you, to always include time zones.

We can take this a step further by proactively communicating about a number of expectations and assumptions we have around time. From the start, we should lay out what time zone we are working from and inquire the same from everyone else.  We should also talk about availability. Instead of assuming everyone operates the same between 9 and 5, find out if there are times of day and days of the week that work best for each person. As a bonus, be clear about how much time you are asking of a person in a call. If you want to talk for 30 minutes, be explicit about it ahead of time and then stick to it.

Once you have these things figured out, you can use a tool like [Every Time Zone](https://everytimezone.com/) to find time slots that make sense for everyone.

Time is relative, make sure everyone is talking about the same thing.
Productivity Pixel - Automate everything
Published: 2020-02-28 22:28:18

## 1 - CI/CD tools

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2s63bk2ydnaus33xnc9n.jpg)

GitLab CI, GitHub Actions, Travis CI, Circle CI… you name it! Take advantage of these amazing tools to automate your workflow.

## 2 - Command Line

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vij9xslqik4gjswhbepq.jpg)

Often overlooked, the command line is also an amazing tool. You can write small apps or scripts to automate part of your workflow or even the whole thing!

## 3 - Slack

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mwss7q6lt3wvan850zto.jpg)

“ChatOps” are all the rage these days, and for a good reason: it’s convenient and easy to share with your team.

## 4 - Pub/Sub & Cloud Functions

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8bsimle1f0luy68dyxae.jpg)

This combo requires a bit more work, but leveraging a Pub/Sub topic with a few Cloud Functions can do wonders!

---

You can also find these pixels on my Instagram: https://instagram.com/valentinprgnd. I will publish Pixels every Monday, Wednesday, and Friday about career development in tech, code, mental health and health for developers. Follow me for more tips @valentinprngd and check out my podcast https://rebased.whatdafox.com.
GitHub Actions Mini Tutorial - Only Deploy Master
Tags: github, githubactions, ciyml, cicd
Published: 2020-02-28 22:14:48

---
title: GitHub Actions Mini Tutorial - Only Deploy Master
published: true
description: How to only deploy your master branch on GitHub actions.
tags: github, github actions, ci.yml, CICD
---

I thought id share a little info on how to have a conditional statement for your actions that ONLY executes if you are on master.

Firstly, only run on pushes to master, and PRs to master.

```yaml
on:
  # Trigger the workflow on push or pull request for master only.
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
```

Then finally, in any action:

```yaml
    # Upload to S3
    - name: sync s3
      # Do not deploy anything other than master
      if: github.ref == 'refs/heads/master'    
      uses: jakejarvis/s3-sync-action@master
      with:
        args: --acl public-read --follow-symlinks --delete
      env:
        AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: 'us-east-1'
        SOURCE_DIR: 'dist'
```

The key above being: `if: github.ref == 'refs/heads/master'    `

Personally I wish they would make the branch name an env variable to make this much cleaner but Actions are still new.

Happy deploying!
Introducing Optimism: realtime remote form validation for Rails
Tags: rails, ruby, websockets, showdev
Published: 2020-02-28 22:09:41

---
title: Introducing Optimism: realtime remote form validation for Rails
published: true
description: The missing drop-in solution for realtime remote form validation in Rails.
tags: rails, ruby, websockets
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/u9etpo0o67jyim89hr14.jpg
---

I'm proud to announce the public release of [Optimism](https://github.com/leastbad/optimism), a new Ruby on Rails gem that makes it easy to add realtime validation error messages to your applications.

When a model validation error prevents an update from succeeding, Optimism builds a list of issues that must be resolved. This list is broadcast to the browser over a websocket connection, and the live document is changed to show the necessary validation hints. No page refreshes are required and the entire process happens faster than you can blink.

Optimism injects text content, CSS class updates and even DOM events into your page. It has no client-side scripting requirements beyond a dependency to the awesome [CableReady](https://cableready.stimulusreflex.com/) library. It automatically handles multi-level nested forms and plays well with other technologies, such as Turbolinks.

You can [try a live demo](https://optimism-demo.herokuapp.com) right now.

Full documentation is available [here](https://optimism.leastbad.com). The project lives on Github [here](https://github.com/leastbad/optimism) and you can get help via Discord [here](https://discord.gg/wKzsAYJ).

{% youtube dAP3unTl1f4 %}
Stream Flutter: Building a Social Network with Flutter (Series)
Tags: flutter, tutorial, chat, sdk
Published: 2020-02-28 21:54:54

In this post, we'll be creating a simple social network, called Stream Flutter, that allows a user to post messages to followers.

The app will allow a user to post a message to their followers and chat with them. Stream's [Activity Feed API](https://getstream.io/activity-feeds/) and [Chat API](https://getstream.io/chat) combined with Google's [Flutter](https://flutter.dev/) makes it straightforward to build this sort of complex interaction. All source code for this application is available on [GitHub](https://github.com/nparsons08/stream-flutter). This application is fully functional on both iOS and Android.

For brevity, when we need to drop down to native code, we'll only focus on Android. You can find the corresponding iOS code to see how things are implemented.

Part 3 contains the final product. If you'd like to skip the tutorials and see the end result, please see the `README.md` in the `backend` and `frontend` directories in the [GitHub repo](https://github.com/nparsons08/stream-flutter).

You can find each part of this series for the posts in the links below:

- [Part 1 - Activity Feeds](https://getstream.io/blog/stream-flutter-building-a-social-network-with-flutter-activity-feeds/)
- [Part 2 - Messaging](https://getstream.io/blog/stream-flutter-building-a-social-network-with-flutter-direct-messaging/)
- [Part 3 - Group Channels](https://getstream.io/blog/stream-flutter-building-a-social-network-with-flutter-group-channels/)

> In addition to the tutorials above, Stream offers a comprehensive [Flutter SDK Tutorial](https://getstream.io/chat/flutter/tutorial/) so you can see how to get up and running quickly with Flutter.
Laravel 7: Customize stubs
Tags: laravel, php, webdev
Published: 2020-02-28 21:53:52

In Laravel 7, you will be able to customize stubs.

##Publishing stubs
In order to customize stub files, you need to publish them:

`php artisan stub:publish`

After running this command, a new directory will be added in your project. 

![stubs-directory](https://dev-to-uploads.s3.amazonaws.com/i/x6xclgbxohu5daoll5t6.png)

Let's have a look at most commonly used `php artisan make:controller` command stub file `controller.plain.stub`
```
<?php

namespace {{ namespace }};

use {{ rootNamespace }}Http\Controllers\Controller;
use Illuminate\Http\Request;

class {{ class }} extends Controller
{
    //
}
```

You can make any kind of changes to this stub file.

##Example
Let's say we want every controller to have an `__invoke()` function.
```
<?php

namespace {{ namespace }};

use {{ rootNamespace }}Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Foundation\Inspiring;

class {{ class }} extends Controller
{
    public function __invoke()
    {
        
    }
}
```
Now let's make a controller:

`php artisan make:controller StubsTestController`

Output:
```php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class StubsTestController extends Controller
{
    public function __invoke()
    {
        
    }
}
```

Happy Stubbing 👨🏽‍💻☝🏽

Let me know in comments how this can help you 🤓
One of the dark sides of open source software 
Tags: javascript, opensource, node
Published: 2020-02-28 21:32:33


This time I will tell you about a bookstore which is one of the most used in the world of web development called **Terser**.


The programmers of this library have created a new repository with an attractive logo and that has 90% of the old code, but why is the code of such poor quality?.


**Note**: I am not going to focus this time on talking about a security problems, only i focused on speak about code quality problems.


This library has a method that contains **208** lines of code with a cyclomatic complexity of **76**. It is obviously a huge bloater smell, it has 46 if, 4 else, several nested if, variables that perform hoisting, 2 throw statements, mutates the values of some variables multiple times, including those of the input parameters, it returns two totally different values, all that within a try catch block, this library is undermined by this type of problem in all of his code.

This is just an example, much of the open source code that me, you and you great company use every day, is undermined by all kinds of code smells and design problems.

This library for those who do not know is the successor of UglifyJS, has 9,310,994 weekly downloads, I guess the developers, probably see these problems, but decided not to do **Yak shaving**, but well I think nobody wanted to refactor that for obvious reasons.

Those who want to see the specific method here i leave the link:


[Terser smell code](https://github.com/terser/terser/blob/9e2ff84d05eaa25ca63197fe5e2622f0b397a72e/lib/minify.js#L66)


Conclusión: 


* This is a library that is used in the development environments, 
the impact that this problem can cause, will only affect the processing times, 
but what would happen if it were a library that is used in productive environments, what impact would it have?.

* If someone wants to collaborate or improve aspects of this library, they will find a code very difficult to understand, test and maintain.

* Should be a law that every programmer must understand and know how create clean code o or understand about refactoring, and obviously the basic principles of software design.

* Although it is ghost and unpaid work, it does not have to be of poor quality, remember that this represents what type of programmer you are.


Leave me your comment, and tell me, you use libraries without first reviewing the  code, are you guided by his reputation, or maybe for the many stars they have on github?.


Maybe in my next articles write more in depth of other problems of the open source code.



Greetings to all!
Making a Script for Keypad Activated Door
Tags: raspberrypi, arduino, hardware, watercooler
Published: 2020-02-28 20:39:45

---
title: Making a Script for Keypad Activated Door
published: true
description: How hard would it be to make a script for a keypad activated door?
tags: #raspberrypi #arduino #hardware #watercooler
---

<p>How difficult would it be to make a script for a keypad activated door? A friend of mine wants to make a door that sounds like it's depressurizing as it slides open. Would this need Raspberry Pi or Arduino? My friend just wants to see if this sounds difficult it could be. Any feedback or advice is appreciated.</p>
Building XD Plugins: A Designer’s Journey in JavaScript
Published: 2020-02-28 20:26:52

I wanted to share this story about  Creative Cloud community member Valentin de Bruyn. He works as Lead designer at Etamin Studio in Clermont-Ferrand, France. 

He recently taught himself JavaScript to publish his first plugin for Adobe XD.

We’d like to highlight his experience building out the “Fit to Artboard” plugin to illustrate something amazing about the Creative Cloud community. APIs used for finding solutions to problems through code aren’t just for Computer Science majors or experienced developers. 

Creative professionals can also learn how to create plugins that solve their needs, even sometimes leading to publishing a plugin on the Plugin Manager for others to use in their work.

Seeing others learn how to create a plugin and then launch it is something we are happy to highlight for others getting familiar with Adobe XD and the Adobe APIs!

https://medium.com/adobetech/building-xd-plugins-a-designers-story-108f1dd4dc76?source=friends_link&sk=0b8367ed84f1aaa7e1af1b0fb78b5f0b
How to Add New Fields to Existing Sequelize Migration
Tags: sequelize, migrations
Published: 2020-02-28 20:13:58


Sometimes you realize that you need to add some new fields to an existing sequelize migrations. This is especially important for production apps where refreshing the migration is not an option. Below is a quick guide on how to implement it.

Let's assume you want to add some new fields to `Users` table; below are the steps.

## Step 1 - Create a new migration

```
npx sequelize-cli migration:create --name modify_users_add_new_fields
```

## Step 2 - Edit the migrations to suit the need

```js
module.exports = {
  up(queryInterface, Sequelize) {
    return Promise.all([
      queryInterface.addColumn(
        'Users', // table name
        'twitter', // new field name
        {
          type: Sequelize.STRING,
          allowNull: true,
        },
      ),
      queryInterface.addColumn(
        'Users',
        'linkedin',
        {
          type: Sequelize.STRING,
          allowNull: true,
        },
      ),
      queryInterface.addColumn(
        'Users',
        'bio',
        {
          type: Sequelize.TEXT,
          allowNull: true,
        },
      ),
    ]);
  },

  down(queryInterface, Sequelize) {
    // logic for reverting the changes
    return Promise.all([
      queryInterface.removeColumn('Users', 'linkedin'),
      queryInterface.removeColumn('Users', 'twitter'),
      queryInterface.removeColumn('Users', 'bio'),
    ]);
  },
};
```

## Step 3 - Update the model with the new fields

## Step 4 - Run migration

```
npx sequelize-cli db:migrate

```

That is it, you have successfully added new fields to an existing migration.
Differences between TCP and UDP
Tags: webdev, beginners, showdev, codenewbie
Published: 2020-02-28 20:13:30

TCP: Transmission Control Protocol(TCP) is a connection-oriented protocol that computers use to communicate over the internet
UDP: User Datagram Protocol(UDP) is a connectionless protocol that works like TCP, but for UDP error-checking and recovery services are not required.UDP sends datagrams to the recipient whether they receive them or not
TCP is connection-oriented protocol that establish a connection before starting the communication but UDP is connection less protocol from UDP Data is transferred in one direction from source to destination without checking that destination is still there or not.
TCP checks whether message is received or not and sends again if an error occurs but for UDP does not guarantees a messages delivery.
Ordering: TCP does ordering and sequencing to guarantee that packets sent from a server will be delivered to receiver in same sequence,but for the UDP sends packets in any order.
Speed: TCP is slower than UDP cause it has a lot more to do.TCP has to establish and guarantee that files are received in the order they were sent.
TCP USE: HTTP,HTTPS,SSH,FTP,SMTP,POP
UDP USE: Streaming videos, online games,Live Broadcasts,TFTP
Get started with deep learning, a 5-part online master class
Tags: machinelearning, deeplearning, ibmcloud, webinar
Published: 2020-03-02 18:33:24

---
title: Get started with deep learning, a 5-part online master class
published: true
date: 2020-02-28 20:12:29 UTC
tags: Machine Learning,Deep Learning, IBM Cloud, webinar
canonical_url: https://maxkatz.org/2020/02/28/get-started-with-deep-learning-a-5-part-online-master-class/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9sc3ohko86jihvhqfcjt.png
---

Machine Learning Engineer [Lavanya](https://twitter.com/lavanyaai) and IBM Developer Advocate [Upkar Lidder](https://twitter.com/lidderupk) joined together to host a 5-part educational online series on deep learning. Some of the sessions already happened but no worries as you can watch the recordings (links below).

This series takes engineers from zero to expert in machine learning in 5 sessions. The world needs more people who understand machine learning, and our goal is to get you started on that path as efficiently as possible. While there are plenty of online resources, we know it’s tough to learn a technical topic without a teacher. This workshop will arm you with the tools to get started using machine learning in your day job, and the resources to find additional help if you want to go deeper.

**Deep Learning Master Class I – Introduction**  
January 30, 2020 – 9:30am PT   
[Watch the recording](https://www.crowdcast.io/e/deep-learning-master)

**Deep Learning Master Class II – Computer Vision**  
February 6, 2020 – 9:30am PT   
[Watch the recording](https://www.crowdcast.io/e/deep-learning-master-2)

**Deep Learning Master Class II – Model Performance, Quantization, & Hyperparameter Search**  
February 13, 2020 – 9:30am PT   
[Watch the recording](https://www.crowdcast.io/e/dl-master-class-iii--)

**Deep Learning Master Class II – Intro to RNNs, LSTMs, and GRUs**  
March 20, 2020 – 9:30am PT   
[Register](https://www.crowdcast.io/e/deep-learning-master-3)

**Deep Learning Master Class II – Advanced RNNs, LSTMs, and GRUs**  
March 27, 2020 – 9:30am PT   
[Register](https://www.crowdcast.io/e/deep-learning-master-4/)
Zoomed images on iOS
Published: 2020-08-17 15:11:06

---
title: Zoomed images on iOS
published: false
date: 2020-02-28 20:02:03 UTC
tags: 
canonical_url: https://tomandrews.co.uk/blog/2020-02-28-ios-zoomed-images/
published: true
---

I’ve been working on a wedding website for my upcoming wedding to my amazing fiancé Elina in August.The website is intended to be a place where we can share the details and the guests can RSVP easily. Not flying to far away fromthe current design trends we have made quite heavy use of parallax scroll. However it has been a fewyears since I’ve done this and I can see now you can do simple and even some more complex parallaxscrolling in pure CSS instead of JS listening to scroll events which unless you are careful can getjanky quite quickly.

Everything was going smoothly. I picked up [Sizzy](https://sizzy.co/) which is really amazing forseeing your site at multiple resolutions very easily. Now everything is done - the parallax is all niceand smooth even with a throttled CPU in dev tools. I push it to a PR and the [netlify](https://netlify.com) preview loads.I confidently send the link to Elina and she goes

> Uh… what is with the images? Are they meant to look like this?

I load it up on my phone and see they do look crap - they are zoomed in awfully.

[![Blurry images](https://tomandrews.co.uk/static/91f821f449de3f8b68880f578bc82828/1c72d/blurry-images.jpg "Blurry images")](/static/91f821f449de3f8b68880f578bc82828/1c72d/blurry-images.jpg)

I do think fire safety is important but I’m not sure it should be the first thingpeople can _kind of_ read on a wedding invitation website. That’s just not good UX. 💩

So 10 minutes of googling later I find out that [iOS have issues with](https://caniuse.com/#search=background-attachment) `background-attachment: fixed` in combination with `background-size: cover`. Which is a little annoying but I guess this is what web development is all about.

So I decided to drop it on iOS and then once they have fixed the issue we can re-enable it.

The quick fix to disable it was this:

```
@supports (-webkit-touch-callout: none) {
  background-attachment: initial;
}
```

This media query targets only mobile safari devices and sets the `background-attachment` as if none was set. This fixed the issue and now the wedding website can go out and collect RSVPs whilst Elina and I go back to debating more important things for the wedding.
Programming first principles - 5. Premise - We must understand what we're doing
Tags: programming, webdev, learning, development
Published: 2020-02-28 19:41:51

This post ([Programming first principles - 5. Premise - We must understand what we're doing](https://www.sargalias.com/blog/programming-first-principles-premise-we-must-understand-what-were-doing/)) was originally published on [Sargalias](https://www.sargalias.com).

Our next premise is that we must understand what we're doing when programming.

This is also mentioned in the book [The Pragmatic Programmer](https://pragprog.com/book/tpp20/the-pragmatic-programmer-20th-anniversary-edition). It's the tip "don't program by coincidence".

## We must understand what we're doing

It means that we must program deliberately.

We should not be "trying things out" until we get something that _seems_ to work.

## Why must we understand?

From the definition of software, our requirement is to produce a system of code that works as intended.

As we build systems we need to understand what we're doing, because we're the ones doing it and building the system.

If we don't understand what we're doing, then it follows that we're programming by coincidence.

Therefore we are unaware of whether we're doing the wrong thing or creating something useful out of absolute luck.

This is a slope.

At first we're only missing a small bit of understanding and have faith that things will work. We do some manual testing and see that things are working and we're satisfied. When the project is small, it's easy to verify things work using manual testing.

As the system grows bigger, there is a higher chance of error, missing something crucial and breaking something unrelated.

This goes against our requirement that we must create a working system.

However, if we understand what we're doing, it means we have the highest possible confidence that our code works as intended and does not break anything.

This is the closest we can get to fulfilling our requirement.

Therefore, ideally we should understand what we're doing at all times.

Here's an alternative way of looking at it.

Deliberate approach: "To the best of my ability, I am confident the code works as intended and that I didn't break anything."

Luck approach: "I randomly tried some stuff until the new feature seemed to work. Did I break anything? I have absolutely no clue, but I didn't find anything in my little manual testing."

Which one provides more confidence that the code works as intended and nothing was broken? Obviously the deliberate approach.

Therefore understanding what we're doing is more likely to fulfill our requirement that our software works as intended.

Therefore, ideally we should understand what we're doing at all times.