teleren/devto huggingface dataset:
What happens when you reach the max score in chrome dino game? 🤔
Tags: javascript
Published: 2022-08-10 16:19:00

You are probably familiar with the chrome dino game, and you have probably asked what happens at the end of the game.  I will answer it for you.

## What is the max score in the chrome dino game? 
The answer is 999999 

## How did I find out? 

I override the gameOver function so when the game calls it noting happens and set the speed to a high value

```js
Runner.instance_.gameOver = ()=>{}
Runner.instance_.currentSpeed = 100000
```
![console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uie45evmy9n9hu3lfzv9.png)

 ![Maurer Krisztián max score cut](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vhhcoqh168x2vaf99nlv.gif)
 
When you reach the 999999, sadly the counter restarts, nothing happened. 😔

You can try this at chrome://dino/
What is No-Code Security Testing
Published: 2022-08-10 16:16:00






## Why security test your applications/APIs?

- According to Gartner, Applications/APIs are the most attacked vector. 

- Regulatory compliances like HIPAA, SOC 2, ISO, PCI-DSS, etc., mandate application security testing.



## Why is security testing hard?
- Manual - Basic stuff is automated, but the rest is human-driven
- Expensive - Ranges from $4k to $100k
- Noisy Reports - Low quality and nice-to-have suggestions frustrate developers



## What is No-Code security testing?
- No need to write code
- No configuration is required either



## Use No-Code Security Tool: 
[EthicalCheck.dev](https://ethicalcheck.dev)
We built this tool to help fellow developers like you. The web tool is so simple everyone should try and bookmark it.
- Paste your OpenAPI/Swagger URL
- Get a free and instant PDF vulnerability report



## Key features:
- No code and configuration required
- Detect OWASP API-2 vulnerabilities
- No sign-up required
- Free and instant PDF reports



Please leave a comment if you like the web tool.
How to create Laravel Room Booking Application
Tags: laravel, php, beginners, webdev
Published: 2022-08-10 16:15:43

## How to create Laravel Room booking application


![laravel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/slit4pmdt54jybv2wk5y.png)
 

## Admin Credential 
<table>
    <tr><th>Email</th><th>Password</th><tr>
    <tr><td>admin@admin.com</td><td>password</td><tr>
</table>

## User Credential 
<table>
    <tr><th>Email</th><th>Password</th><tr>
    <tr><td>user@user.com</td><td>password</td><tr>
</table>

## Download Source Code
⚡Check it out [Link](https://github.com/vinobe21/Guest-Room-Booking-Application)
⚡[Github](https://github.com/vinobe21)

## Features

- Login page for both Admin and User used with Jetstream Laravel Package 

- Register New User 

- Dashboard for both Admin and User side with different routes

## 👉 Admin Side : 
   - Add, Edit, Update and Delete Rooms
   - Check all booked Rooms

## 👉 User Side :
   - Check Available Rooms 
   - Book Rooms and check My Bookings 


## How to Install?

- Clone the repository [Link](https://github.com/vinobe21/Guest-Room-Booking-Application.git)
- Rename .env.example file to .env
- Need database connection and Create database 
- Run `composer install` or `composer update`
- Run `php artisan key:generate`
- Run `php artisan migrate`
- Run `php artisan db:seed`

> Share your feedback 👇
How to export data from Mysql to CSV/TSV
Tags: mysql, csv, tsv
Published: 2022-08-10 16:15:27

## Export all data from table
In order to export all data from `table` and save it into `/tmp/dump.csv`:

```sql
SELECT * INTO OUTFILE '/tmp/dump.csv'
FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'
FROM table;
```
Make sure `/tmp` dir (or other you pick) is available for writing for Mysql.

## Export data from custom select
This is easy, just use standard `SELECT` query:

```sql
SELECT col1, col2 INTO OUTFILE '/tmp/dump.csv'
FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'
FROM table WHERE col1 > 1 ORDER BY col2;
```

This will store `col1, col2` data from a result set of a query `SELECT...FROM table WHERE col1 > 1 ORDER BY col2`.

## Export data into `TSV`
`TSV` is a tab separated format, so all we have to do is to set \t as a field termination symbol:

```sql
SELECT * INTO OUTFILE '/tmp/dump.csv'
FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'
FROM table;
```

## Load `CSV` data back into table
Let's load data from `/tmp/dump.csv` into table:

```sql
LOAD DATA INFILE '/tmp/data.csv'
INTO TABLE table
FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'
```

This is a great way to load [large amounts of data into Mysql tables](https://medium.com/datadenys/inserting-large-data-volumes-into-mysql-854df547a168).
How i manage my react redux
Tags: react, redux, javascript
Published: 2022-08-10 16:09:43

Sometimes creating multiple actions, action types and reducers etc. on setting up a global value in react-redux.

This is how i manage my reducers


packages used:
> redux
> react-redux


First this is my folder structure
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lip4ik4i66jvugkg3el3.png)
 
Folder Structure
```
 redux
  actions
   system
    actions.js
    actionTypes.js
   index.js (you can ignore this one)
   package.json (you can ignore this one)
  index.js (you can ignore this one)
  reducers
   index.js
   system.js
  index.js (you can ignore this one)
  store.js
```


redux/store.js
```
import { createStore } from "redux";
import rootReducer from "./reducers";

export default createStore(rootReducer);

```

redux/system/actions.js
```
import {
  SET_SYSTEM_DATA
} from "./actionTypes";


export const setSystemData = content => ({
  type: SET_SYSTEM_DATA,
  payload: {
      content
  }
})
```

redux/system/actionTypes.js
```
export const SET_SYSTEM_DATA = "SET_SYSTEM_DATA"
```

package.json
```
{
  "name": "redux_actions"
}
```

redux/reducers/index.js
```
import { combineReducers } from "redux"
import system from "./system"

export default combineReducers({ system })
```

redux/reducers/system.js
```
import {
  SET_SYSTEM_DATA,
} from "../actions/system/actionTypes"

const initialState = {
  is_global_value: false,
  
};

export default function(state = initialState, action) {
  switch (action.type) {
    case SET_SYSTEM_DATA: {
      const { content } = action.payload
      return {
        ...state,
        [content.key]: content.value
      };
    }
    default:
      return state
  }
}
  
```

The setup is now finish.

This is how i use it.

```
//first the imports ofcourse
import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import {setSystemData} from 'redux_actions/system/actions'

const dispatch = useDispatch()

```

If i want to change the is_global_value reducer value, I can just do it like this

```
dispatch(setSystemData({
 key: 'is_global_value',
 value: true  
}))
```


Try listening to your reducers value by useSelector
```
import { useSelector } from 'react-redux'

const is_global_value = useSelector(state => state.system.is_global_value)

console.log(is_global_value)
```

Let me know what you think. Thank you!
Re-usable components and utility functions saved ME!
Tags: react, webdev, programming, beginners
Published: 2022-08-10 16:05:00

Hello to you fellow dev! The title of the post says it all but if it doesn't to you let's dive right into it.

I've had times where when I started a project in React I would at most create files for the pages I need to allow navigation. This means that all the utility functions I created was inside my pages including the http requests I made. For a small project it went smooth until I tried to clone a popular website. 

**The Turning Point**

I started cloning the web app expecting to finish it in just 3 weeks. What's funny is that I finished the not good-looking app in almost 2 months all because of improper organization and not using re-usable components and utility functions. That's when I decided to start using re-usable components and utility functions from then.

**Understand re-usable components**

A re-usable component in simple words is a component that you can use in many **different** places and it can be given some props if you know them, to give it the adaptation and flexibility in those many scenarios.

**What do you mean by utility functions also?**

Utility functions are functions that you put aside and you are sure that you will need them many times throughout the whole project. An example of such functions are http requests, data-modification functions and many others.

**Why use re-usable components and utility functions**

I have stated it before and I'll repeat it again ,use utility functions and destruct your project as you can as it will save your time and prevent you from burn-out and frustration, believe me.

**Here's another story**

I started building a resume builder project that seemed somehow hard to me but due to proper organization after a week I am 85% almost finished with the project.

**Have a look on my current folder structure of that project:**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eobdue9vx75lrv5xwv7b.png)
 
**Note:**
- I have the src folder with subfolders.
- The folders are :
  - Components folder which contains re-usable components like navbar, input, imageCards, etc.
  - redux which contains all things related to redux from store to actionCreators.
  - utils folder which contains the utility functions we've been talking about like the one I have called generateYears.ts which help me get years , months and days for my select options.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e45yf9fml249hptdqhin.png)
 
So, this was a short blog but keep that in mind because someone once said : "**Think twice before programming or program twice before you start thinking.**"

Thank You! A like would help so much.
New fancify-text Python module
Tags: python, cli, showdev, devjournal
Published: 2022-08-10 16:00:02

_Originally published [on my blog](https://robinwinslow.uk/fancify-text)._

I just made a new Python module and CLI tool called [fancify-text](https://pypi.org/project/fancify-text/) for transforming text into fancy unicode representations:

```
$ fancify-bold "hello world"
𝗵𝗲𝗹𝗹𝗼 𝘄𝗼𝗿𝗹𝗱
$ fancify-bolditalics "hello world"
𝙝𝙚𝙡𝙡𝙤 𝙬𝙤𝙧𝙡𝙙
$ fancify-upsidedown "hello world"
plɹoʍ ollǝɥ
```

I'm hoping to use it in an automatic tool for turning blog posts into twitter threads that I'm working on.

## I stole the code

I can't say I wrote it - I basically stole it [from @Secret-chest](https://github.com/Secret-chest/fancy-text), and repackaged their code. They did all the hard work of finding the appropriate unicode characters was done by them.

I don't know if they mind. There's no license on the code so I'm treating it as public domain, but I [contacted them](https://github.com/Secret-chest/fancy-text/issues/5) to ask if they want control of the module. They're welcome to it if they want.

I just made it into a class, wrote a lot of boilerplate code around it for different function names and CLI entrypoints. And now you can use it.

## Try it out

On the command-line:

``` bash
$ pip3 install fancify-text
$ fancify-script "hello world"
𝒽𝑒𝓁𝓁𝓅 𝓍𝓅𝓈𝓁𝒹
```

Or in Python:

``` python
In [1]: from fancify_text import blue

In [2]: print(blue("hello world"))
🇭 🇪 🇱 🇱 🇴    🇼 🇴 🇷 🇱 🇩 
```
New fancify-text Python module
Tags: python, cli, showdev, devjournal
Published: 2022-08-10 15:59:00

I just made a new Python module and CLI tool called [fancify-text](https://pypi.org/project/fancify-text/) for transforming text into fancy unicode representations:

```
$ fancify-bold "hello world"
𝗵𝗲𝗹𝗹𝗼 𝘄𝗼𝗿𝗹𝗱
$ fancify-bolditalics "hello world"
𝙝𝙚𝙡𝙡𝙤 𝙬𝙤𝙧𝙡𝙙
$ fancify-upsidedown "hello world"
plɹoʍ ollǝɥ
```

I'm hoping to use it in an automatic tool for turning blog posts into twitter threads that I'm working on.

## I stole the code

I can't say I wrote it - I basically stole it [from @Secret-chest](https://github.com/Secret-chest/fancy-text), and repackaged their code. They did all the hard work of finding the appropriate unicode characters.

I don't know if they mind. There's no license on the code so [technically](https://www.itcontracting.com/software-development-source-code-who-owns-it/) it's their copyright, but I [contacted them](https://github.com/Secret-chest/fancy-text/issues/5) to ask if they want control of the module. They're welcome to it if they want.

I just made it into a class, wrote a lot of boilerplate code around it for different function names and CLI entrypoints. And now you can use it.

## Try it out

On the command-line:

``` bash
$ pip3 install fancify-text
$ fancify-script "hello world"
𝒽𝑒𝓁𝓁𝓅 𝓍𝓅𝓈𝓁𝒹
```

Or in Python:

``` python
In [1]: from fancify_text import blue

In [2]: print(blue("hello world"))
🇭 🇪 🇱 🇱 🇴    🇼 🇴 🇷 🇱 🇩 
```
Update nestjs-translates v1.1.0
Tags: nestjs, typescript, translates, node
Published: 2022-08-10 15:51:00

# Update nestjs-translates v1.1.0

## Links

https://github.com/EndyKaufman/nestjs-translates

## Features
added static method forFeature for isolated use of translations, added static method forRootDefault with default methods

https://www.npmjs.com/package/nestjs-translates
So what to do when React... isn't reactive?
Tags: beginners, react
Published: 2022-08-10 15:39:00

Hello everyone!
First thing I will say is, using the method I am about to talk about is not recommended. It should be used only when you are really desperate, nothing works otherwise, and using it might help you find the problem in your code.
Now that we've cleared that out of the way, lets get started!

So to begin with - Yes, it is weird, but React isn't... reactive. I could go into details, but why do something [when others have already done it for us](https://dev.to/this-is-learning/how-react-isn-t-reactive-and-why-you-shouldn-t-care-152m)?
One of the issues every junior React developer will come by at some point: 
> _"My code works, console.log prints what it should, but nothing is showing right!"_

Obviously your usual answer could be something like: "You gotta use the 'useState' hook right there", or you would dive deeper into the code to find the problem easily, but lets say things are not that simple in this specific scenario and that for some weird reason your attempt at 'useState' did not get you the results you needed.

So what can you do?
Add a conditional rendered fragment!
What is that?
Basically this:
```
{state && <></>}
```
Just add that to your main file - App.js, index.js, whatever you are using - and 'render' that nothingness.
Dont forget to include:
```
const [state, useState] = React.useState(false);
```
in the same file, and -
```
setState(!state);
```
...when you want to force a render.
It is a bit weird if you think about it, since you are rendering... nothing. But it works. Interesting by itself.

I hope reading this has helped you solve errors in your code, expand your knowledge, or even that you just had fun exploring this.

Were you amused? let me know in the comments.
pinia + vuex-orm = pinia-orm
Tags: vue, pinia, orm, javascript
Published: 2022-08-10 15:36:00



[![Pinia ORM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4w76p7mpo9d315vafyqc.png)](https://github.com/CodeDredd/pinia-orm)

Welcome!

Well i think some or even many of you have heard of vuex-orm and loving the syntax to have orm in a store.
Till December 2021 the vuex-orm team was still working on their next iteration of [vuex-orm](https://github.com/vuex-orm/vuex-orm-next).

Since pinia is now the offical store solution for vue, and vuex is being marked "deprecated", some already asked in an [issue](https://github.com/vuex-orm/vuex-orm-next/issues/113) about the plan with vuex-orm for pinia.

Well after a while of thinking and waiting, i decided to make a first POC of vuex-orm-next for pinia and after two days of hardcore coding i had a working version.

Well i then paused for some months. Being father and work is a bit time consuming ;-)

But now for the last month i spent a lot of time into it. I tried to add every opened feature discuessed and also fixing known bugs from vuex-orm-next and vuex-orm.
So i am happy to anouce that pinia-orm is already in RC.5 state.

I really upgraded everything. The package, the tests and the docs.
All shiny again :) You can visit the package [here](https://github.com/CodeDredd/pinia-orm)
Introducing Next.Js Crowd
Tags: redishackathon, redis, node, nextjs
Published: 2022-08-10 15:35:00

Hi :)

"Next.Js Crowd" is our (Maureen Ononiwu & Sashe Vuchkov) hackathon app we're building for RedisHackathon. 

It monitors Twitter for users that mention the react framework Next.js and shows some daily stats like "top users," "top tweets," etc.

Here's a small demo of the interface:

https://www.youtube.com/watch?v=dgFq72X7mio

{% youtube dgFq72X7mio %}

You can follow the making of the app by watching this GitHub repo:

https://github.com/SasheVuchkov/nextjs-crowd

Cheers,
Sashe Vuchkov
CKA & CKAD Series (Part 5): Networking
Tags: kubernetes, networking
Published: 2022-08-10 15:31:00

Every node in a cluster, is appointed an IP Address
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryw7bhvl4rg0oo5wrlql.png)
 
and under the node, a private IP address is set to communicate between pods.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihl7h0dmgz6jdpmgyyg6.png)
Here 10.244.0.0 is a private network  which pods use.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i82u6nhhxb9e8fcj26d7.png)

If there are multiple nodes in a cluster, surely the nodes have different IP addresses.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gu0zxsoxghrersob878f.png)
But the problem is with the private network created to connect the nodes.

That is same to all the nodes.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69gaaaaqoi1j33cs628l.png)
So, you can see the internal network address is same for all. This makes a conflict if we want to contact with pods outside of a node.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/su8trqqxs3wmn2eobqmu.png)
   
Thus there are some external third party tools, we have to use.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r92sc3n8b50pol1orrzt.png)
After using the third party tools, they appoint a different internal network for different node's pods. Thus it is now easy to communicate to different pods.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhagdeaco2h63cr7f1i0.png)
 


That was it for the basics. We made it simple for you boss!
<img src="https://media0.giphy.com/media/Nfs5y1kzJKfu/giphy.gif?cid=ecf05e472d3w835ptrri5m1p6ifnwl9mi7ope9pifvhpcxf6&rid=giphy.gif&ct=g">
Fix TP-Link TL-WN722N Not Working on Linux
Tags: linux, todayilearned, tutorial, wifi
Published: 2022-08-10 15:27:09

This issue has been bugging me since last year. It started when I am still running Linux Mint, suddenly after an update, my wireless adapter stop working suddenly. I try to find a way to fix it on Google, but did not found any working solutions. Because I am quite busy at that time, I simply used USB tethering to get around it, and soon forget about the problem.

Early this year, I decided to try MX Linux because it seems to be more lightweight and stable (once a year release compared to monthly release which mean less crash) than Linux Mint. I did notice the performance is noticeably better, and I never have a crash or bug anymore after update, overall it is very stable, but the wireless adapter problem still persist, so clearly the problem is not the OS.

Tonight I remembered about the issue and because I am still curious about it, I decided to research about the issues again with a fresh approach. The first thing I do is running ` lsusb` command on the terminal after I connected my wireless adapter. This is the output:

![ lsusb output](https://xmyforsgwfqphgifjxpe.supabase.co/storage/v1/object/public/strapi-blog/strapi-blog/lsusb.png-16bd855051b18e46f53d34ff8671297c.png)

Gotcha! I found the needed driver version for my wireless adapter which is `RTL8188EUS`. I then run `lsmod | grep 8188` to check whether the driver is loaded or not on the kernel, turn out it is not installed yet.

After a brief google search for the driver, I found it on https://github.com/aircrack-ng/rtl8188eus. I tried the instruction there, but sadly it still doesn't work. Suddenly I got an idea to try this command `echo "blacklist r8188eu" | sudo tee /etc/modprobe.d/r8188eu.conf` and restart the computer. Finally, it's working! To spare you from wasting time like me, I will give you the precise step here:

1. Connect your wireless adapter
2. Open your terminal and run ` lsusb` to find your driver model, if it is not the same as mine, you can modify this tutorial by searching the driver model that match yours on Google and modify the last command to `echo "blacklist <driver-model>" | sudo tee/etc/modprobe.d/<driver-model>.conf`
3. Disconnect your wireless adapter and connect to internet with USB tethering from your phone
4. `sudo apt-get install mokutil && mokutil --sb-state`, if it output ` SecureBoot disabled` you can proceed to the next step, otherwise you need to turn off the secure boot option from the BIOS because it can possibly interfere with the driver installation
5. `git clone https://github.com/aircrack-ng/rtl8188eus`
6. ` cd rtl8188eus`
7. `make && sudo make install`
8. `echo "blacklist r8188eu" | sudo tee /etc/modprobe.d/r8188eu.conf`
9. Restart computer

**Important note: you might need to repeat the steps again after updating your Linux because the driver might got replaced.**

I hope my article is useful to you, see you in the next article!
ways to prevent screensavers
Tags: tooling, devjournal
Published: 2022-08-10 15:19:00

Here are few ways to prevent 

## xautolock corners

see [previous post](https://dev.to/ccoveille/xautolock-corners-5161) 

## xidlehook

simply use xidlehook to launch the screensaver and use the following parameters

    --not-when-audio
    --not-when-fullscreen

see [previous post about xautolock alternatives](https://dev.to/ccoveille/xautolock-alternatives-4k2n)

## caffeine
https://code.launchpad.net/~caffeine-developers/caffeine/main

currently at 2.8 version, quite no settings. The code works and detects things by its own.

Not really maintained, except lib updates and translations, there are quite no new features for years, but it works.

## caffeine-ng
https://codeberg.org/WhyNotHugo/caffeine-ng

a fork from 2.4 version, the reason of the fork is explained on the repository. But to sum up, caffeine had a bunch of features and settings before the 2.4, then everything was removed because the code was supposed to be magic and solve all problems, people disagreed, so a fork was created.

## gnome shell extension caffeine

https://github.com/eonpatapon/gnome-shell-extension-caffeine

not related to the others

- not maintained
Hello World
Tags: welcome, hello
Published: 2022-08-10 15:14:00

## Hello Everyone! 

I'm Rennaru or you can call me renna, I'm a freelancer and a full-stack developer from **Thailand**. I started programming in around 2015 - 2016 with **Javascript** and then i started to learn more programing languages such as **Java**, **Lua**, **Rust**, etc.

Also please check out my [website](https://homepage-rennaru.vercel.app/)