teleren/devto huggingface dataset:
Daily Developer Jokes - Saturday, Oct 3, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-10-03 12:00:25

---
title: "Daily Developer Jokes - Saturday, Oct 3, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Saturday%2C%20Oct%203%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259d336eb5.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q___: What good can come of 2989 witches casting a hex?

___A___: None, it is always 0xBAD
 -->
Tip: Stashing selected files in git
Tags: git, vscode, beginners
Published: 2020-10-03 10:20:23

One of my favorite git commands is `git stash`. I use it all the time. I like how it helps me clean my working directory but still save my work for later.

One downside of using `git stash`, though, is that it stashes away **all** files. What I need in some cases is to stash only a few selected files or a single directory. I’ve needed this in several occasions but never really tried to research it (yeah, call me lazy).

Until a couple of days ago - that’s how stories unfold - when I finally visited the [official docs for stash](https://git-scm.com/docs/git-stash)! I found an option called `<pathspec>`. This option can be used with the `push` command to specify a path. Git will then stash all files that match the path.

How does it look in practice? Say I have the following files in my working directory:

```bash
js/custom.js
css/custom.css
```

Here are a few use cases I might have:

```bash
# to stash just the `custom.js` file
git stash push js/custom.js

# to stash the `custom.js` file with a custom message
git stash push js/custom.js -m "Best feature ever"

# to stash only the files in the `js` directory
git stash push js/
```

I’m quite happy about discovering this. I’ll definitely use it in my work. Hope you learned something new today as well. 😉

P.S. I’ve created a [Git Cheatsheet extension for VS Code](https://marketplace.visualstudio.com/items?itemName=dzhavat.git-cheatsheet) that can help you with remembering some common git commands.
Why are any hardwares and softwares fail to provide more than a few years of support (or even usability)?
Tags: opensource, linux, discuss
Published: 2020-10-03 10:19:22

Usually at most 3 years, I think, and probably more severe for non-opensource or non-free products (including hardware drivers and software storage formats).

Breaking backward compatibility after every major updates is another thing, like what Microsoft Office did. Not sure if online, subscription-based softwares will exacerbate the problems.

The only reason I can be sure of an 8-year-old laptop, is because of Linux.

I also find later that my 3-year-old MacBook Air hardwares cannot be replaced or upgraded -- it is fixed to the mainboard.
Testing github based comments
Tags: codepen
Published: 2020-10-03 09:38:36

---
title: Testing github based comments
published: true
tags: codepen
---

If you have serverless websites, like a GatsbyJS based blog hosted on netlify.com, you will somehow need the readers of your blog to be able to comment on your content. This is what utterances will allow you to do. This page is a POC of how to do that. You can read about Utterances and perhaps also read Using Github issues for Blog comments


{% codepen https://codepen.io/netsi1964/pen/KKzOgdy %}
Engineer vs Developer
Tags: career
Published: 2020-10-03 09:35:40

It's weekend again and it calls for new food for thought kind of a topic.

###**What do you mean by the term "Developer" ?**

This is a question that can be answered in a lot of different ways depending on the different viewpoints. According to me if you have a good logical capability and you know what tool to use when and for what use case, that makes a good Developer. I won't bring SYNTAX in between here because it can be easily googled, right?


###**What do you mean by the term "Engineer" ?**

An engineer is someone who builds stuff. Building anything requires a lot more knowledge than just programming and logical thinking. One needs to dive into the idea/abstract of the product/tech they are working on in order to know what shortcomings are present currently in product/tech and what solutions might help solve those issues.

------------------------------

This debate of engineer vs developer can be a long one but one must keep in mind that being an engineer is "holistic development of developer". An all-around development of a developer makes them an Engineer. Being an engineer is more than just coding, it's also about understanding the product, how you perceive a problem statement, and start thinking of a possible solution to it. 

There's a very clear and visible line between a developer and an engineer, to say the least, but this is again my opinion and it can be different for different people based on their experience.

------------------------------------------------------------------

Tell me what do you think about this comparison of a Developer vs Engineer.

Twitter - [punnyhooman](https://twitter.com/thepunnyhooman)
Passing object as props in VueJS
Tags: vue, javascript
Published: 2020-10-03 09:24:09

Hello everyone.
I'm currently working on a project require render JSX buts now I'm stucking with a problem that passing JSON object as props.

Even though VueJS supports passing a JSON object variable for the prop but not able to pass JSON object directly like below:
```
<Comp :property="{\"key": \"value\"}" />
```
Have you ever met this problem and having any suggestions for this?

I'm using encodeURIComponent and treat it as a string for now but it's not a pretty solution.
balalaika IT newsletter #11
Tags: react, node, java, webdev
Published: 2020-10-03 09:23:14

---
title: balalaika IT newsletter #11
published: true
description: Curated IT newsletter. From Russia with love. Issue #11.
tags: #react #node #java #webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/7dwkz927sf2ausnqygq3.jpg
canonical_url: https://blog.balalaikait.com/balalaika-it-newsletter-11
---
*If you like this newsletter subscribe to our new issues at https://balalaikait.com/*

# General
- Joseph Gentle [tells us](https://josephg.com/blog/crdts-are-the-future/) about the rise of CRDTs and why he thinks in could beat Operational Transform in many aspects.
- One who wants to write fast code has to understand weak and strong points of modern HW. Cliff Click gave a brilliant [talk](https://youtu.be/OFgxAFdxYAQ) where he explains those points.
- Thread-Per-Core (TPC) is a valid approach for building high-performance server-side software. Yet, it is not trivial to build it right and has a lot of quirks. Some time ago, Redpanda team managed to use TCP architecture on top of Seastar framework and [shared](https://vectorized.io/tpc-buffers/) their experience.

# Java
- James Gosling recently gave a lengthy [interview](https://youtu.be/IT__Nrr3PNI) on Java, JVM, Emacs, and the early days of software engineering.
- Kotlin gets more and more popular among the JVM community. In this [post](https://blog.jetbrains.com/kotlin/2020/09/the-dark-secrets-of-fast-compilation-for-kotlin/) Andrey Breslav sheds some light on the secrets of fast compilation in Kotlin.

# JavaScript
- Atomics module, which holds low-level synchronization primitives useful for Web Workers, keeps getting new features, like `Atomics.waitAsync` method, which is currently at TC39's stage 3. V8 team wrote this [blog post](https://v8.dev/features/atomics) to explain how Atomics can be used to write sync and async lock primitives.
- A great reminder that even high-level languages like JavaScript still suffer from memory leaks. [This time](https://web.dev/detached-window-memory-leaks/) the case is kind of unusual  - detached windows. Be a good engineer and clean up after yourself!

# React
- Kent C. Dodds [tells us](https://epicreact.dev/myths-about-useeffect/) about common pitfalls and myths related to `useEffect`.
Bootstrap 5 Facebook Login Page
Tags: css, html, webdev, weeklyui
Published: 2020-10-03 08:46:50

Facebook is a popular social media website that is connected with new people and also chats with them. So here we made Facebook Login Page in Bootstrap 5 with the help of CSS and Bootstrap 5.

In this element, we used a bootstrap grid and helper class with CSS useful properties. Here we modify bootstrap input fields and buttons. Also, we focus & try to make this Facebook form the same looks like a real Facebook login page. We used Facebook icons and color combinations to make this page the same as Facebook. This is a responsive Facebook page for mobile and tablets side.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source Code](https://w3hubs.com/bootstrap-5-facebook-login-page/)
python tutorial
Tags: python
Published: 2020-10-03 08:41:17

Hey guys,I have create awesome content on Python Programming,Please check out [https://bestpythontutorials.com]

#PREREQUITITES
The only prerequisite for this course is that you should have the basic knowledge of computer programming terminologies but if you don't have an idea about it,just follow the below link and start programming in python

#AUDIENCE
This cource is designed for absolute beginners as well as for trained software developers who want to make their career better by learning python and becoming a Python Programmer.

#WHY US?
We are in a mission to provide high quality programming tutorials absolutety for free.It is optimized to learn programming very easily and effectively with solved examples


#OUR OFFERINGS
In this epic tutorial we have tried our best to uphold maximum topics which is needed to become an expert python programmer we have made tutorials on most popular frameworks available in the market very soon we will be launching courses on JavaSE,JavaEE and Android Application development with both Java and Kotlin

#WHY Python?
This question I don't think I need to answer because most of the people are aware with the popularity of Python Programming Language.Very Recently It surpassed Java i.e another great Programming Language To become the fastest growing and currently the most popular Programming Language in the world with More number of Github repositories than that of Java.


Python Tutorial:[https://bestpythontutorials.com]
Runnable vs Callable
Tags: java, concurrency, runnable, callable
Published: 2020-10-03 08:37:48

In this article you will learn what is a runnable , what is a callable and the difference between the two in java, runnable vs callable. These concepts are important when you are dealing with concurrency.

Concurrency basically means there is not just one execution thread in your program, but several executions or threads, potentially happening simultaneously. Therefore different pieces of the code might be executed at the same time.
Let's get started! 

# Runnable
 The Runnable interface in java enables you to define a block of code that can be executed within its own thread. Therefore if you create several runnable classes and execute them, and you will have several threads running at the same time within the same process or program. This is known as concurrency. 

[See examples of how to use a runnable interface](https://www.hellocodeclub.com/runnable-vs-callable-find-out-the-differences/#Runnable)

# Callable
Next is callable. Callable is also a java interface and as Runnable, you can use it to run tasks in parallel. However there is a key difference. The callable can return the result of the task or throw an exception. The Callable interface is included in Java to address some of runnable limitations.

[See examples of how to use a runnable interface](https://www.hellocodeclub.com/runnable-vs-callable-find-out-the-differences/#Callable)

# Runnable vs Callable - The difference
The main difference between Runnable and Callable is that Callable will return the result of executing the task to the caller. If you use Runnable you can't return anything, any result will need to be saved in separated shared structure or database. To understand this difference runnable vs callable, you can compare the two interfaces.

```
public interface Runnable {
    public abstract void run();
}

public interface Callable<V> {
    V call() throws Exception;
}
```

[How to execute a runnable](https://www.hellocodeclub.com/runnable-vs-callable-find-out-the-differences/#How_to_execute_a_runnable)
[How to execute a callable](https://www.hellocodeclub.com/runnable-vs-callable-find-out-the-differences/#How_to_execute_a_callable)

I hope you enjoy the article and thank you so much for reading and supporting this blog! 🙂
Free online tools for fast and easy image optimization
Tags: 100daysofcode, webdev, codenewbie, design
Published: 2020-10-03 08:17:53

As web developers, we are often given the task to load assets to websites and applications.

Most of the time, unless you are working with a dream team of designers, the assets available are often either too large or incorrectly formatted. 

Likely there are so many ways for developers to manipulate assets, before shipping them to the browser. 

---
**Here is a short list of free online tools I use myself on daily basis for image compressing** 




***Image processing***



**1.Tiny PNG **

Tiny PNG is a super powerful fast online tool to compress your .png or even .jpg files, you just need to drag and drop your photo and it compresses it automatically, with up to 60% of file size reduction.


[Tiny PNG](https://tinypng.com/)




**2.JPEG-optimizer **


JPEG optimizer is another great tool to compress jpg files, in the UI you can upload your photo and make and customize the compression level ( custom width in pixels  ).

 
[JPEG optimizer](http://www.jpeg-optimizer.com/)

 
***Resizing***

Picresize is my favorite tool, I use it almost every day, ( i used it to resize the header image of this post). 
In this tool you can do the following : 

1. Crop 
2. Rotate
3. Flip on both axis
4. Resize with given % or custom values 
5. Save the file in different format including png | jpg | gif 

I highly recommend you to try it out and bookmark it on your favorite browser, it will come in handy, trust me.  

[picresize](https://picresize.com/)


The last but not least good practice to optimize images in your website is knowing what format to use for which kind of asset,  there are plenty of resources out there explaining the difference between png and jpg, if you are curious about the topic let me know on twitter or email, I will be glad to point them out. 

**Here is a good resource to test the loading time of your assets: **


[imgix](https://pageweight.imgix.com/)

On imgx you just need to copy-paste the URL of your website and receive a detailed report of your website load speed. Highly recommended


That's all folks, 

**If you liked this post or you feel a good free resource ( no signup required) should be added to this list, please let me know in the comment section or on   [twitter](https://twitter.com/iyo_bemoore).
Also please share the post with your friends :) * *
How to connect Docker MySQL image to existing Rails app?
Tags: docker, rails, mysql, help
Published: 2020-10-03 08:08:16

Greetings fellow devs,

Relatively new to Rails, but so far I have never had weird issues like this. I was having a lot of configuration issues while trying to do a `bundle install` on existing Rails apps. And `brew install mysql` did not help so I decided to create a container for mysql alone and use it for an existing Rails app.

These are what I have done so far
1) Created a docker container with MySQL image.
2) Went into my container to see if it connects to mysql commandline within it.
3) Tried running `bundle install` again but this shows up.

![Screen Shot 2020-10-03 at 3.57.55 AM](https://dev-to-uploads.s3.amazonaws.com/i/idgverldsmxfvzf4ek4l.png)
 
4) Tried to change my database.yml as such
```
default: &default
  ...Other settings...
  adapter: mysql2
  host: mysql
  port: 3306
```
where `mysql` is the container name. Did not work.
5) I also read about `Dockerfile` and `Docker compose` - got **extremely confused** with the whole thing. I have just a single MySQL container that I would like to connect to my Rails app.

So, I'm here right now, frustrated for two days since the beginning of Hacktoberfest unable to run my Rails apps locally to start making contributions.
I don't know where to go with this and how to fix this issue.
Please help.

**EDIT** - Oct 7 '20
I had also asked about this in [here](https://stackoverflow.com/questions/64187918/how-to-connect-docker-mysql-image-to-existing-rails-app/64188818#64188818) and I got some pretty cool answers! 

**Solution**
Always make sure to have `mysql` installed on your local, cause when installing the `mysql2` gem using `bundle install`, the bundler would look for mysql developmental headers that are in the same space as the Rails app workspace. Unless your `mysql` docker image and the rails app run on the same space, you will always get an error. And it won't help even if you _bind_ the port no of localhost to your docker image port on your `database.yml` cause you are just running `bundle install`, you are not running any code within the app. This is my explanation from what I read and understood. Hope it helps!
Boardgames API
Published: 2020-10-03 07:48:18

Hi everyone,

This is my very first post - I mean Question post.

I was doing a lot of Google search to find whether there is some free board game API or not, like **Werewolf board game**. That I can:
* GET instruction.
* GET role cards.
* etc.

I would appreciate any comments.
*Vietnamese accepted*
Looking to remove duplicated code? Try codesim
Tags: python, showdev, opensource
Published: 2020-10-03 07:42:37

Hi dev community. 
I just released a new tool that can be helpful for you. 
It's called "codesim" (on github: https://github.com/aclarembeau/codesim). 
It's a utility that can help you to find duplicated parts of code in your sources. 

You can get it calling: 

```
wget --no-cache https://raw.githubusercontent.com/aclarembeau/codesim/master/main.py -O /usr/local/bin/codesim ; chmod +x /usr/local/bin/codesim
```

And use it with the following params: 

```
usage: codesim [-h] [--exclude EXCLUDE] [--ratio RATIO]
               [--min-lines MIN_LINES]
               dir


positional arguments:
  dir                   Directory containing all the source files

optional arguments:
  -h, --help            show this help message and exit
  --exclude EXCLUDE     Exclude files matching the given pattern (ex:
                        node_modules)
  --ratio RATIO         Minimum percentage of common code (default: 0.9)
  --min-lines MIN_LINES
                        Minimum number of common lines (default: 10)
```

It produces a table of all the duplicated parts of your code and can be really helpful, for instance, when doing web projects. 

```
== Results ==

changes	ratio	lines a	lines b
6.00	0.92	37	37	./projects/hook_logs/_index.html.haml -> ./admin/hook_logs/_index.html.haml
```

If you like it, don't hesitate to leave me a star on Github :) 

Best,
Change Android system sound on SM-G770F
Tags: android
Published: 2020-10-03 07:24:15

This guide will show you how to replace the basic system sound in /system/media/audio/ui which means you can customize all sounds including:
- Charging started.
- Low battery.
- Volume up/down sound.
- key feedback.
- Device Lock/Unlock.
- all default notifications.
/!\ Your phone must be rooted with Magisk. 
/!\ Note: The changes made to the /system folder are persistent and will remain even after a factory reset. So, please be careful with the adb shell commands. It's good idea to backup your original sound. 

Tools you need:
- Adbd insecure (available on Google play and on XDA forums).
- adb root Magisk module (Can be downloaded directly from magisk).
- SDK platform-tools_r30.0.4 (Windows)
- Audio files converted to .ogg and rename them to correspond to the ones in /system/media/audio/ui I used www.convertio.co to convert files.

The tools above cost a penny, and you can find free version on the XDA threads.

1- Install the Adbd insecure;
2- Download the Adb root zip file. Then From Magisk on your phone add the Adb root module and activate it. Now reboot your phone.

3- Open Adbd insecure and activate it.
4- On your computer extract the platform-tools and start a powershell from there.
5- run ./adb root
6- adb shell mount -o rw,remount /
7- push "filname.ogg" /system/media/audio/ui

When you done pushing your files, remount the partition as read only.
8- adb shell mount -o rw,remount /
I am first with dev.to posting
Tags: php, css
Published: 2020-10-03 07:10:57

I worked for alwaysbeingclose.com launch from march of 2020 to June of 2020. 
For now , it is online. I invested all my income from my development works.
But for now, i don't have income and don't have investor. so it is in danger point.
I am looking for someone that can help me for this to find out good investor.
Thanks.
Rarely known Javascript Tips
Tags: showdev, javascript, node, tutorial
Published: 2020-10-03 07:04:36

JavaScript is a dynamic computer programming language.

It is an interpreted programming language with object-oriented capabilities.

</br>
👇👇💡Javascript Tips 💡👇👇








💡 Javascript Tip 1️⃣ 

The bitwise OR operator can also be used to remove any amount of digits from the end of an integer.

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



💡 Javascript Tip 2️⃣ 

The 𝘀𝘁𝗿𝗶𝗻𝗴𝗶𝗳𝘆() method takes two optional parameters:
👉 a replacer function, which you can use to filter the JSON that is displayed
👉 a space value

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d4e5taxgaowlzow3bt45.png)
</br>

💡 Javascript Tip 3️⃣ 

There is a very simple way to empty an array in Javascript:

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

💡 Javascript Tip 4️⃣ 

We can await multiple async functions to finish by using Promise.all

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6xyyq4r1jthvdaeemoug.png)

💡 Javascript Tip 5️⃣

Javascript ES6 Concepts

👉 map()
👉 reduce()
👉 filter()

Interesting illustration 👇

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wlvqjsgx75h08p93uvfo.jpg)
 
💡 Javascript Tip 6️⃣

Short circuit conditionals

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


Note : Will be updating this post further 

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

To get to know more technical stuff, connect with me via [Twitter](https://twitter.com/Dhanush_Nehru)