teleren/devto huggingface dataset:
Building an OpenStreetMap Gutenberg block for WordPress and rethinking the UX of adding locations
Tags: wordpress, gutenberg, openstreetmap, webdev
Published: 2020-09-16 08:15:25

Google Maps is great and the free quota is more than enough, but having to ask your clients to register, and provide a valid credit card to use the API, can cause some inconvenience and even cost you a few extra hours of work just to provide support, making sure that the setup is successful.

So, I thought I'd build a map block for Gutenberg that uses [OpenStreetMap](https://www.openstreetmap.org/) and [Leaflet.js](https://leafletjs.com). It needs no API keys and works out of the box (or, out of the Block, if you prefer). Benefiting from Gutenberg's potential, the plugin tries a different take on how to add your locations on the map and rethinks a few things, UX-wise.

Instead of manually adding coordinates for each marker, just click-and-drop them directly on the map, and drag to adjust their position. Instead of filling-in custom fields to set each marker's popup content, just open that popup and start writing in it, the Gutenberg way (it supports WYSIWYG editing, with links, images, and all). It can also store the map's zoom level as you use it so that you don't have to set it by hand.

{% youtube FGe7zJnrIgo %}

### Features

* No need for API keys. Just install and use it.
* Support for multiple markers.
* Dead-simple interface. Don't search for coordinates and don't get overwhelmed by too many fields when using multiple markers. Just point and click on the map to add your marker where you want it and edit it's popup content directly from there.
* Remembers the zoom that you set when adding the markers and stores it so that you don't set it by hand (which you can do anyway if you prefer).
* Adjust the map height.
* Change the default marker icon with a custom one.
* Enable or disable map dragging.
* Enable or disable touch zoom.
* Enable or disable double-click zoom.
* Enable or disable scroll wheel zoom.
* Set a minimum and maximum limit that the user can zoom on the frontend. Setting the same value to both fields will lock the zoom at that level.

If you are interested to give it a try, you can find it here:

* [WordPress.org](https://wordpress.org/plugins/ootb-openstreetmap/)
* [GitHub](https://github.com/gsarig/ootb-openstreetmap)

PS: For those who would like to read a few more details, I've also written an [article regarding a few interesting UX challenges](https://www.gsarigiannidis.gr/wordpress-gutenberg-map-block-openstreetmap) that I've came across during its development. As I explain there, I believe that the location search with autocomplete capabilities is an essential tool for the plugin’s UI to be complete. It’s a big feature, though, which needs some good thinking and careful implementation to make it as user-friendly as possible. So, I thought I’d release that basic version first, so that people start using it, and fix possible bugs before continuing to implement new features.
Typescript for beginners: adding typescript to your projects with parceljs
Tags: typescript
Published: 2020-09-16 08:11:55

There are many ways to add typescript to your project. Some require a huge amount of configuration and some are as easy as adding several code lines. I think one of the easiest ways to do so is to use a bundling tool like parceljs. With it, you can add typescript in a matter of minutes with pretty much no config required.

 ## What the heck is parceljs?

Parceljs is a super-fast web application bundler that works straight out of the box. I'm sure everyone has heard about webpack and while it is more powerful, it is a lot harder to set it up correctly.

## Ready? Let's add typescript to our project

 !!! Before we do anything, make sure that you have `nodejs` and `npm` installed !!!

 To check whether we have those technologies installed use command in your terminal:
```
node --version
 // v12.18.4
npm --version
// 6.14.6
```
If you don't have them installed, please go to :
* https://nodejs.org/en/ to install nodejs
* https://docs.npmjs.com/downloading-and-installing-node-js-and-npm guide to install npm

In the terminal create a new folder and move to it
```mkdir my-awesome-ts-project && cd my-awesome-ts-project```

The next step is to add `package.json`
```terminal
npm init -y

// we will get
{
  "name": "my-awesome-ts-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
```

We are almost done, the next step would be to add parceljs and typescript with `npm install --save-dev typescript parcel-bundler`

And that's it! Now you can create your `.html` and `.ts` files. Add script tag and voulia, typescript is ready!
```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
<script src="app.ts"></script>
  </body>
</html>
```

One more thing, you will need to add one more line in `package.json` to start your local development with parceljs.

Add this line to `scripts{}` section `"start": "parcel index.html"`

Your final `package.json` will look like this:

```javascript
{
  "name": "my-awesome-ts-project"",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "parcel index.html"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "parcel-bundler": "^1.12.4",
    "typescript": "^4.0.2"
  }
}
```

And that's it, now just run the command `npm run start` and it will start the local development server.

`app.ts` file will be compiled into javascript automatically, so you can write typescript like there's no tomorrow.
Ruby 2.8 adds endless method definition
Tags: ruby
Published: 2020-09-16 08:09:38

---
title: Ruby 2.8 adds endless method definition
published: true
description: Ruby 2.8 adds endless method definition
tags: Ruby
//cover_image: https://direct_url_to_image.jpg
---

[Ruby 2.8 adds endless method definition](https://blog.bigbinary.com/2020/09/15/ruby-2-8-adds-endless-method-definition.html)
Mua Vé Số Mỗi Ngày Cũng Là Một Cách Đầu Tư Dài Hạn
Tags: muaveso, ketquaxoso, choiveso
Published: 2020-09-16 08:05:46

Có bao giờ bạn tự hỏi tại sao có những người rất hay trúng số, còn mình mua hoài vẫn không trúng?
Đầu tiên, bạn nên ngẫm nghĩ xem là " mình mua hoài " là bao lâu bạn mới mua một lần? Hay thỉnh thoảng bạn chỉ mua cho vui hoặc mua vì muốn giúp đỡ 1 cụ già, 1 em bé hay một người bán vé số dạo bị tật nguyền với xấp vé số dày cộm trên tay? Theo thống kê thì những trường hợp này rất hiếm khi trúng, nếu trúng cũng chỉ là những giải nhỏ như giải 8, giải 7.
Còn những người mà bạn nghĩ là trúng hoài thật ra nhóm người này chơi vé số rất có nghiên cứu và đầu tư:
- Về mặt nghiên cứu: họ thường xuyên theo dõi kết quả xổ số (https://bit.ly/3mmQwyp) mỗi ngày. Dựa trên các thống kê có sẵn của các trang web xổ số, cộng với lập luận của riêng mình, họ sẽ tính toán những con số theo họ là đẹp nhất. Khi có được những con số này, họ sẽ tìm mua ngay những tấm vé số có in những con số trên. Có những người mua vé số bằng cách nuôi số theo tuổi của mình cũng rất có hiệu quả.
- Về mặt đầu tư: không phải chỉ thỉnh thoảng mua vé số, mà họ mua đều đặn hàng ngày. Mua số lượng nhiều hay ít phụ thuộc vào túi tiền của họ thôi.
Theo thống kê thì trường hợp này có rất nhiều người trúng, có khi trúng cả giải đặc biệt. Phần lớn còn lại là trúng những giải cũng không phải nhỏ như các giải 3, giải nhì, giải nhất...
Theo những người thích chơi xổ số có nghiên cứu thì mua vé số hàng ngày cũng là 1 cách đầu tư tài chính dài hạn. Họ lập luận rằng:
- Nếu mỗi ngày bạn để dành ít nhất 10.000đ (giá trị của 1 tờ vé số hiện nay) hoặc vài chục nghìn đồng. Thì sau vài năm bạn cũng chỉ để dành được vài chục triệu là cùng, chưa kể đến lúc đấy đồng tiền sẽ mất giá.
- Còn nếu mỗi ngày bạn chịu khó đầu tư mua vé số, 1 tờ hoặc 2-3 tờ có nghiên cứu kỹ lưỡng. Thì số tiền bạn trúng được từ việc mua vé số lớn gấp nhiều lần so với việc bạn để dành tiền và trong thời gian ngắn hạn hơn.
Tóm lại là dù có chơi gì đi nữa, nếu bạn có sự đầu tư và tính toán có cơ sở, thì vẫn chắc chắn hơn là chơi theo 1 cách may rủi.
Chúc bạn may mắn và có những quyết định sáng suốt cho riêng mình.
Build a Pomodoro clock using Github actions!
Tags: actionshackathon, github, opensource, showdev
Published: 2020-09-16 07:48:14

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


# My Workflow


My SMS Alert
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4ogae89ucw9ku60fafbe.jpeg)
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)

My email Alert
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7zgf2uppd65ezjcwxjg9.jpeg)


Hey there, lovely people of the internet, this is my second post for Actions Hackathon. This time, I have built a pomodoro timer using python and implemented it using github actions. I made it keeping in mind the burnout we developers face after a certain point. 🐞


Just another normal day in our lives, when there is a huge task to complete or to finish a project or assignment on time, we end up thinking that we can drive straight through it but we get tired and exhausted. Most of us can stay focused on a task for at most 35-45 minutes, after that our mind starts wandering and you will never know where that 1 hour went missing ( give it back!!) 

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

Here comes our saviour, *drumrolls* the Pomodoro technique! 🍅
 The Pomodoro timer instills a sense of urgency where rather than feeling like you have endless time in the world to get things done, you know you only have 45 minutes to make as much progress on a task as possible. (It's only 45 mins, you can do it!)⏳
And breaks? You get a whole 15 minutes to chill after each 45 min session. 


This technique has been extremely useful for me and I wanted to make it easy to use for the community as well. Github Actions enabled me to do the exact same and I made a beneficial use of it.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/howd9wlqrkhtf6hw4ac1.png)
 
My timer implemented with the help of Github Actions sends me a notification every 45 minutes, when my work is over and every 15 minutes when my break gets over. I have used Twilio to send me the SMS on my mobile phone and Mailgun to send me the email alert. 

Here's a look at my newly created Github action!

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

To use it for yourself, setup an account in Twilio and Mailgun. Just create the secret variables with the same names I have created and put your own information, like api keys, phone number, email etc. Set the secret variable IS_ACTIVATED to 0 to stop receiving any alerts and set it to 1 to turn on the pomodoro clock.    



### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)

Category 1: Wacky Wildcards
Category 2: Phone Friendly


### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)

{% github https://github.com/aishikamidder05/pomodoro-clock %}





Hope you find my post useful. Thanks for reading till the end.
Adios! ^_^
Publish to Snapcraft Store
Tags: actionshackathon
Published: 2020-09-16 07:41:43

### Publish Kustomize automatically to Snapcraft Store

I usually work with Kubernetes clusters for deployment and a tool called [kustomize](https://kustomize.io/) to manage the manifests.

I recently started using Snapcraft apps on Ubuntu and found that Kustomize is not available in their store. So, I decided to put together a Github action that will publish automatically the latest version of Kustomize to the Snapcraft store.

The Github Action is scheduled to run daily. It checks if there is a new version of Kustomize available on their Github Repository. If so, bundle and publish it as a snap to the Snapcraft Store. Kustomize is popular on Snapcraft Store. https://snapcraft.io/kustomize  

### Submission Category: DIY Deployments


### Yaml File or Link to Code: https://github.com/abskmj/snapcraft-kustomize


### Additional Resources / Info
The core implementation is a NodeJS script.
How to Set PDF Viewer Preference in Java
Tags: java, pdf
Published: 2020-09-16 07:32:14

PDF viewer preference allows users to view PDF documents with their viewing habits. They can set the page layout of the PDF document and choose whether to display it in full screen, whether to hide the menu bar/toolbar, etc. This article will introduce how to set the viewer preference in a PDF document by using Free Spire.PDF for Java.

**Installation**
**Method 1:** Download the [Free Spire.PDF for Java](https://www.e-iceblue.com/Download/pdf-for-java-free.html) and unzip it.Then add the Spire.Pdf.jar file to your project as dependency.

**Method 2:** You can also add the jar dependency to maven project by adding the following configurations to the pom.xml.
```xml
<repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.pdf.free</artifactId>
        <version>2.6.3</version>
    </dependency>
</dependencies>

```


**Set Viewer Preference:**
```java
import com.spire.pdf.*;

public class ViewerPreference {
    public static void main(String[] args) {

        //Load the PDF file
        PdfDocument pdf = new PdfDocument();
        pdf.loadFromFile("Walt Whitman.pdf");

        //Center the window
        pdf.getViewerPreferences().setCenterWindow(true);
        //Hide title
        pdf.getViewerPreferences().setDisplayTitle(false);
        //Fit the window size
        pdf.getViewerPreferences().setFitWindow(true);
        //Hide menu bar
        pdf.getViewerPreferences().setHideMenubar(true);
        //Hide tool bar
        pdf.getViewerPreferences().setHideToolbar(true);
        //Set two-column page layout
        pdf.getViewerPreferences().setPageLayout(PdfPageLayout.Two_Column_Left);
        //Set full screen display
        //pdf.getViewerPreferences().setPageMode(PdfPageMode.Full_Screen);
        //Set print scaling
        //pdf.getViewerPreferences().setPrintScaling(PrintScalingMode.App_Default);

        //Save the file
        pdf.saveToFile("Preference.pdf");
        //Close
        pdf.close();
    }
}
```

**Output:**
![](https://dev-to-uploads.s3.amazonaws.com/i/u4i24qddnhkzg7pxmo3z.png)
100DaysOfCode | Day 38, 39
Tags: python, beginners, 100daysofcode, challenge
Published: 2020-09-16 07:20:42

▄█ █▀█ █▀█ █▀▄ ▄▀█ █▄█ █▀ █▀█ █▀▀ █▀▀ █▀█ █▀▄ █▀▀
░█ █▄█ █▄█ █▄▀ █▀█ ░█░ ▄█ █▄█ █▀░ █▄▄ █▄█ █▄▀ ██▄


2 Days Off!
Actually, I was working on a F*cking bug in the VSCode!

__Unresolved import SQLAlchemy__ without any reason :(

So I thought that would be better to make a new directory and move all of my files there, and Damn! 

Same code, different directory, No Error!!!!

I removed all of my codes and the new directory, I decided to fix that bug anyway...

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gclztrrk3i4xmf5gvbzj.jpg)<figcaption>__Banging my head to the wall due to an error!__</figcaption>

I thought, let's reboot my system several times.

First time ----> Nothing happened, error still existed ...

Second time ----> Same to first one

.
.
.
.
10th time ----> error has gone! after 10 times of rebooting :)


I'm so happy cause finally, I found a way to share with you to fix your errors and bugs.

Doesn't matter what the hell it is, just try and fix it.
It worth it


#Keep Moving Forward ツ

##Enjoy Your Journey 👊

##Code with 💛

__🅑🅐🅝🅙🅘__
React v17.0: No new features
Tags: react, showdev, javascript, reason
Published: 2020-09-16 07:06:56

After a two and half-year long break, three days back ReactJS has released a new RC for React V17.0. Many of us might get disappointed with the headline mentioning No New Features. Which means they are not providing new developer-facing features. Instead, it focuses on react itself.
 
The React 17.0 makes itself to upgrade easier. Previously if we want to upgrade react we need to upgrade all or none. But after V17, you can partially upgrade your application to the newer version. Which means multiple react version can run inside a single application.
 
To accommodate this feature they need to modify a few other things as well. One such major break is on Event Delegation. Previously React actually attaches most of the event listeners to the document itself. But now, they are attaching these events to the Root node. Which means, all the events are attached to their respective root nodes. This makes it easier to have multiple react versions under a single document. 
 
To surprise you more, this change makes easier to embed the React with other technologies such as JQuery. 
 
They have fixed many potential issues and added more breaking changes. To know more about the conference visit this link

https://reactjs.org/blog/2020/08/10/react-v17-rc.html
What are prerequisite for learning angularjs?
Tags: angular, career
Published: 2020-09-16 06:54:38

HTML : Most of the templates we create in angularJS is in the form of handcrafted htmls. i.e. So you must know that what are forms in html and what are tags ng-form etc.

CSS : While hand crafting template you should require css to make more attractive UI design.

DOM : Document object model and how document is created. If you have good jquery background you can easily pick up this part.

Object Oriented JavaScript: Global name space: AngularJS heavily uses javascript name space.

Object Oriented JavaScript: Inheritance: Inheritance is very important concept in JavaScript. Inheritance is heavily used in all the frameworks in JavaScript.


Model View Whatever(MVW): This term is used heavily by all AngularJS developers. It is coined by Google. It is simple MVC concept.

Separation of Concern(SOC): SOC concept is heavily used in AngularJS. In angularJS all the controllers, directive, services and factories are made for SOC. It provide more lean and cleaner code. Also re usability automatically increases if you use SOC concept.

Promises : Promises are nothing but callbacks. When you call any AngularJS service it will be called asynchronously. When response is send from service callback hold the response and do the needful.

Test Driven Development : Best thing about AngularJS is you can easily write test script so that when you go home, you can easily have sound sleep.

Meet the Experts for Better Guidence : https://nareshit.com/angularjs-online-training/
CPU Usage Hike Issues on Wordpress - 100% Working 
Published: 2020-09-16 06:49:41

For Developer, CPU Usage Hike is one of the significant issues webmasters face with shared hosting. Yeah, if using shared hosting for a website that gets 10+ real-time traffics, CPU gets overloaded. This is when the site has more chance of returning a 502 error. 

I recently faced the same situation and did all available troubleshooting methods to reduce the CPU usage, but in vain. Finally, I sat on the scholar's table and tried different permutations and combinations and then finally. Eureka. I fixed this pressing issue by myself.

There is a lot of advice/suggestions that are already there on the internet to sussing this issue. Still, most of them end with a recommendation to remove the plugin or check with the theme file or some tweaks in wp-config/PHP files.

Yeah… some of these definitely help, but beyond all these, there is one major fix that not many has explored, especially for WordPress sites hosted in a shared server. 

I'm talking about Cron Jobs Controlling techniques. Yes, it may seem a bit complicated because you need to adjust every WP element to get CPU usage under control. 

Basically, Corn Jobs is nothing but Scheduling events from WP or any other plugins running in the backend. This is no game for the beginner as these changes can either make or break your website, which means the method is meant only for a skilled and experienced PHP developer.

Defining ('disable-Cron,' true) on the wp-config.php file will activate it. Yes, of course, it works, but what about existing Cron jobs? 

First, you have to identify the number of Cron jobs running in the site background and assess each's purpose.
It's certain that you may find a few that are being run or activated for no specific reason. Such Cron jobs have to be identified modified. (Either you can remove it or change the frequency.)

For example, there is one Cron job running twice daily to check WP Version releases. It's important, but it doesn't have to trigger twice a day, right? So, we can change the frequency level to maybe weekly once or monthly twice.

As same can be done for plugin updates. Adjust the pre-set Cron Jobs that is causing unnecessary CPU hike. These are Cron jobs that are majorly affecting the core performance of your server. 
You can sense a big change or improvements after these Cron jobs are adjusted or modified.

Mostly Cache plugins/backup plugins/compression plugins/Core WP plugins are the culprits. They have a high number of Scheduled Cron Jobs. 

Want help implementing this? <a href="https://www.linkedin.com/in/siva-prakash-n/"> Ask me here.</a>

Applied this techniques for my clients site as my friends one, <a href="https://www.youreducationportal.com/"> Your Education Portal </a> | <a href="https://www.openeducationportal.com/"> Open Education Portal </a>
Mint 🍃: 0.10.0 
Tags: mintlang, webdev
Published: 2020-09-16 06:43:09

**Mint 0.10.0 is released!**

- Directives
- Updates to providers
- Additions to the standard library
- Keyword parameters for enums
- Bugfixes and more!

Head over to the read the blog post on the official site: https://www.mint-lang.com/blog/mint-0.10.0

You can check out the actual change log here: https://github.com/mint-lang/mint/releases/tag/0.10.0
Scrape Mobile App Data With | Web Screen | Scraping Services Provider
Tags: python, ios, android
Published: 2020-09-16 06:42:32

Technologies can be complex and at times important data is secret in the layered mobile app coding. However, that doesn’t need to keep you outperform, get professional mobile app scrapers to hire from Web Screen Scraping, a leading web scraping company USA with satisfying Android and iOS app scraping using Python platform.

Mobile applications have become an important part of all businesses to offer them high-end products and services to the core users. Though, with that, it is also commanding that you are investing in scraping using data from competitors to do better in the competition.

**Application Web Content** 

-You can scrape information with in applications and detailed applications in addition to consumers from the application get extracted.

**Content Compliance Monitoring**

Using this, you can have content compliance monitoring between mobile applications as well as the website’s web version.

**Application Framework**

Mobile app scraping helps you get data about inter linking between MVC architecture and application UI.

**Real-time Mobile App Scraping**

It helps you extract data in real-time, very useful for the businesses, which deal food industry, travel, or e-commerce.