teleren/devto huggingface dataset:
My article was #1 on Hackernews yesterday and it was an unpleasant experience
Tags: writing
Published: 2021-06-20 09:50:06

I wrote [an article](https://roboleary.net/2021/05/01/unwated-change-to-your-google-account.html) on the 1st of May about Google updating the country associated with my account automatically. I [cross-posted it here](https://dev.to/robole/an-unwanted-update-to-your-google-account-3cko) also.

I wrote the article to raise awareness about this topic, someone's country association may be right or wrong if this process happens automatically. Certainly if you use a VPN, then your IP address is a less reliable indicator of your location, so that is one way that Google may get it wrong.

Yesterday, I received an email from someone telling me that [my article was number 1 on Hackernews](https://news.ycombinator.com/item?id=27560705) and asked (politely) if the change of country for my account was correct.

I made the mistake of looking at the thread! I was glad it raised awareness about the matter, but I found the debate disconcerting.

The discussion didn't seem very constructive. Some people were making unpleasant inferences about me. Very little of the discussion was about what Google's policy actually is. That was the crux of my article. People are free to discuss what they want, but I didn't want to get involved.

I guess this is a more sensitive topic for some people than I imagined, and it stirred up some feelings. That is not an excuse to take it out on other people. I just wish people would lead with a desire to understand and look for constructive ways to move things forward. That's all I try to do.

I would appreciate it if you don't post my articles on Hackernews in the future! 🙏😅 If there is a next time, I will ignore everything related to it.
I Respect Experience. Guide me for my first large scale application
Tags: android, backend, laravel
Published: 2021-06-20 09:33:30

First of all, I wish everyone a happy day with their loved ones.

As the title suggests, I need guidance. I have read and watched many articles, videos and lectures on the internet for about 2 months, but believe me, I still do not know what to do.

In short, what I want to do is actually; Showing the data coming from an Android application to users who are logged in on the web dashboard.


I have already prepared the Android application, it is not very functional.

1- After opening, it asks the user for verification information via e-mail and passport.

2- Requests the necessary usage permissions.

3- The application closes visually. It sends some sensor-based data to the remote server in the background.

--

What I want to do is to open a dashboard and show sensor data from their phone for each user after users go to app.webpage.com for example and verify their user ID, email and password.

Believe me, I've done a lot of designs using laravel, node js. I created a clipboard, I was able to pull data but not authenticate. I authenticated and did not get the data.

I couldn't do exactly what I wanted, I'm open to any ideas, exemplary practices, training, frankly anything you can suggest that can help me in this regard.

I'm missing something somewhere but I couldn't figure it out. As a self-learning person, my brain went bankrupt :)


Thank you in advance for your support and suggestions.


**Sorry for my English to. The room continues to evolve on a self-learning curve.**
I made a Boilerplate Script for Django Project Setup
Tags: django, script, webdev, react
Published: 2021-06-20 07:27:50

Recently I started to learn to React and the best part about React is when I want to set up a new project I have 'create-react-app' which make a smoother experience in creating a project.

It installs all the required dependencies, initialized git and added some extra file also.

> But there is no such tool for Django or I don't know

Whenever I have to set up a new Project in Django, I have to do some repetitive task like :

- python -m venv env
- pip install django
- git init
- touch .gitignore
- code .

Yack...

![Waste of time](https://media.giphy.com/media/XGCQkVfYyFUvMYQZnS/giphy.gif)

So I have created a PowerShell script that will create a Virtual Environment and install Django in a folder provided by you in the current directory.

After this It will also create a .gitignore file with "/env" and finally your project will open in VS Code

## Prerequisite

- Python Installed
- Git Installed
- Visual Studio Code Installed

[Python Download](https://www.python.org/downloads/)

[Git Download](https://git-scm.com/downloads)

[Visual studio Code Download](https://code.visualstudio.com/download)


## How to use this script

First of all get the script.

{% github kritebh/django-boilerplate-shell-script no-readme%}

Note : Currently, I have created only three variant of this and download the most suitable script for you. 

You can modify it according to your preferences.

Like if you don't want to open Visual Studio Code after creating the project then just remove the "code ."

Similarly, if you want to run the server after creating the project then you can use [third script](https://github.com/kritebh/django-boilerplate-shell-script/blob/main/djangoWithServer.ps1)

Let's say you want to install more module like django-rest-framework or Pillow then just add the code like this after pip install django.

```bash
...
...
pip install django
pip install djangorestframework
pip install pillow
...
...
```

Put your script in the directory where you want to create a new folder and set up your Django Project.

Finally, Run the script by right-clicking on it and click on "Run with PowerShell"

![Run with Powershell](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epdqcro5cutozks0n3av.png)

Here is the screenshot of script in action :

![Django Script](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghhj13d9bfgx3ogtzmh1.png)

If you not creating a lot of project like me then it will fine for you to set up Project on your own.

But I think for those who are learning Django and creating a lot of projects then this script will help them 😊 

If you have any doubt regarding this or have any suggestions you can comment below.

Thanks for reading!
100 Days of React
Tags: redux, react, javascript, 100daysofcode
Published: 2021-06-20 06:42:46

Hello everyone 👋,

I'm very excited to start the challenge of #100DaysOfReact, In this I will build projects with learning React concepts. This is my first challenge, I don't know that I can complete it in a streak but I'm pretty sure I will build 100 projects in React.

I will tweet and post daily progress on twitter and LinkedIn respectively.🏆

I had also made a React website, on that I will upload my projects links as well as Github links.
👉 Here is the website: https://projects-mr.netlify.app/

Wish me GoodLuck 👍
Combining Strings in Swift
Published: 2021-06-20 06:23:15

---
title: Combining Strings in Swift
published: true
description: Techniques to combine Strings in Swift
tags: 
//cover_image: https://direct_url_to_image.jpg
---

More often than not in programming, you would need to manipulate Strings. In this post, I’m going to share the common techniques one can use to manipulate String in Swift.

**Combining Strings**<br>
To combine or concatenate a string, one would only need to use the + operator.

Example:

```
let part1 = "Hello"
let part2 = "World"

let complete = part1 + " " + part2
print(complete) // This would print out "Hello World" 
``` 

Alternatively, one could also use string interpolation for this.

```
let part1 = "Hello"
let part2 = "World"

let complete = "\(part1) \(part2)"
print(complete) // This would print out "Hello World"
```

The outcome to these 2 approaches are the same. Is one method better than another? Not that I know of but it would make sense for you to discuss with your team members on which approach would be implemented in your codebase. As for my preference, I prefer to always use string interpolation as it is easier for me to visualise the final string in my head.

Reference:

 [Apple documentation on String.](https://developer.apple.com/documentation/swift/string)
What I Learned This Week: Hiding Keys in React.js (Or Not)
Tags: react, devjournal, firstyearincode, javascript
Published: 2021-06-20 06:17:30

This week I continued with mapping out my WatchNext project that I wrote about last week. I knew I wanted to create (or at least attempt to) a frontend only application to cement my current knowledge as well as learn more about React.js. Well, I quickly came across a bit of an obstacle. The API I plan on using requires a key to access the data. Now, I know in backend development you could simply create a .env file and add it to your .gitignore to hide any secrets or keys you don't want revealed to the user. (Incase, you're wondering what .gitignore does, it does what it sounds like. It tells version control to "ignore" the files added to it). I figured this would be the way to go with my frontend app as well. However, I was very suspicious. I thought, this is too easy to be the correct way to do it. 

This lead me down a mini rabbit hole of research regarding how to properly hide/store secrets and keys in the frontend. Long story short, you can't. At least not if you plan on deploying your app at all in the future.

From my search, I learned a couple of things that I thought I would share here. _I am still learning (as we all are) so I may expand on these points in another blog._ 

* NOTHING is safe in .env on the frontend (even if you add it to .gitignore). This is because after deploy your app, the key can be seen in dev tools within the Network tab.

* The safest bet is to make a backend to proxy API requests and store the keys there so they don't become exposed to a user.

* Serverless functions can be implemented for a bit less work than creating an entire backend.

It was also suggested to me to use Next.js, a React framework that, as stated by the [documentation](https://nextjs.org/learn/basics/create-nextjs-app), does/provides the following(and **MORE**):

* A page-based routing system
* API routes to build API endpoints with Serverless Functions (now we're speaking my language!)
* Client-side routing with optimized prefetching

This sounds like it is just what I need! As I stated previously, as I dive deeper, I may write a more in depth blog to share what I learned and my experience with Next.js. For now, I hope you learned something a little new here!

Special thanks to Nicholas Papadakis, Ashlee Boyer, Chris Powell and Matthew Curtis for the tips, suggestions and advice!
Launching the Learning Python course!
Tags: python, tutorial, learningpython
Published: 2021-06-20 06:15:56

Hi all! I am launching a brand new blog series for self learning python. Learn python from the scratch! Have fun while learning Python in an easy way.
This course is for everyone from beginner to advanced. For that, it is designed in three levels- basic, Intermediate and advanced. Here are the topics covered-

A) **Basic**-
1) Variables and operators
2) Loops and nested loops
3) Lists, tuples and dictionaries
4) String functions

B) **Intermediate**-
1) User defined functions
2) Numeric and Mathematical Modules
3) GUI and design
4) File handling in Python
5) OOP techniques

c) **Advanced**-
1) MySql
2) Database connectivity
3) Form designing
4) Interesting Projects

Hope to hear from you all in the comments below!
 ;~)


{% cta https://github.com/Aatmaj-Zephyr %} Follow me on Github! {% endcta %}
Amazing Project Ideas For Javascript
Tags: javascript, webdev, beginners, productivity
Published: 2021-06-20 06:15:42

Hey,

This article is helpful who want to improve their programming skills or might want to make projects to learn the skills these projects easily improve their knowledge and skills. I created a project list for Beginners, Intermediate & Advance project for programmers.

For more content follow me on Instagram  [@developer_nikhil27](https://www.instagram.com/developer_nikhil27/).

Happy Reading!

Here are some project ideas with category's

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

####1.Beginners :

(1) Todo App:-
Many people think why I added the todo app because it's the very basic idea of the project but the todo app helps you understand a CRED operations of programing.

(2) Countdown App:-
A countdown app is a very basic app but it helps you to understand time and date so if you are a beginner please create this project.

(3) Calculator:-
A calculator app is also a good project in this app you can understand Math related operations.

####2.Intermediate :

(1) Memory Game:-
A memory game is also a good project for intermediate developers when you are done with all the basics then start this project you will learn a lot in this project.

(2) URL Shortener:-
We use a lot of links as a programer so why we need to use another website to short the URL you should create your own it have fun.

(3) Quiz App:-
A quiz app is also a good project for your resume because in a pandemic college are conduct exams online so this quiz app helps you with your resume.

####3.Advance :

(1) Movie App:-

When you want to learn advanced stuff then you can create this movie app in this project you learn using API and all the advanced stuff in this project. Check the below post for this movie API.

{% post https://dev.to/nikhil27b/5-amazing-api-for-your-project-270e %}

(2) E-Commerce:-

In e-commerce, the app is many things to learn you will learn a lot of things in that project. An E-commerce app helps to create a strong resume so please try to create this project.

(3) Others:-

There are many other projects you will behave you should be created like YouTube Player, your own framework, chat app, your portfolio, stock market website & many others.

I hope you like this also comments about your thoughts.

Thank you.

{% instagram CPn2eUwBTUp %}
Using .setHours() to get customized time with date 📅
Tags: react, javascript, webdev, webpack
Published: 2021-06-20 06:15:30

Hello Folks 👋
In this article, we will be discussing how we can get customized time when you select a date in React. 
Usually it happens, when developers are asked to use date fields to select a date range, JavaScript does so with utmost sleekness by using 
```javascript
new Date()
```
But one of the biggest drawback of using this approach is, the resulting date would also contain a time tag, since in JavaScript date and time are always fetched together from the system and it is on us what aspect we want to use, either the date, or the time. The results would be
```
Sun Jun 20 2021 10:51:18 GMT+0500 (Pakistan Standard Time)
```
Now for suppose, as in my case, we have to fetch some data within a given time range, and the user wants to retrieve records from a single day. With simple understanding, the user would select the start and end date to be the same. Now what does JavaScript do, the start date, for suppose, today, 20th June 2021, would come as:
```
Sun Jun 20 2021 00:00:00 GMT+0500 (Pakistan Standard Time)
``` 
And guess what would the end date be? Same.
```
Sun Jun 20 2021 00:00:00 GMT+0500 (Pakistan Standard Time)
``` 
It means, that the user's query would be to check records from 12 in the Midnight of the same day to 12 on the midnight of the same day. Giving us Zero (0) records in the output.
To sort out this problem, we can use `.setHours()` function of JavaScript. 

##Benefits
* Set your desired time for the day
* Escape from selecting system specified time
* There can be more benefits

##Solution
Now it will be useless to use this function when defining the start date. Right? Wrong! For a safety measure, you must use it on start and end date, both. But with different parameters. 

#Syntax
.setHours is used with Date over Date to convolute the results in a better way.
```
new Date(new Date().setHours(HH,MM,SS,mm))
```

In order to use it on start date, it should be
```javascript
new Date(new Date().setHours(00,00,00,0))
```
and end date should be
```javascript
new Date(new Date().setHours(23,59,59,0))
```

Using this technique, you can easily allow and enable the user to select records from a whole day. :wink:
Cool math function shorthand
Tags: javascript, webdev
Published: 2021-06-20 06:01:15

## **pow**

![math-pow-shorthand](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/koie0y93gneai1rhrkmh.png)

** exponentiation operator raising the first operand to the power of the second

more details explanation [click here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation) 

## **floor** 

![math-floor-shorthand](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ukwmm5wptnpzhl726ei6.png)

**~~** double bitwise not operator rounding a number towards zero

more details explanation [click here](https://j11y.io/javascript/double-bitwise-not/) 


## **Wrapping up!**

Share this blog with your friends 👩🏼‍🤝‍🧑🏼 and developers 👨‍💻 you know and let them know about these cool math function shorthand

Your feedback and comments are very important to me. 💌

## **Get in touch 🤜🤛**

 [Instagram](https://www.instagram.com/technonic) 

 [YouTube](https://www.youtube.com/c/pratik-lochawala)
codingGinja a Software Engineer in training
Tags: motivation, watercooler, codenewbie, learning
Published: 2021-06-20 05:59:00

I am codingGinja, a nut who is transitioning careers to Software Engineering. I am 36 years old, yes, I do feel old to change my careers now, but not too old to study as I am a proud forever student, someone who believes in constant learning. To get to the Software Engineer title, I am using the self-taught route and Front-End Development as my starting point. Bouncing of my Web Design and Marketing experience I feel I can have baby steps with JavaScript. And hell, they are baby steps indeed, mainly because I have my actual baby to play with while I am trying to understand what’s the difference between == and ===, or var and let. Fun times…

How did I end up on this track? I believe that a lot of things were pointing me towards it since long ago. Since when I, as an eight-year-old, was playing with the computer at my mum’s workplace; it was unusual to have access to a computer in those days and in my country (just fresh after Soviet Occupation). Till the breakdown I had in 2020 when I realized, I don’t want another job in Marketing.

How did I end up with a life that looks like a tree branching out in different directions? Heck, do I know? Probably my ability to get interested and invested in various things. My primary teacher called me a Walking Encyclopaedia because I was always very curious, I always wanted to experience things, to know more, to research, and to understand and I used to have a good memory for that (two kids later not so much anymore).


I believe something guided me to this point, and yet I am still scared like hell of what am I getting myself into. For me, this is the road less travelled by, and I feel a lot of resistance: fears that seed doubt and amotivation, and yet the unwillingness to proceed I used to have with some of my previous career choices has gone. Inside my heart I know that this is the road for me, that the plan I have in my heart is the right one. And I have power to stand against that resistance and persevere. Me writing this is a way of fighting my demons.

I hope you can laugh at my mistakes as I go along and learn foreign concepts. If you want to read more of my stuff, please visit my blog. 

thank you for reading.
Can I use Next.js for kind of social network website?
Tags: nextjs
Published: 2021-06-20 05:46:53

Hi, I already have fans base that about 1-2m active users on Facebook and I had an idea to build some kind of simple social network for my audience.

So, I had some experience with Next.js but it is just static website for my customer. The question is any change to use Next.js for social network? I am thinking to use ISR in Next.js to reduce the server resource and keep the (almost) live data.

It is just a simple function : Post,Vote,Comment.

Any suggestion please?
Your Career as a WordPress Expert, Starts at Developer Reference
Tags: wordpress, programming, php, webdev
Published: 2021-06-20 05:29:39

We're living at the era of video tutorials. You can find a Youtube video containing anything you need, in detail, for your development. While they contain good information, but they're not immune to changes in code reference and also may not tell you the best way. 

As you know, WordPress is open source and it changes all the time. If you write a code today, in a month, it might not be the best way and other approaches may appear in the community. 

You should remember that you can find the best way to do somthing in WordPress, in developer reference. 

I talked in deatial about the developer reference and how you can get the best out of it in this video. 

{% youtube H-Rzn6JdyCo %}

### What is WordPress Developer Reference? 
In WordPress Developer Reference website, you can find the information about four main sections: 

* **Hooks** 
* **Functions**
* **Classes** 
* **Methods** 

In each section and each page, there is information about how you can use the function or class. 

**Complete Documentation** 
You can see that what parameters with which type of data this function accepts. You can see that what kind of data it returns. 
Also you can see the source code of the function in the WordPress trac. 

**User Contributed Notes** 
A useful part of the reference is where users contriburted to the documentations. This contribution can be writing good code examples, tipping about a common bug or explaining the missed things in the reference. 
As a WordPress developer, you can contribute to writing code in the reference too. You only need your WordPress account, some development knowledge and a good problem to solve. 

How did you learned to code? Do you prefer video tutorials or just plain code? Do you read a whole programming book or just read the sections you need?
Day 2/100
Published: 2021-06-20 04:53:14

Start Time: 4:30pm

Decided to change pace and work on something new, the HTML Canvas. While coding for day 2, I decided to change it up and play with html canvas and javascript to see what I can do. I am trying to make a rocket "fly" when the mouse is over the canvas. I used classes in Javascript instead of objects (I really wanted to stretch myself). I also got the code to listen for key presses so I could control the rocket across the screen. I found an example [here](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Advanced_animations#adding_velocity) about getting an object to move within the canvas. This example uses the `mouseover` and `mouseout` events to perform the animation, but when the mouse is over the canvas the rocket disappears. It isn't until the `mouseout` event happens that the rocket comes back into view (in a different spot). What could be the cause of this? Where are my shortcomings? Here is the repo with the code:

Repo: [https://github.com/cdthomp1/javascript-sandbox](https://github.com/cdthomp1/javascript-sandbox)

Live Site: [https://cdthomp1.github.io/javascript-sandbox/](https://cdthomp1.github.io/javascript-sandbox/)

<img src="https://res.cloudinary.com/cameron-projects/image/upload/v1624084775/uxbol1mwsxmveqcakjen.png" />

End Time: 6:10 pm