teleren/devto huggingface dataset:
Persistent notifications in notification bar (e.g. countdown timer, stopwatch)?
Tags: pwa, mobile, reactnative, discuss
Published: 2021-04-26 12:00:37

I'm trying to decide whether I should create a React Native app at this point or if I can wait a little longer.

My app has a countdown timer showing how long is left of the current task. I want to show a persistent notification when the timer is active and has time remaining so I can swipe down and see how long it will be before the next notification. I might also want to embed actions (e.g. Done or Add 1 minute) that would cause actions to happen in the background.

But I'm not sure if PWAs even have the concept of running in the background. I'm not that experienced with them yet and am at the stage where I'm thinking about if it's worth it or if I should go straight for a mobile app.
Daily Developer Jokes - Monday, Apr 26, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-04-26 12:00:19

---
title: "Daily Developer Jokes - Monday, Apr 26, 2021"
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=Monday%2C%20Apr%2026%2C%202021"
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/5e12592f4bd15.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:___ Why do Java developers wear glasses?

___A:___ Because they don't C#!
 -->
Why is .nxt not acting as a selector in Jquery
Tags: jquery, dom, html, css
Published: 2021-04-26 11:59:54


https://code.sololearn.com/WA77a102a0a1/#
<!DOCTYPE html>
<html>
	<head>
		<title>Page Title</title>
		<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
	</head>
	<body>
		<ul class="quiz" >
    </ul>
    <button class="submit " id="submit">go  </button>

	</body>
</html>

$('document').ready(function(){
$(".submit").click(function(){
   
  $("#submit").text('something');
  $('#submit').addClass("nxt");
  $('#submit').removeClass('submit');
//    $('.quiz').text('i am working');
console.log($('#submit').hasClass('nxt'));
   });
  $(".nxt").click(function(){ //here is problem
   $('.quiz').text('i am not working');//here is problem
      console.log($('#submit').hasClass('nxt'));//here is problem
   
  });
})
Lucid is live!
Tags: launch, crm, saas
Published: 2021-04-26 11:56:02

---
title: Lucid is live!
published: true
description: Lucid, the micro-CRM that I've been working on for the past 6 months is now live
tags: launch, crm, saas
//cover_image: https://direct_url_to_image.jpg
---
Last week I launched [Lucid](https://golucid.app), and launched it on Product Hunt and it received 21 upvotes. 21 upvotes isn't a lot, I know that. But when I launched Lucid on Product Hunt I didn't even expect 1. To get 21 after a week and to have a couple of users actively engage with a comment is unbelievable to me.

Lucid is a micro-CRM that helps small business owners manage their business leads, manage their customers and grow their business by removing a lot of the bloat that modern CRMs provide and going back to basics. And removes the drama of having to configure Mail records to use it, whereas most CRMs require Mail records to be set up. I have so many ideas and features that I will be working on and adding to the product over the next couple of weeks and months, so keep an eye out for updates! 

If you have a spare minute and would like to show your support for Lucid, I would really appreciate any support on [Product Hunt](https://www.producthunt.com/posts/lucid-8)
ลองเล่น go package จาก GitHub แบบไม่ง้อ go.mod 
Tags: go
Published: 2021-04-26 11:51:40

ถ้าสมมุติว่าเราเห็น package ที่น่าสนใจอื่นๆนอกเหนือจาก standard library ใน go แล้วอยากเอามาลองเล่น

ยกตัวอย่างเช่น  https://github.com/kelseyhightower/envconfig

สร้าง `main.go` ขึ้นมาจากนั้นก๊อป code ในตัวอย่างไปแปะ
 
```go
package main

import (
    "fmt"
    "log"
    "time"

    "github.com/kelseyhightower/envconfig"
)

type Specification struct {
    Debug       bool
    Port        int
    User        string
    Users       []string
    Rate        float32
    Timeout     time.Duration
    ColorCodes  map[string]int
}

func main() {
    var s Specification
    err := envconfig.Process("myapp", &s)
    if err != nil {
        log.Fatal(err.Error())
    }
    format := "Debug: %v\nPort: %d\nUser: %s\nRate: %f\nTimeout: %s\n"
    _, err = fmt.Printf(format, s.Debug, s.Port, s.User, s.Rate, s.Timeout)
    if err != nil {
        log.Fatal(err.Error())
    }

    fmt.Println("Users:")
    for _, u := range s.Users {
        fmt.Printf("  %s\n", u)
    }

    fmt.Println("Color codes:")
    for k, v := range s.ColorCodes {
        fmt.Printf("  %s: %d\n", k, v)
    }
}
```



```
go get 
```
เราจะเจอกับ error ที่บอกว่าหา go.mod ของเราไม่เจอ
```
go run main.go

go: go.mod file not found in current directory or any parent directory; see 'go help modules'
```

ใหไปเช็คที่ `go env` ก่อน ว่าค่า `GO111MODULE=auto` รึยังถ้ายังก็เปลี่ยนมันซะ

```
go env -w GO111MODULE=auto
```
จากนั้นให้ `go get` อีกรอบคับ 

```
go get 
```

```
export MYAPP_DEBUG=false
export MYAPP_PORT=8080
export MYAPP_USER=Kelsey
export MYAPP_RATE="0.5"
export MYAPP_TIMEOUT="3m"
export MYAPP_USERS="rob,ken,robert"
export MYAPP_COLORCODES="red:1,green:2,blue:3"

go run main.go

Debug: false
Port: 8080
User: Kelsey
Rate: 0.500000
Timeout: 3m0s
Users:
  rob
  ken
  robert
Color codes:
  red: 1
  green: 2
  blue: 3
```

สำหรับคนที่พึ่งลง go 1.16 อาจจะไม่เจอปัญหานี้
เพราะว่าค่าของ `GO111MODULE` น่าจะเป็น `auto` มาอยู่แล้ว

จริงๆ มันก็มีวิธีสร้าง go mod ที่เร็วกว่าวิธีนี้อยู่เหมือนกัน นะ 🤣

Ref: https://blog.golang.org/go116-module-changes
Spring Batch – Programmatic Flow Decision
Tags: springbatch
Published: 2021-04-26 11:50:04

https://grokonez.com/spring-framework/spring-batch/spring-batch-programmatic-flow-decision

Spring Batch – Programmatic Flow Decision

In the article, <strong>JavaSampleApproach</strong> will introduce about Programmatic Flow Decisions in Spring Batch.

Related Post: <a href="https://grokonez.com/category/spring-framework/spring-batch" target="_blank">Spring Batch</a> 

<!--more-->

<iframe width="853" height="480" src="https://www.youtube.com/embed/sW6yiGOJ8cI?rel=0" frameborder="0" allowfullscreen></iframe>
<div id="tuttoc" class="jsa-toc"></div>

<div id="tutcontents">
<h2>A. Concept</h2>
Spring Batch provides mechanics for controlling the flow steps of batch job: <strong>JobExecutionDecider </strong>interface & <strong>decision</strong> tag
<h4>1. JobExecutionDecider</h4>
The interface allowing for programmatic access to the decision on what the status of a flow should be.
In here we need overwrite the function:<strong> FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution)</strong>: Strategy for branching an execution based on the state of an ongoing. The return value will be used as a status to determine the next step in the job.

<pre><code class="language-java">
package org.springframework.batch.core.job.flow;

import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;

/**
 * Interface allowing for programmatic access to the decision on what the status
 * of a flow should be.  For example, if some condition that's stored in the 
 * database indicates that the job should stop for a manual check, a decider
 * implementation could check that value to determine the status of the flow. 
 * 
 * @author Dave Syer
 * @since 2.0
 */
public interface JobExecutionDecider {

	/**
	 * Strategy for branching an execution based on the state of an ongoing
	 * {@link JobExecution}. The return value will be used as a status to
	 * determine the next step in the job.
	 * 
	 * @param jobExecution a job execution
	 * @param stepExecution the latest step execution (may be null)
	 * @return the exit status code
	 */
	FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution);

}</code></pre>

<h4>2. "decision" tag</h4>
<strong>"decision"</strong> tag specify the decider to use as well as all of the transitions
Example:

More at:

https://grokonez.com/spring-framework/spring-batch/spring-batch-programmatic-flow-decision

Spring Batch – Programmatic Flow Decision
Cheatsheet: Build IOS ipa from Cordova command line.
Published: 2021-04-26 11:46:36

This is a simple, tiny cheatsheet for building an ipa from cordova command line.

To upgrade your cordova IOS version:
```npm update -g cordova
npm i cordova-osx```

To create a new cordova project:
```cordova create [folder_name] [app_id] [app_title]```

To add platforms to the project:
```cordova platform add ios@6.1.0    
cordova platform add android```

To manual add plugins:
```cordova plugin add path/to/cordova-plugin-name ```

To get a plugin from git and then add it:

```cd plugins 
git clone https://github.com/PROJECT/cordova-plugin-name.git```

To build:
```cordova build ios
cordova build android```

Once you've build it, you need to go to Xcode, to generate the IPA file:

1. Open the workspace
open ./platforms/ios/[app_title].xcworkspace/
2. Inside the project preferences, set the sign keys for development and release
3. Set the "device" to "Generic IOS device" to compile.
4. Go to product > archive
5. Done!

That's all folks!
Weekly Growth Goals | Podcast
Tags: productivity, webdev, javascript, vue
Published: 2021-04-26 11:45:03

{% spotify spotify:episode:1qH7INfRp8oXaSbMuFRBoR %}

## What is HTML All The Things

HTML All The Things is a [web development podcast](https://podcast.htmlallthethings.com/) and [discord community](https://discord.com/invite/jweMCx9) which was started by Matt and Mike, developers based in Ontario, Canada. 

The podcast speaks to web development topics as well as running a small business, self employment and time management. You can join them for both their successes and their struggles as they try to manage expanding their Web Development business without stretching themselves too thin. 

## What's This One About?

In this episode Matt and Mike discuss weekly growth goals with a focus on the soon be released Weekly Growth Goals web app. The duo discuss the concepts and tech stack behind the web app, going through how the app was designed, how decisions were made, and the struggles that were found along the way. 

The Weekly Growth Goals application is currently in alpha. Just for testing the core functionality. If you're someone that's excited to test applications and wants to try creating some weekly growth goals, you can check it out here: (Currently the backend is hosted on Heroku's free tier so initial loads can be longer due to spin up)

[www.weeklygrowthgoals.com](https://www.weeklygrowthgoals.com/)

We have a public trello board for the application so that you can follow along with the development, bug fixing and deployment of the app. 

[Weekly Growth Goals Trello Board](https://trello.com/b/IKAChzv5/weekly-goals-app)

## Show Notes

1:50 - Why Weekly Growth Goals?

15:20 - Goals for the app

17:00 - What the app does

29:10 - How it was built

1:01:45 - What's left to build?


##Key Takeaways

* Micro habits will eventually build into something solid. Focusing on one thing a week and trying to get a habit started is a more manageable accomplishment then starting with a whole life plan. 
* We take features for granted. Every piece functionality can become a rabbit hole of logic. Building out a karma/upvote system seems simple but still has multiple hurdles to get through. For example, how do you stop people from upvoting the same goal multiple times, or upvoting their own goal?


##Social Links

You can find us on all the podcast platforms out there as well as

[Instagram (@htmlallthethings)](https://www.instagram.com/htmlallthethings/)
[Twitter (@htmleverything)](https://twitter.com/htmleverything)
[Facebook (Html All The Things)](https://www.facebook.com/htmlallthethings)
[Tiktok](https://www.tiktok.com/@htmlallthethings?lang=en)
Patch Notes V2.4.1 + explication crates
Published: 2021-04-26 11:01:31

Les crates

Nous avons enfin ajoutés les crates sur CocoricoMC ! 

Qu'est ce qu'une crate ?

Une crate est un coffre au spawn qui quand vous faites click droit avec une clé spéciale sur ce coffre, vous donne un item aléatoire parmis ceux qui sont présents dans la crate.

Comment ça marche ?

Si vous voulez acheter une crate sur CocoricoMC, vous devez faire /shop, et cliquer sur le crochet.

Après avoir cliqué sur le crocher il y aura un autre crochet qui va apparaitre dans le menu et vous devez l'acheter pour 10K$ In Game.

Après avoir acheté une Clé d'échange, vous devez vous rendre au spawn avec vos clés d'échanges et aller voir le PNJ se nommant : Guillaume près du dépot aérien, qui vous échangera des clés d'échanges avec des clés de crates :

Les prix : 

16 clés d'échange --> Clé de crate en Poliro
32 clés d'échange --> Clé de crate en Volcanite

Après avoir récupéré une/plusieurs clés, remontez et aller dans le petit stand avec 2 coffres. Et faites clique droit avec la clé sur le coffre qui lui correspond.
Tackling a common CSS Design problem: Footer placement at page or content bottom, whichever is lower
Tags: webdev, css, html, javascript
Published: 2021-04-26 10:49:13

This is one of those commonly occurring nags in web development which I've solved several times before but still have to scavenge the googles and stack-overflows each time I run into it. That's why I've decided to document the simple solution to it in this brief article.

What happens is that if you position your footer div and fix it at bottom of the page (`position:fixed, bottom:0, width:100%`), it will work great on shorter content pages (where you don't have to scroll). But the problem is that on longer pages too, instead of moving to the bottom of the content, it will be stuck there at the viewport bottom like an idiot!

![stuck viewport bottom footer](https://prahladyeri.com/uploads/stuck_viewport_bottom_footer.png)

The above situation can be seen in action in [this fiddle](https://jsfiddle.net/dwe8t6c5/10/show) where multiple "lorem ipsum" blocks (`<p>` elements) are placed to simulate content growth. You'll find that the footer will work flawlessly when the content is short (only 1-2 "lorem ipsum" blocks) but the footer gets stuck at the viewport bottom as you keep adding the blocks and they extend beyond the viewport height!

On the other hand, instead of positioning your footer, if you just let it be (this is what about 90% of coders initially do), you have another problem. Your footer will now be placed correctly on longer content pages where you must scroll but on the shorter pages, they'll be hanging in the middle of the page where your content ends as shown in [this fiddle](https://jsfiddle.net/dwe8t6c5/11/show).

![middle of page footer](https://prahladyeri.com/uploads/middle_of_page_footer.png)

There could be multiple approaches to solve this problem. I personally prefer the old school method which is quite simple and easy to understand. Besides, it doesn't require adding of any blank HTML element like "#offset" or "#placeholder" above your footer. All it requires is that all your HTML elements above the footer must be wrapped up inside one container div element. So, the body should be structured something like this:

```bash
HTML
..BODY
....div.container
......header1,
......article1,
........p,
......etc, etc.
....footer
```

Then all you have to do is set your div.container's minimum height to viewport's height minus footer's height. Assuming your footer's height is 55px, all you have to do is:

```css
div.container {
	min-height: calc(100vh - 55px);
}
```

You can see a working demo of this in [this fiddle](https://jsfiddle.net/dwe8t6c5/14/show). Even as you start adding more and more "lorem ipsum" paragraph elements, the footer will always be placed at the "right" place irrespective of other element's positioning and content size! This is what you'd call a "properly placed footer":

![properly placed footer](https://prahladyeri.com/uploads/properly_placed_footer.png)
How to Make your If Statements more readable by using this ES2020 Feature
Tags: javascript, codequality, codereview, todayilearned
Published: 2021-04-26 10:40:14

Have you ever written an if-statement like this?

```javascript
// The object we are working with
const car = {
  make: {
    name: "bmw",
    founded: 1916,
    country: "germany"
  }
}

if (car && car.make && car.make.name && car.make.name === "bmw") {
  // Do something.
}
```

In JavaScript, we often check if each property exists.
We do this because we don't want to run into errors.

**The only problem:**  

- It's ugly  
- It's harder to read than it needs to be  
- Noise-to-Signal Ratio is high  

## THE BETTER WAY

Thanks to [optional chaining](https://tc39.es/proposal-optional-chaining/) which is part of [ES2020](https://262.ecma-international.org/11.0/#sec-optional-chains), you can now do this:

```javascript
// The object we are working with
const car = {
  make: {
    name: "bmw",
    founded: 1916,
    country: "germany"
  }
}

if (car?.make?.name === "bmw") {
  // Do something.
}
```

- Beautiful  
- Easier to read  
- Noise-to-Signal Ratio is low  

In my opinion, it's the best way to check if a property exists in your if statements.
มองทุกอย่างให้เป็นโค้ด มองโค้ดให้เป็นทุกอย่าง
Published: 2021-04-26 10:29:11

เป็นคำพูดที่ผมพยายามจะนิยามความหลงไหลของตัวเองในการเป็น "โปรแกรมเมอร์"

ในคำพูดนี้จะถูกแบ่งออกเป็นสองส่วน

ส่วนแรก "มองทุกอย่างให้เป็นโค้ด"

ในความหมายของ"ส่วนแรก" ที่ผมต้องการจะสื่อคือว่า ผมมองโลกใบนี้ ด้วยแว่นตาของ "โลจิคทางโปรแกรมมิ่ง"
โลจิคทางโปรแกรมมิ่ง ค่อนข้างตรงตัวและตรงไปตรงมา เราสั่งซ้าย ไปซ้าย เราสั่งขวาไปขวา เราสั่งเดินหน้ามันเดินหน้า ทุกอย่างเป็นไปตาม "คำสั่ง" ทุกระเบียดนิ้ว หรือแม้กระทั่งความผิดพลาดที่มักเกิดขึ้นไม่ได้มาจากโปรแกรมตัวมันเอง แต่มักจะมาจาก "คำสั่ง"ที่สะเพร่าต่างหาก หาใช่ตัวโปรแกรมไม่

ด้วยแว่นตาเหล่านี้ผมสวมมันเพื่อมองโลก ผมมองทุกอย่างเป็นไปตามคำสั่งอย่างตรงไป ตรงมา มนุษย์ทำตาม "คำสั่ง" บางอย่างทั้งที่รู้ตัวและไม่รู้ตัว ความสมบูรณ์และความผิดพลาดย่อมเกิดจาก"คำสั่ง"ที่สวยงามและห่วยแตกในเวลาเดียวกัน

ดังนั้น ด้วยบทบาทความเป็น"โปรแกรมเมอร์"ผมมักจะมอง"ทุกอย่างเป็นโค้ด"ตามความหมายนี้

ส่วนสอง "มองโค้ดให้เป็นทุกอย่าง"

ในความหมายของ"ส่วนสอง" ในโลกของโปรแกรมมิ่ง ผู้คนที่คิดค้นทฤษฎีเกี่ยวกับโปรแกรมมักจะทำให้การเขียนโปรแกรม เป็นรูปธรรมให้จับต้องได้ในความคิด เพื่อให้ง่ายต่อการออกแบบควบคุมนามธรรมภายในตัวโปรแกรม

ทฤษฎีที่คลาสิคที่สุดก็คือ "โปรแกรมมิ่งเชิงวัตถุ" คือความพยามในการเปรียบเทียบ "รูปแบบ" การเขียนโปรแกรมให้คล้ายกับ "แบบแปลน" ในโลกของรูปธรรมให้มากที่สุด ที่ว่า ทุกๆแบบแปลนไม่ใช่ตัวบ้าน แต่ตัวบ้านที่ดีก็ต้องเกิดจากแบบแปลนที่ดี 

การเขียนโปรแกรมนี้จึงต้องอาศัยจินตนาการในโลกแห่งความเป็นจริง แล้วเทียบเคียงกลับไปหา การเขียนโปรแกรมในที่สุด

ดังนั้น ด้วยการเขียน"โค้ดที่ดี" ผมมักจะมอง"โค้ดเป็นทุกอย่าง"ที่คล้ายคลึงกับโลกแห่งความเป็นจริง
How to exit vim & learn vim in 5 minutes
Tags: beginners, codenewbie, webdev, vim
Published: 2021-04-26 10:19:30

- Press Escape, this puts vim in "normal mode".
- write :q! to quit without saving.
- write :wq to quit while saving the file.

That's it. Vim is pretty cool and fast once you learn how to use it.

Check this if you want to learn the basics of Vim in 5 minutes:
[Vim in 5 minutes](https://paulgorman.org/technical/vim5minutes.html)

<hr />

Follow me on [twitter](https://twitter.com/jordienr) for more.
I'm building a newsletter with tools, resources and news about frontend development [here](https://zerotofrontend.dev) if you're interested in that 🙂
5 Kinds of Applications That Can be Developed Using Python
Tags: python, webdev, android, ios
Published: 2021-04-26 10:18:34

When it comes to developing an app in a hassle-free way, Python remains one of the most popular programming languages among developers. As an object-oriented and high-level programming language, Python supports readability and capable of combining several development components together. These are some reasons why Python was declared as the top programming language a couple of years back.

Let’s go through the major reasons behind the growing popularity of Python before looking at the type of applications that can be developed using Python.

Why Python is so popular?

From code reusability to promoting modularity, Python offers many benefits to developers. Here are some of the key reasons why developers prefer to [build an app](https://www.suriainternational.com/types-of-apps-developed-using-python/) using Python.

Easy-to-understand Code
The syntax is one of the most popular features of the Python language. It has a way of simplifying complexities. Even beginners find it suitable for learning. As a reliable language, Python focuses on code readability, and therefore, it enables developers to use English keywords instead of punctuation. These characteristics make Python one of the best languages for developing customized enterprise apps.

With Python, developers can easily finish and execute all programs faster than the same with other programming languages. Also, when it comes to modifying or customizing the existing app, Python developers can do it without putting in extra effort.

High Compatibility
Python is highly compatible with all major operating systems including Android and iOS. Python interpreters can be used to run the code across all the platforms and tools. With Python, it is possible to run the same code across various mobile platforms. What’s more, Python facilitates developers to check the impact of changes in the code instantly.

Read More: https://www.suriainternational.com/types-of-apps-developed-using-python/