teleren/devto huggingface dataset:
Do PWA's eliminate the requirement to learn mobile frameworks?
Tags: discuss, webdev, codenewbie, explainlikeimfive
Published: 2020-01-09 20:48:07

I'm going to throw it out there right up front...I am a #codenewbie.  So if this question is ridiculous, please let me know as nicely as possible.

However, with everything moving more towards mobile development, I have obviously started considering learning a mobile framework.  And then I heard about this great new thing in web development called the Progressive Web App.  I took [Net Ninja's PWA Youtube Course](https://www.youtube.com/playlist?list=PL4cUxeGkcC9gTxqJBcDmoi5Q2pzDusSL7) and it got me wondering...

If PWA's are becoming more common for web browsers, and they can be saved to a mobile device's home screen, what are the pros/cons of the PWA against mobile frameworks like Ionic and Flutter?  And does understanding how PWA's work and are deployed keep me from needing to learn a mobile framework?

Again, complete novice here, so I apologize if this question is out of left field.  Thanks!
Favorite Refactoring Techniques: Extract Functions
Tags: extractfunction, refactoring
Published: 2020-01-09 20:21:12

---
title: Favorite Refactoring Techniques: Extract Functions
published: true
description: 
tags: extract function, refactoring
series: Favorite Refactoring Techniques
---

The next refactoring technique we'll look at is extracting behavior into functions. Say we have the following example: 

{% gist https://gist.github.com/Naomi-Dennis/4ff8c79aa5b40136bd042f95be7bba15 %}

`SubwayTrain#processStop` has a lot of behavior. The intention could be made clearer by separating each behavior into its own method. The behavior we extract will also become available to other classes that may need it, outside of the context of getting passengers at a subway station. 

After extracting the behavior, `#processStop` looks like this: 

{% gist https://gist.github.com/Naomi-Dennis/057e40ea1780e22d7d2afcdf37524673 %}
Need help to make game.
Tags: help, java, devops
Published: 2020-01-09 20:10:36

Hello to everyone, my name is Ivan. I have a great idea for a game I got ready the concept and the story. The thing is that I know how to work only with python and html. And I'm learning right now Java and javascript and also c++. Its my last year of the high school. So next year I'm going to college. Anyways I would like to get response from people who wants to work on something cool and something that maybe can bring a lot of money and I believesomethingnew to learn. Ofcourse I can't pay you cuz I'm broke right now. But if the whole thing will get to the top (and I believe it will) everyone who whould work on that will get some % of the incomes.I would like to hear any thoughts soo feel free to reply or come in contact with me. Thank you all for your time.And sorry if my English is kinda bad.
React Logo usage rights
Published: 2020-01-09 20:03:13

Hello, my name is Scott and I am currently a student at Lambda School. I am working on my portfolio site and listing React in my skills section. I found the React logo in fontAwesome and it mentions attribution but does not give me any information that I can use for attribution. So, am I allowed to use it on my site? If attribution is required can someone provide that info please? thank you.
Introducing our January 2020 sponsors
Tags: meta
Published: 2020-01-09 19:59:55

---
title: Introducing our January 2020 sponsors
published: true
description: Our wonderful sponsors are vital to the health of dev.to and it is great to work with companies contributing so much to the ecosystem.
tags: meta
cover_image: https://p78.f0.n0.cdn.getcloudapp.com/items/6quLYbKZ/Image+2020-01-03+at+5.34.56+PM.png?v=8eef8ca464d86e3a0a39e5942d672ea7
---

Starting up the new year, we return DigitalOcean and CloudBees, and welcome back Triplebyte as a Gold Sponsor. Thank you to each of these companies for being a valuable DEV Community partner and supporter.

Please take a few minutes to explore their offerings and consider them for your company or next project.


## **DigitalOcean**

[DigitalOcean](https://do.co/devto) is a much-loved cloud computing platform. I'm always impressed by how well-built _and well-documented_ the DigitalOcean core products are. It's easier said than done, and they've been able to stay ahead of the curve.

DigitalOcean has been our longest-running supporter to date, and we're extremely thankful for their consistent support.  Their commitment to the developer ecosystem is crystal clear.

As an organization, it's awesome to see the evolution of their service and their remarkable ability to stay top of the game for years now.

{% organization digitalocean %}

## **CloudBees Rollout** 

[CloudBees Rollout](https://rollout.io/?utm_source=devto&utm_medium=referral&utm_content=jan2020_sponsorship&utm_campaign=rollout_trial_devto) is a powerful code release toolset that brings feature flags, analytics, and testing to the process. Reduce risk by decoupling feature deployment from code releases. CloudBees as a whole provides solutions for CI, CD, and application release orchestration (ARO).  They are the largest contributor to Jenkins, the very popular open-source automation server. Cloudbees is truly a company that lives devOps and CI/CD to its core with its entire offering.

{% organization cloudbees %}

## **Triplebyte**

[Triplebyte](https://triplebyte.com/a/YU8fSn0/jan2020recognition) allows developers to take one quiz and immediately get into the interview process with top tech companies if you qualify. It should be a part of any developer's job search process.

I personally took the Triplebyte quiz and the questions felt like a genuine test of real world software development principles. I'm spoken for in terms of work and you may be as well, but I'd suggest giving the quiz a spin either way.

{% organization triplebyte %}

***

These organizations are helping us build the best community we can. I urge you to check out their offerings if you are in the market for their services.

Happy coding ❤️
How do I speed up new Terminal tab loading time?
Tags: macos, terminal
Published: 2020-01-09 19:54:46

---
title: How do I speed up new Terminal tab loading time?
published: true
description: 
tags: macos, terminal
---
*This is a note-to-self post.*
*from [stackexchange](https://apple.stackexchange.com/questions/41743/how-do-i-speed-up-new-terminal-tab-loading-time)*

The problem is caused by a (potentially) expensive ASL system log lookup. To see this in action, run `sudo fs_usage | grep 'asl.*login'` in a Terminal window, then open a new Terminal window.

To solve the problem, configure Terminal to launch a non-standard shell:
* Create a symlink to your preferred shell. E.g.: `sudo ln -s /bin/bash /usr/local/bin/bash`
* Open Terminal Preferences and select the "General" tab.
* Select "Shells open with: Command" and enter the symlink you created in step 1. E.g. "/usr/local/bin/bash".

> Note 1: You may also need to add bash and -bash to the process list at "Terminal Preferences > Profiles > Shell > Ask before closing".

> Note 2: /usr/local/bin is writable in OS X 10.11 (El Capitan) Rootless mode.

To verify the fix:
* Open a new Terminal window.
* "Last Login:" should not be displayed at the top
* Open the inspector (Command + I) and select the Info tab.
* The command should read `login -pfq username /usr/bin/bash` or `login -pfql username` ...

**Important: If the login command does not include the -q parameter, then you have not fixed the problem.**

You can also use `sudo fs_usage | grep 'asl.*login'` to verify that `/var/log/asl` is not accessed when opening a new Terminal window.
How to Log All SQL Queries in Laravel
Tags: laravel, laravel6, laravelcodesnippet
Published: 2020-01-10 19:46:51

---
title: How to Log All SQL Queries in Laravel
published: true
date: 2020-01-09 19:54:23 UTC
tags: Laravel,Laravel 6,Laravel Code Snippet
canonical_url: https://codebriefly.com/how-to-log-all-sql-queries-in-laravel/
---

 ![How to Log All SQL Queries in Laravel](https://codebriefly.com/wp-content/uploads/2020/01/How-to-Log-All-SQL-Queries-in-Laravel.jpg)

In this article, we will discuss “How to Log All SQL Queries in Laravel”. As we know, Laravel provides rich features and flexibility to make development easy. SQL Query Logging is the most common way to debug any application. Today, I will explain to you to Log all SQL Queries in your Laravel application. There […]

The post [How to Log All SQL Queries in Laravel](https://codebriefly.com/how-to-log-all-sql-queries-in-laravel/) appeared first on [Code Briefly](https://codebriefly.com).
Relation between middle/senior and junior dev
Tags: discuss, team, productivity, mentoring
Published: 2020-01-09 19:47:49

I've been a teacher and also a learner, so I've got something to tell you.

I've heard so many comments like *"you're too junior"*, *"you're not a middle/senior dev"*. I'm sure you've heard that too.

If you told me that something is impossible, I'm the type of woman that will try to succeed even if there is only a small chance.

Yes, I tried to achieve a proficiency level in tech close to the level of developers who inspired me despite my limited experience.

The fact is, some people believe that a junior should listen to the middle/senior dev and that's all.

The middle/senior dev is highly qualified and has experience. For sure.

> But it's still **an exchange**. 

Sharing knowledge is not easy for everyone. And when you're in this situation, you sometimes have the obligation to explain complexity with simple words and distill abstract ideas into more digestible ones.

It's an art not a science, really.

We all know that **a developer is always learning**, even by asking other devs. Sometimes developers ask things you didn't think about, or you just don't know about, and you also want to know the answer. So sometimes their question prompts you to research more and helps expand your knowledge base.


### To you the junior dev

Don't think the dev with high skills has no time for you. If he/she is really busy, add a meeting in his/her calendar. That will show it's important for you and you really need this point. It can be the time to clarify what's good in your work and what needs to be improved.

**Try to find the answer before asking but don't dedicate too much time to it**. If you're stuck ask for help. You're losing time, even if it seems important to do it on your own and get the glory, you could have done so much more. And when it's solved in two seconds, it’s much better not to wait so much time to ask help ;)



### To you the middle/senior dev

Some people admire you in secret, I mean really. Take time to help junior dev to grow if you have the capacity to do so. It's also time for you to challenge yourself and get to know your team better as well.

From my perspective a great middle/senior dev is not just someone who is technically proficient but also  is someone who can help others to grow. An experienced dev should **constantly learn to teach others with more clarity, to better organize their team, and to communicate more effectively**.


And you, what do you think?
Can a JAMstack site be dynamic?
Tags: jamstack, jamuary
Published: 2020-01-09 19:26:55

JAMstack sites are characterized by their fairly “static” nature. They consist of mostly static assets that are pre-generated ahead of time and served to the end user with minimal latency via a CDN. Because JAMstack sites favor pre rendering content at build time, they can seem antithetical to dynamic sites where content is “dynamically” fetched at request time from the server. This assumption is deeply predicated on the dichotomy of static and dynamic (This is unsurprising given that in the english language static and dynamic are in fact antonyms.) In the context of the web, static and dynamic are separate ends of a spectrum. A site can be at either extremes of static and dynamic or be anywhere in between. By giving developers the option to prebuild while also tapping into a rich API ecosystem and leaning on JavaScript for interactivity, the JAMstack sits comfortably at the intersection of static and dynamic. 

Serverless functions add an extra layer of dynamism to JAMstack sites. They provide a way to inject dynamic content to sites and respond to user feedback in realtime. In the case of a forum where comments are an integral part of user interaction, comments can be implemented via a serverless function that reads and writes to an external database. This is in contrast to the traditional approach of building out a monolithic application to handle one or two pieces of dynamic functionality. Serverless functions therefore enable developers to add dynamism to their sites while also isolating tasks into functional elements that are more efficient (no need to over provision servers) and maintainable in the long run. 

If serverless functions still confuse you, check out [Tara's](https://twitter.com/Tzmanics) [deep dive into what serverless is](https://dev.to/tzmanics/what-is-serverless-besides-a-bad-name-for-using-servers-35ag). And if you're not sure how to use serverless functions, [here's a piece to get your creative juices flowing](https://www.netlify.com/blog/2019/05/29/creating-a-map-of-the-best-pizza-in-chicago-with-yelps-fusion-api-netlify-dev/?utm_source=devto&utm_medium=serverlesspizza-div&utm_campaign=devex).
New Programmer Pitfalls
Tags: career, tutorial, firstyearincode, beginners
Published: 2020-01-09 19:09:32

Among those learning to code, I've observed two dangerous trends.

The first is something I call the "infinite tutorial loop." The aspiring programmer goes from tutorial to tutorial, never breaking out and building something independently. I've seen cases where someone has been coding for less than a year and they are, frankly, more skilled and more knowledgeable than someone who has been doing it for five. This isn't because they're more intelligent or putting in more time - it's because they've been pushing themselves out of their comfort zone, stretching themselves, and building applications and picking up new skills along the way. Meanwhile, the other person has been spending their time going through 75 introductory React courses on Udemy. One has an upward trajectory; the other is stuck in a loop.

The second is simple: the individual does everything related to coding that doesn't involve writing code. They attend every meetup. They share relevant content on LinkedIn daily. They're subscribed to every programming subreddit. But they're never actually creating anything. Zero green squares on GitHub.

If you want to become a programmer, start coding. Think of something you'd like to build and get to work!
Generate GIFs from a directory of videos using FFmpeg
Tags: bash, ffmpeg
Published: 2020-01-09 18:56:11

---
title: Generate GIFs from a directory of videos using FFmpeg
published: true
description: Generate GIFs from a directory of video content using FFmpeg. When prompted, provide a target directory and specify the output format.
tags: #bash #ffmpeg
---

![gif](https://i.ibb.co/6sxD6Ys/dir-gen-gif.gif) 

# Background
As a [video artist](www.cskonopka.com) I deal with many physical formats (analog composite to 4K) and digital formats (.mp4, .mov, Motion JPEG, .gif, etc.). Going between formats can be a nightmare, and I like to build tools that can ease any potential stress. Over the summer, I wanted to convert my [analog video synthesis](vimeo.com/cskonopka) into .gif files to upload to [Giphy](https://giphy.com/cskonopka/). So I made this bash script that ingests a directory of video content and asks for a target file format.

# Breakdown

Create a new bash script named *dir-gen-gif.sh*.

```bash
# dir-gen-gif.sh
#!/bin/bash
```

Ask for a directory of video content. 
```bash
echo "Provide a directory please :"
read dir
```

Ask for a video file format.
```bash
echo "Filetype?"
read filetype
```

Create a loop that iterates over the directory and finds the target video file format.
```bash
for f in $dir/*.$filetype
do
    echo "Processing $f"
    # ... ffmpeg code
done
```

Add the FFmpeg scripts. First create a .png analysis file and then generate a .gif file.
```bash
    # Generate .png analysis file
    ffmpeg -y -ss 0 -t 11 -i $f -filter_complex "[0:v] palettegen" "${f%.*}.png"
    # Create .gif file
    ffmpeg -ss 0 -t 11 -i $f -filter_complex "[0:v] fps=24,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" "${f%.*}.gif"
```

And the process will look something like this ...

![gif](https://i.ibb.co/8NNNX1t/dir-gen-gif3.gif)

# Reference
```bash
# dir-gen-gif.sh
#!/bin/bash

# Provide a directory containing video files 
echo "Provide a directory please :"
read dir

# Filetype target
echo "Filetype?"
read filetype

# Iterate over the directory, look for target filetype
for f in $dir/*.$filetype
do
    echo "Processing $f"
    # Generate .png analysis file
    ffmpeg -y -ss 0 -t 11 -i $f -filter_complex "[0:v] palettegen" "${f%.*}.png"
    # Create .gif file
    ffmpeg -ss 0 -t 11 -i $f -filter_complex "[0:v] fps=24,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" "${f%.*}.gif"
done
```
So you want to post messages to Slack
Tags: slack, api, darklang
Published: 2020-01-09 18:51:33

Want to get started building a Slack app, but not sure what you need? The Slack API provides three easy ways to programmatically post messages. 

There are three easy scenarios:

**Posting messages in a specific channel (say #engineering).**

If you know what channel you want to post to, you can set up an incoming webhook. (An example of this would be wanting to share reviews from an AppStore in your #engineering channel). You'll be able to post at any point, and everyone in the channel will see it.

**Responding privately to a specific user.**

If you want to post something for a user on demand, the best way is to set up a /command. When the user calls it, regardless of channel, you'll receive a response_url parameter and can publish back to them. (For example, letting users ask a [Magic Eight Ball](https://vimeo.com/380770154)). They'll be able to use this from any channel. 

**Something else**

For anything other than these two scenarios, use the [chat.postMessage](https://api.slack.com/methods/chat.postMessage) (make sure you have a write scope defined in the OAuth/Permissions section). This will allow your app to publish to any channel, for all users to see!


In any of these cases, if you need fancier messages, the [Slack Block Kit Builder](https://api.slack.com/tools/block-kit-builder) lets you write/get real JSON, while also being able to see what your message would look like. You should be able to try these methods out wherever your favorite place is to set up an API! 
 

Want to get started without a bunch of other set up? Join the [Dark Beta](https://darklang.com/beta) and mention dev.to. 

This is all you need to do to get these three options going in Dark:

![Dark Handlers](https://thepracticaldev.s3.amazonaws.com/i/jr8wwptwre5yju9j2oht.png)
Job Opportunity for Sr. QA Engineer - NYC (Brooklyn) - Musictech
Tags: qa, testing, hiring, career
Published: 2020-01-09 18:48:58

We're looking for a Sr Level QA Engineer in NYC! (Brooklyn) 

We're a musictech company serving independent musicians and artists across the world. Our platform makes it cheap and easy to publish and distribute music royalty-free, we're #1 or 2 globally for publishing, and building new apps that make it easier than ever for artists to manage all of their challenges! 

The Job Description can be viewed here: http://bit.ly/QA_NYC

Apply directly from the Job Description if you're interested to get teh fastest response or contact me at boycejoseph@gmail.com

Current Tools/Tech include: Hiptest, Capybara, Saucelabs, Selenium, and various Javascript Automation Frameworks. We're always looking for new tools to make us better and more efficient. 

Unfortunately, only Permanent US Residents are eligible for the job.
fzf and autojump: shell superpowers
Tags: fzf, autojump, linux, shell
Published: 2020-01-09 18:15:41

---
title: fzf and autojump: shell superpowers
published: true
description: fzf and autojump give you wings, on the shell that is
tags: fzf, autojump, Linux, shell
---

I've been using fzf (fuzzy file finder) and autojump (smart cd command) for a long time now and wanted to share how they are used. You can check out the demonstration [here](https://youtu.be/fHgCSLQ9oA8).
Automating Development With Tasks in VSCode
Tags: programming, tooling, editors, vscode
Published: 2020-01-09 15:53:31

---
title: "Automating Development With Tasks in VSCode"
published: true
description: Do shell stuff easily from within VS-Code
tags: 
- programming
- tooling
- editors
- vscode
---

_Originally published: https://stevengharms.com/posts/2020-01-08-automating-development-with-tasks-in-vscode/_

A great feature that ships with VSCode is the "tasks" capability. I've not seen many developers use it, so I thought I'd document how it's made my life blogging with a statically-generated site simpler.

Often, when doing any development, developers find themselves performing certain loops: drop to shell, run some command, capture output, paste output back into the editor, etc. Eventually most developers wind up curating a per-project set of shell aliases and functions to accelerate that loop. Perhaps the high-water mark for this behavior is the Rails framework which came with a task runner, `rake`, by default.

I'm glad to say that VSCode has a built-in [task runner][runner] facility that can be leveraged to make whole series of routine tasks much more pleasant.

<!--more-->

## Getting Set Up

We define tasks in a file called `project_home/.vscode/tasks.json`. Think of each task as a "function" or a "method" in a programming language. It should do one shell operation. Much like functional programming, these small tasks can be composed together to create macro-level tasks.

Here's one of my tasks:

```json
    {
      "label": "Publish to BLOG SITE",
      "type": "shell",
      "command": "rsync -azrP ${workspaceFolder}/public/ HOST:/web/server/directory",
      "dependsOrder": "sequence",
      "dependsOn":["Push Images to servers", "Hugo Build"],
      "problemMatcher": []
    }
```

Start with the `dependsOn`. When I run this task (which is available through VSCode's `Command-Shift-P` menu), it first runs the tasks `"Push Images to servers"` and `"Hugo Build"`. The first synchronizes local assets I used to the production host, the second runs the static site generator and emits the processed site to `${workspaceFolder}/public`. Then this task's `"command"` runs and uses `rsync` to send the completed web page content to the HOST. That's it!  The dependencies are run in order because of the `"dependsOrder"` attribute being set to `"sequence"`.

If I later decide to update the piece, no problem, simply run the command again.  By allowing me to stay in the editor I don't have to do the context switch out to make the content go live.

[runner]: https://go.microsoft.com/fwlink/?LinkId=733558
Commute Times to Work -> Killer
Tags: productivity, commutetime, travel, work
Published: 2020-01-09 17:44:29

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/dska25p9iyg27tzf13ff.png)

Received an email from Google and it was slightly depressing to see how much time we spend just traveling to work in an year. 

Close to 23 days in an year ! That's incredibly wasted amount of time which could have been well spent even on a vacation to refresh/replenish your energy.

Imagine how many software skills, you could achieve in 3 weeks of time  !?