teleren/devto huggingface dataset:
Reduct Storage 0.7.0 was released
Tags: database, news, reductstorage, cpp
Published: 2022-07-30 14:07:00

I'm happy to announce that [Reduct Storage 0.7.0](https://github.com/reduct-storage/reduct-storage/releases/tag/v0.7.0) has been released yesterday.

In this release, we have introduced data querying, which allows iterating records via a time interval. This approach is significantly better than reading timestamps of records  as a list and then read the records. The list could be huge. Now you can query data for a time interval and use its ID to read records.

You can try it with CURL and our [demo server](https://play.reduct-storage.dev):

```sh
export API_TOKEN=reduct
# Take a temporal access token by using API token
curl -X POST --header "Authorization: Bearer ${API_TOKEN}" -a https://play.reduct-storage.dev/auth/refresh

export ACCESS_TOKEN=<copy it from json>
# Create a bucket (if doesnt exist)
curl -d "{\"quota_type\":\"FIFO\", \"quota_size\":10000}" \
  -X POST \
  --header "Authorization: Bearer ${ACCESS_TOKEN}"   \
  -a https://play.reduct-storage.dev/b/my_data

# Write some data
curl -d "some_data_1" \
  -X POST \
  --header "Authorization: Bearer ${ACCESS_TOKEN}"   \
  -a https://play.reduct-storage.dev/b/my_data/entry_1?ts=10000

curl -d "some_data_2" \
  -X POST \
  --header "Authorization: Bearer ${ACCESS_TOKEN}"   \
  -a https://play.reduct-storage.dev/b/my_data/entry_1?ts=20000

# Query data
curl --header "Authorization: Bearer ${ACCESS_TOKEN}"   \
    https://play.reduct-storage.dev/b/my_data/entry_1/q?ttl=30

# Read data by using the query ID
curl --header "Authorization: Bearer ${ACCESS_TOKEN}"   \
    https://play.reduct-storage.dev/b/my_data/entry_1?q=<ID>
```

For more information see [API Documentation](https://docs.reduct-storage.dev/http-api/entry-api)
I Made a Web App to Showcase all your GitHub Projects 😍✨
Tags: javascript, webdev, showdev, github
Published: 2022-07-30 13:50:00

## Introducing Projects

Present all your projects in style with a super customizable web app! ✨

`Projects` uses the GitHub API to list all your GitHub projects in a nice searchable grid.
Also shows pretty programming icons using `devicons`.

## Inspiration

Needed a way to display all my projects, that should auto update from GitHub

## Getting Projects

To get projects, follow these steps:

```bash
git clone https://github.com/2kabhishek/projects
cd projects
```

### Setup Your Own Projects

You can set up projects for yourself by following these steps:

- Fork the repo: https://github.com/2kabhishek/projects
- Clone it locally / Open it in GitHub Codespaces
- Open up `script.js` and update the `username` variable to your GitHub username.
- Open up `index.html` and update the `title` tag to make it your own.
- You may also want to update the favicon by updating the `link` tag in `index.html`
- Commit and push your changes
- Go to repo settings on GitHub, under `Pages` enable GitHub Pages.
  - Choose 'Deploy from a branch' with the `main` branch and `/` as the root directory.
- Done!

The site should be live on `https://<your-username>.github.io/projects`

#### Number Of Repos

The number of repos shown changes with the `maxPages` variable, the GitHub API supports 100 repos per page max.
If you have less than 100 repos, set `maxPages` to 1, if you have 300 then 3.

You can also edit the fetch query to reduce the per page repo count.

> There's no pagination, all repos show up on the same page.

### Forked Repos

To show forked repos set `hideForks = false` in `script.js`

### Authenticated Requests

If you are working locally and notice the API is not sending over data, it might be because of rate limit on GitHub API requests.

You can either wait for an hour or setup a personal access token on GitHub and pass that into the fetch request in `script.js`

### Themes

Comes with a dark and light theme by default, depends upon your system and browser settings.

Edit the variables under `:root` in `styles.css` to change color scheme.

### Programming Language Icons

This project uses [Devicon](https://devicon.dev/) for adding language icons, if the language name and icon are not
displayed, for any of your repos, update `devicons` mapping in `script.js`.

## How it was built

I built `Projects` using `HTML` `CSS` `JavaScript` and Neovim

## What I learned

- Learned about some quirks of the fetch API, during implementation of `maxPages`.
- Revisited Flex, box-shadow and some other CSS tricks

Hit the ❤️ button if you found this useful.

[projects repo](https://github.com/2kabhishek/projects)
What is Pikashow APK?
Tags: javascript, writing, webdev, beginners
Published: 2022-07-30 13:41:00

Pikashow APK is a kind of Android mobile app by which we can watch any movies or videos in our mobile for absolutely free. In the world of internet, Pikashow APK is a very popular app which is used by a lot of people to watch online content in their mobile. If you also want to see any kind of premium content in your mobile, then you can [download Pikashow APK](https://sabhindimai.net/pikashow-apk-download/) in your mobile.

## How to Use Pikashow APK?

Piakshow APK is downloaded by only a few people but they do not know how to use Pikashow APK in their mobile, so let's see how to use Pikashow APK.

First of all, you need to install the Pikashow APK in your mobile. After which you can use the Pikashow App in your mobile.
Pure Nodejs Logger
Tags: node, javascript
Published: 2022-07-30 13:32:00

Did you know that the 𝗡𝗼𝗱𝗲𝗷𝘀 console module provides a 𝗖𝗼𝗻𝘀𝗼𝗹𝗲 class, unlike the browser?

This is how the default global console object is defined under the hood:
𝗻𝗲𝘄 𝗖𝗼𝗻𝘀𝗼𝗹𝗲({ 𝘀𝘁𝗱𝗼𝘂𝘁: 𝗽𝗿𝗼𝗰𝗲𝘀𝘀.𝘀𝘁𝗱𝗼𝘂𝘁, 𝘀𝘁𝗱𝗲𝗿𝗿: 𝗽𝗿𝗼𝗰𝗲𝘀𝘀.𝘀𝘁𝗱𝗲𝗿𝗿 });

What most people don't know is that you can configure the console to write to files instead of the standard output and error streams.

This allows you create pure and configurable 𝗡𝗼𝗱𝗲𝗷𝘀 loggers; zero dependencies required.

The constructor options include:

𝘀𝘁𝗱𝗼𝘂𝘁: Writable output stream.
𝘀𝘁𝗱𝗲𝗿𝗿: Writable error stream
𝗶𝗴𝗻𝗼𝗿𝗲𝗘𝗿𝗿𝗼𝗿𝘀: Enabled by default
𝗰𝗼𝗹𝗼𝗿𝗠𝗼𝗱𝗲: Default is auto
𝗶𝗻𝘀𝗽𝗲𝗰𝘁𝗢𝗽𝘁𝗶𝗼𝗻𝘀: Passed to 𝘂𝘁𝗶𝗹.𝗶𝗻𝘀𝗽𝗲𝗰𝘁()
𝗴𝗿𝗼𝘂𝗽𝗜𝗻𝗱𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻: Default is 2

Check the snap below to see how it can be used.

Did you learn something new today?

Like and share this post, and follow me for more!

![pure nodejs logger](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lskgpudj6krmkqja8r3s.png)
Server language
Tags: javascript, node, mongodb
Published: 2022-07-30 13:27:52

I usually use node.js for my server language, and probably varies from each person. I know php has been around a while and has more support with it. Node is faster and handles multiple tasks, whereas php handles one at a time. So it comes down to what type of app you're going to build. Php seems easier to write and less lines of code, but node can be too with express. Correct me if I'm wrong, but isn't that why node is a part of javascript frameworks? Especially for ecommerce sites. C sharp is great but overkill for simple websites. Kind of like putting a hemi in a motorcycle.
Codecademy CS101 Final Project: NIM
Tags: python, beginners, programming
Published: 2022-07-30 13:22:27

For my final project in the Codecademy CS101 course I wrote a terminal game of NIM.

##What Is NIM?
NIM is a game that starts with piles of objects.  Players take turns removing objects from one of the piles.  Whoever removes the last object wins.

##About This Program
I wrote the game to be a player against the computer.  I randomly choose the size of three rows of stars.  The player is then asked if they want to go first.  

![NIM game board](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tsuv2dq7ssjvjno2gatj.GIF)

The player can win but if they make a mistake the program is designed so that the computer will win.

The code can be found here [at GitHub.](https://github.com/acasagranda/Nim-Project)
Cross Platform, Cross Language Text Editor - VSCode
Tags: setup, windows, macos, vscode
Published: 2022-07-30 13:01:00

I see more and more youtubers and instructors coding using [Visual Studio Code](https://code.visualstudio.com/). I was a bit reluctant at first, but after trying it, there is no doubt ! VSCode is the best text editor I encounter to date. Free, cross platform, cross language, terminal integrated, hundreds of extentions that will help your productivity, and hundreds more for cosmetic changes.

## Install on Windows
> Before reading this post, I suggest you follow [Ubuntu on Windows (WSL)](https://dev.to/mhebrard/ubuntu-on-windows-wsl-40po).

- Open web browser
- Visit [code](https://code.visualstudio.com/)
- Download 'Windows x64' installer
- Open the installer
- Follow installation instructions...

## Install on MacOS

> Before reading this post, I suggest you follow [Improved Shell (MacOS)](https://dev.to/mhebrard/improved-shell-macos-3kme).

- Open 'Terminal'
- Install VSCode from Homebrew
   ```
brew install --cask visual-studio-code
   ```
- Open 'Visual Studio Code'
- Authorise VSCode to access your folders.
- Trust the author

![trust](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zok6f75zl3slucdbia2m.png)
 
## Colors

- Navigate the menu 'Code/Preferences/Color Themes'
- Search for 'Tomorrow'
- Click on 'Browse Additional Color Themes...'
- Select 'Base16 Tomorrow'

## Extensions

- Navigate to 'Extensions'
- Install 'Material Icon Theme': a set of icons to help identify file extensions
- Install 'Git Graph': an visual interface to handle branches and commits
- Install 'Live Server': Launch a development local server with live reload feature for static & dynamic pages
- Install 'Prettier': opinionated code formatter that enforces a consistent style, tabulations and maximum line length at each save.
- Install 'Markdownlint': a code formatter that enforce consistent style for markdown files
- Install 'Python': handy package of python related extentions
- -for Windows only- Install 'Remote - WSL': Connect VSCode terminal to WSL.

## Settings

- Navigate the menu 'Code/Preferences/Settings'
- Set 'Editor: Tab Size' to `2`
- Set 'Files: Eol' to `\n`
- Set 'Font Family:' to `MesloLGS NF`

![Colors](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxz2jvbx5etgf88y31tz.png)
Google Launched the Best Interview Preparation Tool
Tags: programming, productivity, career, machinelearning
Published: 2022-07-30 12:40:14

If you struggle with answering questions like _"Can you please tell me a bit about yourself?" or "Please tell me about some of your strengths and weaknesses"
_
Worry no more!

**Google** has introduced a machine-learning powered tool that enables people to undertake mock job interview questions, with a view to improving their interview performance for the real life application process.

As you answer each question, your responses are transcribed in real time, so you can go back and review how you went.

I believe it's a great way to practice for the most commonly asked interview questions.

Other than the general category, customized interview questions for E-Commerce, IT Support, Project Management, UX Design and Data Analytics are also available.

I encourage all job aspirants to try it out.

**[Google Interview WarmUp](https://grow.google/certificates/interview-warmup/)**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fn4shm7oswplepeecls1.jpg)
What's new in Vue.js 2.7.8
Tags: javascript, vue, webdev, programming
Published: 2022-07-30 12:28:30

The version 2.7.8 of Vue.js, the JavaScript framework for building user interfaces and single-page apps, is now available. This version includes notable improvements, some of which are:

- Fixed `shallowReactive` nested ref setting edge cases
- Added support for listeners on setup context and `useListeners()` helper
- Resolved the issue with `<script setup>` component resolution edge case with v3
Deploy on Heroku for Rest API, Some Commands
Published: 2022-07-30 12:06:19


## Heroku 

- create a `Procfile` and inside the Procfile,
```javascript
web: node index.js
```


## After Heroku publish, If you change data, Then again Heroku Push like:

```javascript
git add .
git commit -m"again update data"
git push heroku main/master
```

## After Deploy, all heroku information:
```javascript
heroku info
```

## After adding database variables in heroku
```javascript
heroku restart
```
Debouncing in javascript✨
Tags: javascript, webdev, programming, react
Published: 2022-07-30 11:25:00

To optimise browser performance as well as keep up with user experience deliverables, there are few techniques, one of which is **debouncing**.

A very fine example for this would be any search bar. When you type a word in search bar with every letter it shows new recommendations.

From the surface the trick here must be making an **API call every time somebody enters a letter** to fetch desirable options according to latest input.


A better way to do this is through debouncing,

- We set a `threshold` for a time period, can be 5s or .05 sec.

- Every time this threshold timer expires, we make an API call to get data best matching the input.

- Clear the timer and reset

## Code:

```javascript
<input
className="search-bar"
onChange={ hecticSearchHandler }
/>
```

```javascript
function hecticSearchHandler(...args){

/* capture the search query entered by customer */
const { value } = args[0].target;

/* Make an API call with search query */
getSearchResults(value);
}
```



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5b1ufsm6cnz51fgd08uw.png)


### Reusable function code:
```javascript
const optiSearchHandler = debounceFunc(searchHandler, 500)

const debounceFunc = (func, delay) => {
   let timer;
    return function(...args) {
       const context = this;
       clearTimeOut(timer);
       timer = setTimeOut(() => {
           func.apply(context, args);
       }, delay)
     }
}
```

> Watch this video for clarity: [Debounce interview ques](https://www.youtube.com/watch?v=Zo-6_qx8uxg&ab_channel=AkshaySaini)
Simple tool crawl urls form domain
Tags: go, crawler
Published: 2022-07-30 11:06:00

**cUrls** is a simple tool crawl urls from domain using [colly](https://github.com/gocolly/colly)
library. Source code in [here](https://github.com/ductnn/cUrls).

## Installation

First, install [golang](https://go.dev/doc/install)

Then, clone from soure code and install:

```sh
git clone https://github.com/ductnn/cUrls.git
cd cUrls
go get
```

## Usage

Run command:

```
go run curls.go > sub.txt
# Enter domain you want to crawl.
# Example
http://httpbin.org/
```

Check results in file *sub.txt*:

```txt
Visiting http://httpbin.org/
Link found: "\n        \n            \n            \n            \n        \n    " -> https://github.com/requests/httpbin
Link found: "the developer - Website" -> https://kennethreitz.org
Link found: "Send email to the developer" -> mailto:me@kennethreitz.org
Link found: "Flasgger" -> https://github.com/rochacbruno/flasgger
Link found: "HTML form" -> /forms/post
```

So done !!! =))))

### Show your support
Give a ⭐ if you like this application ❤️

## Contribution
Contributions are more than welcome in this project!

## License
The MIT License (MIT). Please see [LICENSE](license) for more information.
New Things Added - Laravel 9.22 Released
Tags: laravel, php, webdev, programming
Published: 2022-07-30 10:49:04

Let's get started quickly I found new things in Laravel 9.22 Released I wanted to share with you.

- Fluent file validation rule
https://github.com/laravel/framework/pull/43271

File validation rule object that provides a fluent interface like the Password validation rule
```php
// Before
$request->validate([
  'file' => ['required', 'file', 'mimes:mp3,wav,aac', 'max:12287'],
  'image' => ['required', 'file', 'image', 'min:2048', 'max:12287', Rule::dimensions()->maxWidth(1000)->maxHeight(500)],
]);
 
// After
$request->validate([
  'file' => ['required', File::types(['mp3', 'wav', 'aac'])->smallerThan(12 * 1024)],
  'image' => ['required', File::image()->atLeast(2 * 1024)->smallerThan(12 * 1024)->dimensions(Rule::dimensions()->maxWidth(1000)->maxHeight(500))],
]);
```
more details :-
https://laravel.com/docs/9.x/validation#validating-files

- Improved Artisan serve command
https://github.com/laravel/framework/pull/43375

- Support for multiple hash algorithms in Filesystem
https://www.php.net/manual/en/function.hash-algos.php

```php
File::hash($path)
// 196b0f14eba66e10fba74dbf9e99c22f => default md5
 
File::hash($path, 'sha256')
// 19c451aedfb24c338a9a2a5c31d553ed77e7cdefc655035f390176ac24066051
```

- Allow using backed enums as route parameters 
https://github.com/laravel/framework/pull/43294
```php
$user = User::first();
$user->type;
route('user-type', $user->type);
```

- Improves console output when command not found
https://github.com/laravel/framework/pull/43323


I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.
Source :- https://laravel-news.com/laravel-9-22-0
Source :- https://www.youtube.com/watch?v=qiJrRKPqo3k
JS Program to Remove Duplicates From Array
Tags: javascript
Published: 2022-07-30 10:45:00

## solution1

```js
let array = ['1', '2', '3', '2', '3'];

let uniqueArray = [];
array.forEach((c) => {
    if (!uniqueArray.includes(c)) {
        uniqueArray.push(c);
    }
});

console.log(uniqueArray);
```

## solution2

```js
function getUnique(arr){

    let uniqueArr = [];

    //loop through array 
    for(let i of arr) {
        if(uniqueArr.indexOf(i) === -1) {
            uniqueArr.push(i);
        }
    }
    console.log(uniqueArr);
}
const array = [1,2,3,2,3];

```

## solution3

```js
let array = ['1', '2', '3', '2', '3'];
let uniqueArray = [...new Set(array)];

console.log(uniqueArray);
```
How to Build Responsive car rental website using Html CSS JavaScript
Tags: css, javascript, beginners, tutorial
Published: 2022-07-30 10:44:38

{% youtube DJAK-KODM5E %}

How to Build Responsive car rental website using Html CSS JavaScript

This video will show you how to build car rental website using html css javascript

[Live Website](https://codewithsadee.github.io/ridex)
[Github Repo](https://github.com/codewithsadee/ridex)

---

HI 👋
I'm Sadee (webdev)
In this channel I make videos about Complete Responsive website.
You can checkout my channel 👇

📺 My Channel : [codewithsadee](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g)
🔔 Subscribe : [subscribe now](https://www.youtube.com/channel/UC1PZHWV6VvICTL1LgFUZq6g?sub_confirmation=1)

---

🔗 Essential links
-----------------------------
[Download the starter file to practice](https://drive.google.com/file/d/1v9rGgAjtVYaa7oLsZKVC97Z8Gcr1qaxA/view?usp=sharing)

---

⏱️ Timestamps
-----------------------------
0:00 - Demo
3:56 - File structure
4:29 - Project initial
10:22 - Header
28:21 - Hero section
37:33 - Featured car section
56:21 - Get start section
1:05:17 - Blog section
1:16:17 - Footer
1:26:00 - Media queries
1:41:31 - Deploy on GitHub

---

[![Become a patreon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fnjl14kdm5qf08hu5lop.png)](https://www.patreon.com/bePatron?u=62535867)
what I learnt this week
Published: 2022-07-30 10:33:00


![BMC](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7isn25cjldiih7u1jc6.gif)

## "Page Not Found" when trying to access a site deployed on Netlify

I ran into this issue, when I refresh my web app that is deployed on Netlify,

>Page Not found
>
>Looks like you've followed a broken link or entered a URL that doesn't exist on >this site.
>
>← Back to our site

I found a solution to the problem on [stackoverflow](https://stackoverflow.com/a/63738122/17171424)

**Solution**

In your `public` folder (folder which contains index.html) create a file called `_redirects` with no extension. Then, type the following inside it:

`/*    /index.html    200`

Now save, commit, push and publish. :) 

Reason for "Not Found" is because, when using router eg: React Router it handles all the routes but when you directly goto an endpoint, netlify must know where to redirect you. That is what we are specifying in the `_redirects` file.

I like this [blog](https://www.alexnielsen.net/blog/)

## How to put data from RTK query into state slice in Redux toolkit


Someone asked the question [How to put data from RTK query into redux slice](https://stackoverflow.com/a/68760199/17171424)

I found an answer here on a [dev blog](https://dev.to/agiksetiawan/put-data-from-rtk-query-on-to-state-slice-in-redux-toolkit-1p1m)


## How to fix failed to push some refs to gitlab?

I ran into this issue, when I tried to push my project to gitlab.

```javascript
error: failed to push some refs to 'https://gitlab.com/
```

I found a [solution](https://komodor.com/learn/how-to-fix-failed-to-push-some-refs-to-git-errors/#:~:text=failed%20to%20push%20some%20refs%20to%20errors%20are%20often%20caused,sync%20with%20the%20Git%20repository.)

first step: I ran `git pull`

second step: I ran 

```javascript   
git pull --rebase origin [branch]
```

<a href="https://www.buymeacoffee.com/ifeanyichima" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

**Thank You, Please follow me**

[![HTML](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://linkedin.com/ifeanyi-thankgod-chima)&nbsp;[![GitHub](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/masterifeanyi)
Class basic syntax
Tags: javascript
Published: 2022-07-30 10:11:00

## user => first name and last name, return full name as a String


```js
class User{
    constructor(name, lastName){
        this.name = name;
        this.lastName = lastName;
    }

    get fullName(){
        return this.name + " " + this.lastName;
    }
}

var user = new User("", "");
console.log(user.fullName);
```

## media => TvShows, movies, (episode, season), (duration)

```js
class Media{
    constructor(name, year, imdb){
        this.name = name;
        this.year = year;
        this.imdb = imdb;
    }
}
    class Tvshows extends Media{
        constructor(name, year, imdb, episodes, seasons){
            super(name, year, imdb);
            this.episodes = episodes;
            this.seasons = seasons;
        }
    }

    class Movies extends Media{
        constructor(name, year, imdb, duration){
            super(name, year, imdb);
            this.duration = duration;
        }
    }

```

## find the mileage of the car 

```js
class Car {
    constructor (year) {
        this.year = year;
    }

     getAge(now){
        return now - this.year;
     }
}

let mini = new Car(2018)

console.log(mini.getAge(2022));
```