teleren/devto huggingface dataset:
TIL: Chaining 'let' and 'const' Statements Using Commas
Tags: javascript
Published: 2019-05-01 16:16:51

---
title: TIL: Chaining 'let' and 'const' Statements Using Commas
published: true
description: I always get excited when I discover stuff like this.
tags: JavaScript
---

It's now pretty obvious to me that a feature like this would be possible, but it's one of those things that you don't think about until you see it for the first time. I'm working on a Blackjack game as part of a Pluralsight tutorial and I just saw the instructor chain together multiple `let` and `const` statements using commas.

```javascript
const suits = ['Hearts', 'Clubs', 'Diamonds', 'Spades'],
  values = ['Ace', 'King', 'Queen', 'Jack', 'Ten', 'Nine', 'Eight', 'Seven', 'Six', 'Five', 'Four', 'Three', 'Two'];

let textArea = document.getElementById('text-area'),
  newGameButton = document.getElementById('new-game-button'),
  hitButton = document.getElementById('hit-button'),
  stayButton = document.getElementById('stay-button');
```

It's a pretty minor change to my coding practice, but I love the way it visually organizes the code on the page. I think I'll be using this more often when I can, if only for the aesthetic value.
Is RabbitMQ a fit solution for request timeout problem ?
Tags: help, php, rabbitmq, requests
Published: 2019-05-01 16:00:02

---
title: Is RabbitMQ a fit solution for request timeout problem ?
published: true
description: 
tags: #help #php #rabbitmq #requests
---

The system am working on relies on the response received from an external API, frequently now, the requests we are sending finish with a timeout and we end up losing the transaction in progress.

We need our requests to be resent over and over until the API responds so we could continue the transaction.

I got advised to use RabbitMQ so that it queues the requests until the API responds, so this way my application should be a producer that pushes to the queue, what I still can't undrestand is how I am going to receive a callback from the queue once my message (request is excuted sucessfully) ?
Does RabbitMQ guarantee that my request reached its destination sucessfully? will it keep trying to send the request until the api responds (the api is available for exchanges) ?
How will my application resume the execution related to the request ? my intial idea now is to isolate that code that relies on the immediate response of the external API.

Is it even RabbitMQ the best choice here ?

I have zero experience with RabbitMQ that's why I am still skeptical if it's appropriate in this use case so am sorry in advance if some of these questions are completly dumb.

PS: we are keeping track of the timeout data.
    The API we are connecting to is part of an external system, we have no control 
    over it.
The Process of Implementing A UI Design From Scratch
Tags: design, css, frontend
Published: 2019-05-01 15:59:03

---
title: The Process of Implementing A UI Design From Scratch
published: true
description: An exploration of how I built a UI design in HTML&CSS by thinking and documenting everything I thought about.
tags: design, css, frontend
---

*This post has been originally shared on my blog and it's a bit long, so I will share the introduction and you can continue reading it on the blog.*

There are many ways to build a layout in HTML & CSS, and every developer has his own way of doing it. Getting to know the thinking process inside a Front End Developer mind is extremely useful, as it gives us different perspectives on how to solve certain problems.

In this article, I will dive into the journey of building some of the components in a project I called “Nadros”, and write down my thought process, from the perspective of a designer and a developer.

Nadros is an imaginative idea for an online video courses platform. In this article, I’ll focus on building the header component.

![](https://thepracticaldev.s3.amazonaws.com/i/3rfvyhm4emxffkmrpv0v.png)

## Design Components

I extracted all components into one page so I could look at them together. This would make it easy to find inconsistencies between UI elements. Also, having all of them at once can lead to ways for unifying some UI components, or to create a variety of specific components.

![](https://thepracticaldev.s3.amazonaws.com/i/x3biy5v5ubslepkjhsdz.png)

Continue reading my [blog](https://ishadeed.com/article/building-ui-design-scratch/)

Let me know your thoughts please!
What do you prefer more: working in a Product Team or working for an Agency ?
Tags: discuss, career, agency, product
Published: 2019-05-01 15:44:32

---
title: What do you prefer more: working in a Product Team or working for an Agency ?
published: true
description: Career Discussion
tags: #discuss #career #agency #product
---

During my career, I have worked with both within a product team and with an agency.
 
Here is a short comparison from what I have seen:

Agency Work:
Clients come to you with requirements and you and the team try to implement those. 

Pros:
- You get to work on new projects and requirements, so you don't usually get bored 
- You get to try new stacks in projects

Cons:
- Deadlines can lead to compromises and hacks to just deliver the project
- Can lead to work-life balance issues
- Requirements are always changing which (might) lead to more hacks.


Product team:
The company has a product idea which is implemented and probably has paying users. Your job is to keep this product up and running. Plus add new features to keep those customers happy.

Pros:
- Having more time to invest in code quality and applying best practices
- Having a long term vision about the product's roadmap
- Less pressure and you have more time to experiment with features 

Cons:
- Legacy code you have to maintain
- You miss that lovely feeling of creating projects from scratch
- It's hard to know what the customer really needs

What do you guys prefer and Why ?
Git Alias: WTF Is It? How to do it? When TF to Use it?
Tags: beginners, gitalias
Published: 2019-05-01 14:45:48

---
title: Git Alias: WTF Is It? How to do it? When TF to Use it?
published: true
description: My literal thought process as I did my code homework for the week.
tags: beginner, Git Alias
---

# WTF is a Git Alias?

- a shorthand command for shortcutting Git functions.

# How to Do it?
### How to make Git aliases and how to use them

- Configure your global Git settings by typing 
> git config --global alias.(your desired shorthand command) (actual command)

Example: git config --global alias.ci commit

or add a bit of code to your .gitconfig file

> [alias]
>   ci = commit
rubocop-yayoiを作った
Tags: ruby, rubygems, imas, rubocop
Published: 2019-05-01 14:43:39

---
title: rubocop-yayoiを作った
published: true
tags: ruby,rubygems,imas,rubocop
---

[rubocop](https://rubygems.org/gems/rubocop)の注意テキストが日本語だったらなーなんか好きなキャラクターから指摘されるとさらにいいかなーなんて思ったので作りました。

{% twitter 1121065780995452929 %}

## 出来上がったもの

[https://rubygems.org/gems/rubocop-yayoi](https://rubygems.org/gems/rubocop-yayoi)

{% github YutaGoto/rubocop-yayoi %}

## 使い方

設定するだけです。

```yml
# .rubocop.yml
require:
  - rubocop-yayoi
```

この状態で以下のrubyファイルを試しに用意します。

```ruby
# index.rb
class Takatsuki_Yayoi
  def is_yayoi?(y, takatsuki)
    y && true
  end
end
```

実行します。

```bash
$ bundle exec rubocop index.rb
[Warn] Performance Cops will be removed from RuboCop 0.68. Use rubocop-performance gem instead.
       https://github.com/rubocop-hq/rubocop/tree/master/manual/migrate_performance_cops.md

/Users/yutagoto/Documents/rubocop-yayoi/lib/rubocop/cop/layout/def_end_alignment.rb:8: warning: already initialized constant RuboCop::Cop::Layout::DefEndAlignment::MSG
/Users/yutagoto/Documents/yayoitest/vendor/bundle/ruby/2.6.0/gems/rubocop-0.67.2/lib/rubocop/cop/layout/def_end_alignment.rb:40: warning: previous definition of MSG was here
# 定数を上書きしているワーニングがめっちゃ出るので省略

ζ*'ヮ')ζ＜1ファイルチェックしますよー！
W

ζ*'ヮ')ζ＜うっうー！！

index.rb:1:1: C: Style/Documentation: ζ*'ヮ')ζ＜うっうー！classのドキュメントのコメントを書きましょうねー
class Takatsuki_Yayoi
^^^^^
index.rb:1:7: C: Naming/ClassAndModuleCamelCase: ζ*'ヮ')ζ＜うっうー！モデル名やモジュール名にはCamelCaseを使いましょうねー！
class Takatsuki_Yayoi
      ^^^^^^^^^^^^^^^
index.rb:2:7: C: Naming/PredicateName: ζ*'ヮ')ζ＜うっうー！ is_yayoi? から yayoi? に名前を変えようねー！
  def is_yayoi?(y, takatsuki)
      ^^^^^^^^^
index.rb:2:17: C: Naming/UncommunicativeMethodParamName: ζ*'ヮ')ζ＜うっうー！メソッドのパラメータの長さは最低でも3文字以上にしましょうねー！
  def is_yayoi?(y, takatsuki)
                ^
index.rb:2:20: W: Lint/UnusedMethodArgument: ζ*'ヮ')ζ＜うっうー！使っていない引数がありますよー takatsuki！ もし使わないなら、_か_takatsukiのようにしましょうねー！
  def is_yayoi?(y, takatsuki)
                   ^^^^^^^^^

ζ*'ヮ')ζ＜うっうー！1ファイルチェックしましたよー！
ζ*'ヮ')ζ＜うっうー！5こ怪しいですよー！
```

こんな感じであたかも高槻やよいちゃんから指摘を受けているかのようにできます。うれしいですね。

いまはまだ一部の指摘にしか対応できていないので、今後増やしていく予定です。実質翻訳作業みたいなものなので、rubocopへの理解がかなり深まりそうな気がしています。(TODO:)

また、実行するたびに定数を上書きしているwarningがたくさん表示されてしまうので、もうちょっといい感じにmethodに切り出したり表示するロジックを改造したりしないといけない気がしています。(TODO:)

気が向いたら使ってやってください。
Find the smallest number in a rotated sorted array
Tags: avishvatblog2
Published: 2019-05-01 06:08:23

---
title: Find the smallest number in a rotated sorted array
published: true
description: algorithm 
tags: avishvatblog 2 
---

Question link : https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/

Rotated sorted array : a sorted array which is rotated ( ¯\\\_(ツ)_/¯ ). 

Leet code has a better definition : an array sorted in ascending order is rotated at some pivot

Sorted array : [1,2,3,4,5,6,7]
Rotated sorted array :
1 rotation  : [7,1,2,3,4,5,6]
2 rotations : [6,7,1,2,3,4,5]
3 rotations : [5,6,7,1,2,3,4]
7 rotations : [1,2,3,4,5,6,7] - the same sorted array 

To find the smallest element in the given array :

Approach 1 : Brute force - Go through the array once and find the minimum element - O(n) 

Approach 2 :  Binary Search O(log n)

1. If the number of elements is 1 , return the element

2. Choose a element at a mid point
3. If the first element of the array is greater than mid element, then the minimum element should be in between the first element and mid element
    
        example : [6,7,0,1,2,3,4]
        mid element is 1
        first element is 6
        smallest element 0 is between first element and mid element [7,0,1]
        The first element can be excluded because we already know that mid element is smaller than the first and we only need smallest element
        

4. If the first element is smaller than the n, then two possibilities arise:
    4.1  The array may already be sorted : Check if the last element is greater than the element at mid, if yes return the first element 

        example : [1,2,3,4,5,6,7]
        mid element is 4
        first element is 1
        last element is 7
        last element is greater than the mid, so return the first element i.e.1 


    4.2   The minimum element is present between the mid element and the end of the array 


        example : [2,4,5,6,7,0,1]
        mid element is 6
        first element is 2
        last element is 1
        last element is lesser than the mid, so smallest element is between mid and the end [7,0,1] 
        the mid element can be excluded because we already know the last element is lesser than the mid




Final code :

 {% gist https://gist.github.com/vishva007/2bd55670a1c8048f79e58d6950a6bbfc %}
Apply with your own Form.
Tags: remote, jobapplication, react, frontend
Published: 2019-05-01 14:27:36

---
title: Apply with your own Form.
published: true
description: I fell in love with a remote family and decided to apply.
tags: remote,job-application,react,frontend
cover_image: https://thepracticaldev.s3.amazonaws.com/i/8h2abgdwegmhbck97bip.png
---

Last week I found out about Mobile Jazz while surfing the web. I stumbled on their blog [How to Handle Errors Properly [UX]](https://mobilejazz.com/blog/how-to-handle-errors-properly-ux/). After which I decided to browse through their GitHub and Social Media pages, I really loved it and went straight like this is a company I would love to be in.

So I clicked their job board to check the requirement needed to join. I smiled  wide when I [opened it](https://mobilejazz.com/jobs)

![Apply through our API](https://thepracticaldev.s3.amazonaws.com/i/ehzy12xcielo7ctjn05e.png)

I then decided instead of applying through the API why not create a simple form to do that. After all I am applying to join the frontend and backend teams. So I did and [hosted](https://mobilejazz.netlify.com/) it on Netlify. But unfortunately my request was blocked due to CORS.


![Mobile Jazz Application form](https://thepracticaldev.s3.amazonaws.com/i/65nz80u1e0wo7bpr7zso.png)


I applied with postman eventually , still waiting for their response, but till then I will try and work around the CORS error. I will update you on how it goes. 

Are you a recruiter? Maybe on your next fronted hiring spree let applicants build a form to apply with. I am sure it will be an amazing experience for both of you.
How can I make slides beautiful without a Mac?
Tags: discuss, help, speaking, slides
Published: 2019-05-01 13:37:29

---
title: How can I make slides beautiful without a Mac?
published: true
tags: discuss,help,speaking,slides
---

Every time I see a talk at a conference with beautiful slides, I look up on the podium and discover a glowing white apple symbol on the speaker's laptop.

I have no reason to ever drop any amount of money on a Mac.

I simply don't need one for work.  I'm used to the Windows environment and can work faster when my "work laptop" is a PC.  I'm not the kind of developer who relies upon Unix and Macs for my day-to-day.  Nor am I the kind who needs to own my own laptop at home _(bringing home my "work" laptop suffices)_.

Is Google Slides the best I can do with respect to "prettiness" while having a free, safe offline option during a presentation?

Because let's face it, PowerPoint is a beast to make attractive.

Note:  I'm mostly interested in how "pretty" my slides are for "cat meme"-style decks -- see this Dev post: {% link https://dev.to/wiredferret/talks-slides-are-not-a-presentation-deck-ob %}

I know it sounds stupid, but I feel like if I had an easy time making "aesthetically pleasing" slides, I could feel more at ease improvising and gesturing and engaging with the audience in front of them.  Like the way working can be easier when your desk is clean.  They'd make me happy to look at, and in turn I feel like I'd radiate that back out to the room.

Thanks, everyone!
Weekly Picks #73 - Development Posts
Tags: git, webdev, css, frontend
Published: 2019-05-02 15:25:50

---
title: Weekly Picks #73 - Development Posts
published: true
tags: git,webdev,css,frontend
canonical_url: https://medium.com/daily-now/weekly-picks-73-development-posts-f03c6814a257
cover_image: https://cdn-images-1.medium.com/max/1024/1*L3nI4_7nxaeYWFO6WwLPsw.jpeg
---

> If you’re not a risk taker, you should get the hell out of business

We have many announcements before going on with the most popular dev news of this week, hold on tight!

For those of you who have some how missed our launch yesterday, I am glad to share that Daily 2.0 is officially launched with brand new features that described in detail on our [Product Hunt page](https://www.producthunt.com/posts/daily-2-0). 🚀

As part of our launch, we created a special promotional video just for you and wondering what you think about it. Feel free to share your thoughts down below in the comments: 📺

{% youtube Oso6dYXw5lc %}

Lastly, we totally redesigned and reformatted this weekly blog post and we hope you like it! 🎨

Finally, here is the anticipated list of the most popular dev news of the week:

- [How I configure VSCode for Everything](https://app.dailynow.co/r/6d64301181130e5137a7c97b1d3617f5) by [Aman Mittal](https://medium.com/u/c35630ebd4d)
- [Avoid ugly If/else blocks & make your code modular with Strategy](https://app.dailynow.co/r/16c77ff22dc4c701297d8a1860d1313f) by [Iskander Samatov](https://medium.com/u/3110c0425a2b)
- [How I Made More Money This Month From Blogging Than I Did From My 9–5](https://app.dailynow.co/r/b5c6b69d852f37873f859f382977f459) by [Tim Denning](https://medium.com/u/b6d641be1066)
- [You just need to know these properties to start loving CSS](https://app.dailynow.co/r/c2647661e6d36ab6feeec522a9603c1c) by [Henry Tabima Giraldo](https://medium.com/u/3a437a645a16)
- [Tailwind CSS: Is it tomorrow’s Bootstrap?](https://app.dailynow.co/r/1fe1f5bbda0ac77ebb9f9c240e9e211b) by [Obinna Ekwuno](https://medium.com/u/bc06f8eec49c)
- [Full-stack solution for fast PWA development](https://app.dailynow.co/r/8148b205fadb182f5ee7959be8d88ce0)
- [What’s New in Node 12](https://app.dailynow.co/r/e91a70ab1dd920d2dffff3a436154f4c) by [Trey Huffine](https://medium.com/u/47e700e59e44)
- [10 insanely useful Git commands you wish existed — and their alternatives](https://app.dailynow.co/r/b67ea2e026416e72a245b7d7dbdc5281)
- [How to write Node.js applications in TypeScript](https://app.dailynow.co/r/bf09aa7c1ccace1884ed8e0c7db0a742) by [Freek Mencke](https://medium.com/u/711ae81a93e4)
- [Facebook makes its first browser API contribution](https://app.dailynow.co/r/2b002e9e03018f4eb6b278d891c00f78)

* * *

[_Thanks to Daily_](https://www.dailynow.co/) _developers can focus on code instead of searching for news. Get immediate access to all these posts and much more just by opening a new tab._

[![](https://cdn-images-1.medium.com/max/1024/1*7bwIhcH467BKX5Ni8XWpQg.jpeg)](https://www.dailynow.co/)
Top 10 Web Development Trends in 2019
Tags: webdev, trends2019, websitedevelopment, developmenttrends
Published: 2019-05-01 12:50:54

---
title: Top 10 Web Development Trends in 2019
published: true
description: With widespread cloud computing and the idea to share resources for reducing cost has increased the demand for web application development. Now companies are aligning themselves to trends which can improve their web apps performance, reduce utilization of resources and enhance user experience.
tags: web development, trends 2019, website development, development trends,
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/0s08iq51eehls67bvh8y.png" /></a>

With widespread cloud computing and the idea to share resources for reducing cost has increased the demand for web application development. Now companies are aligning themselves to trends which can improve their web apps performance, reduce utilization of resources and enhance user experience.

Top 10 Web Development Trends in 2019

The trends in 2019 somewhat will be derived from previous years yet there will be new inclusions this year.

Read the full article: https://www.decipherzone.com/blog-detail/Top-10-Web-Development-Trends-in-2019---Latest-Website-Development-Trends
Creating Symlinks in Linux
Tags: linux, webdev, bash, devtips
Published: 2019-05-01 12:18:15

---
title: Creating Symlinks in Linux
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xtekgjfipbawv2k6f6pj.png
description: A SymLink in Linux is a special kind of file that points to an actual file or directory.
tags: linux, webdev, bash, devtips
---

A SymLink in Linux is a special kind of file that points to an actual file or directory, basically a shortcut, but a little different as a symlink is an actual pointer to the source file or directory. Symlinks can be very useful for example if you want to version files you can bump a version app_v2 but just have a symlink that refers app_latest that just references the latest version.

```bash
ln -s /path/to/source /path/to/symlink
```

Some useful SymLink options are: 

```bash
-f   If the target file already exists, then unlink it and force the link

-n   Useful with the -f option, replace the symlink that might point to a directory
```

One important thing to remember is that you must use the full path when creating symlinks and not the relative paths. For example if you have this as your filesystem

```bash
> ls
image.png
```
We want to create another directory (folder) called pics that contains a symlink
to image.png within it.

```bash
> mkdir pics

> ls
image.png
pics
```
If we tried to symlink just using relative paths the symlink would be broken:

```bash
> ln -s image.png ./pics/image.png
```

Instead, we should use the full path and in our case we can use the `$PWD` value which expands to our present working directory:

```bash
> ln -s $PWD/image.png $PWD/pics/image.png
```

Another option is to actually change directories into the pics directory and create the symlink from there:

```bash
> cd pics
> ln -s ../image.png image.png
```

[Original Post on Dev Diaries](https://www.dev-diaries.com/social-posts/sym-link/)
[Instagram Post On Dev Diaries](https://www.instagram.com/p/Bw2eNhIBAiv/)
Short closures in PHP 7.4
Tags: php
Published: 2019-05-01 11:56:15

---
title: Short closures in PHP 7.4
published: true
description: Short closures, also called arrow functions, are added in PHP
tags: php
canonical_url: https://stitcher.io/blog/short-closures-in-php
---

Short closures are a way of writing cleaner short functions in PHP:

```php
// A collection of Post objects
$posts = [/* … */];

$ids = array_map(fn($post) => $post->id, $posts);
```

You can read all about them here: [https://stitcher.io/blog/short-closures-in-php](https://stitcher.io/blog/short-closures-in-php)
Make A Calculator In JavaScript
Tags: webdev, html, javascript, css
Published: 2019-05-01 11:24:58

---
title: Make A Calculator In JavaScript
published: true
description: Make A Calculator In JavaScript
tags: #webdev #html #js #css
---

Source : <a href="https://www.skptricks.com/2019/05/create-simple-calculator-using-jquery-html-css.html" >Create Simple Calculator using JQuery, HTML and CSS </a>

This tutorial explains how to create simple calculator application using jquery, html and css. Making a calculator in JavaScript is not have been taught so far.As it supports mathematical calculations. With the help of JQuery, HTML and CSS we can build few tiny applications which run completely inside the browser. Today in this tutorial I am going to show you how to create a simple calculator using JQuery with the help of HTML and CSS. Using this calculator we can perform basic arithmetic operations.

<img src="https://1.bp.blogspot.com/-su0q4tkVOJM/XMl9_Oe6jyI/AAAAAAAACw0/ncSX66IVCpEFRk4yQf5u0_nsM-TpLINDQCLcBGAs/s400/a1.PNG"/>


<a href="https://www.skptricks.com/2019/05/create-simple-calculator-using-jquery-html-css.html" >Click here to read more... </a>