teleren/devto huggingface dataset:
Personal Environment Variables
Published: 2022-07-12 23:44:19

### **
Use
**

An environment variable is a dynamic "object" on a computer, which refers to the system checking some protocols like where to find the particular program, where to save the temporary files and many more. We set up some environment variables while installing the interpreter or compiler for any language like Java, C++, etc. Generally, it is denoted as $PATH(UNIX & LINUX) or PATH(Windows). The cool part of environment variables is we can make our own like any other programming variables and set some values to them. We can do some automation and some really cool stuff.
### **
 Benefits
**
-  Easy to use.
-     It increases efficiency.

### Example

If you are working on a project, where you are writing some python automation script and using some specific folder to create logs, save and move the modified file from one directory to another. So, you can set some environment variables for the same and use them in your script.

### How to Make it:

```
export ORA=$ORA /mnt/c/Users/Admin/Oracle
```

This will set a variable _$ORA _with the value - `/mnt/c/Users/Admin/Oracle`

### How to check the value:

```
echo $ORA
```

This will print the value of the $ORA which is `/mnt/c/Users/Admin/Oracle`

### How to use it:

```
cd $ORA
```

cd is known as change directory, so the above command changes the directory to its value(your desired path) and goes to the Oracle folder.

### How to delete it:

```
export ORA=${ORA% /mnt/c/Users/Admin/Oracle}
```

The above command will delete the value from the variable. I have put this command just because I messed up a big-time and I had to research out how to revert back or change the variable values.

So, this is it from my end till now on this topic. If you want to add something please feel free to share. If I got some more updates then I will update the article. Thanks for reading and enjoy my write-up.
طراحی سایت با نت لند با بالاترین کیفیت
Tags: php, html, laravel, vue
Published: 2022-07-17 18:40:34

[طراحی سایت در قزوین](https://mynetland.ir/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d8%af%d8%b1-%d9%82%d8%b2%d9%88%db%8c%d9%86/) و پشتیبانی به بهترین شکل 

طراحی سایت امروزه امریست الزامی برای پیشرفت کاری ، بهتر دیده شدن و افزایش درآمد و فروش در افراد ، گروه ها و سازمان ها که همه این افراد برای ارتقاء سطح کیفی و درآمدی خود باید به ورود در حوزه دیجیتال تمرکز داشته باشند و برای رسیدن به آن سرمایه گذاری کنند

دنیای دیجیتال و داشتن یک سایت برای نمایش خدمات و محصولات مزایای بسیار زیادی خواهد داشت از جمله این مزیت ها میتوان به نمایش خدمات در میان طیفی بزرگی از کاربران که محدوده بسیار بزرگی نسبت به شکل سنتی را دارد و افزایش درآمد و فروش را در پی خواهد داشت ، اگر با نگاهی دقیق تر به این موضوع بنگریم خواهیم دید که در گذشته افراد برای جذب مشتری باید الزامات بسیاری در کنار کار خود میداشتند از قبیل داشتن مکانی برای نمایش ، تبلیغات و معرفی مداوم خود و خدمات خود برای جذب مشتریان و بسیاری از موارد دیگر ، اما امروزه با تفکر و تلاش در نمایش کار خود در عرصه دیجیتال و طراحی یک سایت کاربردی به جای آنکه شما به دنبال کاربران و مشتریان باشید آنان در جستجوی شما هستند

ما با داشتن تجربه بالا در طراحی سایت و خدمات آن از جمله بهینه سازی و سئو ، ارتقاء کیفی و بروزرسانی ، مدیریت و پشتیبانی سایت در قزوین آماده اجرای ایده هایتان هستیم و با طراحی سایت برایتان به پیشبرد و توسعه کسب و کارتان کمک خواهیم کرد ، سایت هایی که توسط ما طراحی میشوند از جدیدترین متد های روز پیروی خواهند کرد و استاندارد های لازم در آنها رعایت خواهد شد و مشتریان سایت را مطابق میلشان به گونه ای که میخواستند تحویل خواهند گرفت
با تلاش و کوشش فراوان سعی بر این داریم که طراحی سایت در قزوین را به بالاترین سطح کیفی برسانیم
برای ایجاد تغییری چشم گیر طراحی سایت در قزوین را میتوانید به [نت لند](https://mynetland.ir) بسپارید : )
Weird thing I missed about Async/Await: Implicit Returns
Tags: javascript
Published: 2022-07-17 18:29:25

Weird I didn't know this so far, because I've been using async/await syntax for a while now, but I've just realized this.

Async functions return a Promise implicitly and automatically themselves. We don't need to do anything for this (e.g., we don't need to do `return new Promise((resolve)=>{/*...*/})` inside our async functions (unless we explicitly need to)).

**Example**
This snippet:
```js
async function foo(){
    return "foo";
}
```
is an equivalent of this snippet:
```js
async function foo(){
    return Promise.resolve("foo");
}
```
For our comfort, JavaScript does the above conversion itself automatically.
Note that *even if we return nothing*, still the above conversion will take place, i.e.,:
```js
async function foo(){}
// is an equivalent of:
// async function foo(){ return Promise.resolve(undefined); }

// Let's call foo to confirm our claim:
foo();
// Prints: Promise {<fulfilled>: undefined}
```
Now why would understanding this be useful? Well personally I knew that whenever we use an `await` keyword, it has to be kind of \*coupled\* with some Promise, so for instance we could do:
```js
const delayFoo = ms =>
  new Promise(
    resolve =>
      setTimeout(() => resolve("foo"), ms)
  );
const delayFooThreeSeconds = () => delayFoo(3000); // (*) This returns a Promise explicitly.

// now inside some async function:
async function demo(){
    console.log("foo", 1);
    console.log(await delayFooThreeSeconds(), 2); // (*) This awaits the Promise returned explicitly by the call to delayFooThreeSeconds.
    console.log("foo", 3);
}

demo();
```
delayFoo is an example of a function that is returning a Promise explicitly, but what if we need an async call within our function at a point that is not where it's returning? For example, consider a nested async/await where a function is both doing an async operation and is supposed to be awaited itself too inside another async function:
```js
async function bar(){ // <-- (*) This function is not returning any Promises explicitly.
  doSomething();
  await delayFooThreeSeconds()
  doSomethingElse();
}
async function baz(){
  await bar(); // <--- (*) Would this be possible?
}
```
Now the `bar` function is not returning a Promise explicitly, so could it be awaited inside `baz`? As you might have guessed the correct answer by now: "Yes", because the above function is returning a Promise implicitly. (Even if we have multiple async calls wrapped inside an async function, the hierarchy of the promises will be the same as the invocations of the async functions.)

Here are some working examples for you to play with and see things better in action: https://playcode.io/928113/

-----

You're also welcome to join our very small and fledging Discord community where we share the things that we learn in the realm of programming with each other, it's called TIL (stands for "Today-I-Learned"). Join here: `https : // discord.gg / ATp8gc7G`. Thanks for reading this article.
The Bankless DAO - Polygon Week 5
Tags: blockchain, ethereum, web3, community
Published: 2022-07-17 17:59:35

[Part of Week 5: DAOs of Polygon Fellowship 2022](https://polygon.technology/polygon-fellowship/)

Week 5 is learning about Communities, DAOs, Social Tokens, etc.

The Bankless movement aims to onboard beginners to the world of crypto through Media, Collaborations, Communities and Simpler Finance tools.

Here is a short presentation on [The Bankless DAO](https://www.bankless.community/) I created:
https://docs.google.com/presentation/d/1TVf7wl-uOI80paKUK0G-n8ljKjVXxji4_m0BNAouZBo/edit?usp=sharing

DAOs are still an interesting topic for me, especially Social DAOs and Media DAOs.

I also created [my own Liquidity pool](https://app.uniswap.org/#/pool/3602?chain=polygon_mumbai) on Uniswap v3 on Polygon Testnet and received an NFT for my pair. Uniswap v3 is VERY different from Uniswap v2 and I think I need to explore v3 very soon.

I have covered my experience with Uniswap v2 in previous weeks which you can check out too. Primarily, this has been my github repo for smart contract interaction with Uniswap v2:
https://github.com/neelansh15/Uniswapper

See you all next week!
Websites to find Dataset for your Data Engineering projects.
Tags: datascience, dataengineering, database, dataset
Published: 2022-07-17 17:58:46

**Are you the one who is interested in Data Engineering career Like me!!**

Then this post will be very beneficial for you.

Below I'm going to list all time greatest websites to find the right datasets in every file format i.e _csv, xml, json_ etc. for your next **DE a.k.a DATA ENGINEERING** project.

1. [Dataset search](https://datasetsearch.research.google.com/)
2. [Kaggle](https://www.kaggle.com/datasets)
3. [Uci machine learning repo](url)
4. [FiveThirtyEight](https://fivethirtyeight.com/)
5. [Google Trends](https://trends.google.com/trends/?geo=IN)
6. [Datahub.io](https://datahub.io/)
7. [Data.gov](https://data.gov/)
8. [The U.S. Census Bureau](https://www.census.gov/)
9. [Aws open data](https://aws.amazon.com/opendata/?wwps-cards.sort-by=item.additionalFields.sortDate&wwps-cards.sort-order=desc)
10. [Google](Google.com)

So, what you waiting for choose a dataset build data model connect with database and dive into the project.

Stay connected to learn more about DE.

Thank you!!
Pixa.Pics - 16Kb NFTs in pixel art from real life images!!!
Tags: javascript, react, opensource, github
Published: 2022-07-17 17:45:36

{% embed https://youtu.be/iMMWj0WfQJE %}

They aren't NFTs as they aren't still not published inside a blockchain's smart contract but the fact that it can be diligently stored for a few peanuts and then scaled-up in Ultra HD from that (like a painting not crsip-edged) is very awesome when it is ditched with accessibility, that means, regular people can produce value and make it being profitable out of 100$-1000$ smartphone, very cool.

I had very good feelings working for months on this project that seeks for sponsors to get it's cost bought back, yet the project is complete and 100% free without ads but partners listing soon.

Any thoughts?
?Error in Substring function in react
Tags: react, javascript, beginners, discuss
Published: 2022-07-17 17:41:53

This render for the first time but soon I reload the page I get the error Slice is not defined.

I am getting a random movie Object from API. Object.data.results[any random index].overview is description of movie. I wanna cut this description to only 10 (lets say) letters.


```
function App() {

  const [movie, setMovie] = useState([])

  useEffect(() => {
    async function fetchData() {
      const req = await axios.get("https://api.themoviedb.org/3/movie/550?api_key={API_KEY})
//example IMDB API key

setMovie(() =>
req.data.results
[Math.floor(Math.random() * req.data.results.length)]
)
    }
//getting a random movie from 20 movies by data.result
    fetchData();
  }, [])

console.log(movie?.overview.slice(0,15))//working 


  return (
    <div>
        <h1>{movie?.title || movie?.name || movie?.original_name}</h1>

        <div>
          {movie?.overview.slice(0,15)} //error
        </div>
    </div>    
  )
}

export default App
Automatic cross-platform testing: part 6: 32 bit Linux
Tags: testing, githubactions, ci, 32bit
Published: 2022-07-17 17:25:26

#Previously on this channel

* [Introduction and testing on Linux](https://dev.to/drhyde/automatic-cross-platform-testing-part-1-linux-40ih)
* [Testing on FreeBSD](https://dev.to/drhyde/automatic-cross-platform-testing-part-2-freebsd-2394)
* [Testing on MacOS](https://dev.to/drhyde/automatic-cross-platform-testing-part-3-macos-2h2i)
* [Testing on Windows](https://dev.to/drhyde/automatic-cross-platform-testing-part-4-windows-1p7e)
* [Testing on OpenBSD](https://dev.to/drhyde/automatic-cross-platform-testing-part-5-openbsd-40gg)

#Testing on 32 bit Linux

Just about every virtual machine out there in the various CI platforms and hosting companies is a 64 bit x86 machine. But I wanted to test my code on a 32 bit machine as well. Unfortunately without having real 32 bit hardware available, or emulating it on more modern hardware, you can't *quite* do this, but you can at least run an OS and use libraries compiled for 32 bit hardware, 32 bit memory management, and with 32 bit pointers.

It's surprisingly easy, and lot less hackish than the solution I found for testing on OpenBSD.

Github workflows normally run directly on whatever host type you specify in the `runs-on` option. But you can instead tell them to [run in a `container`](https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container), which can be anything available on Docker Hub. Jobs running in a container can have all the same steps that you would have in a non-containerized job, including using other Github workflow actions.

To test my code on 32-bit Linux I use the `i386/ubuntu:latest` image. I am also using the same technique to run tests for one of my projects, which is sensitive to exactly which Linux distribution you are using, on Arch Linux, using the `archlinux:latest` image.
Dynamic Tab Title in Angular
Tags: javascript, angular, webdev, dynamictabtitle
Published: 2022-07-17 17:25:19

With Angular 14, Now we can generate dynamic tab titles with ease.

## 1. Title property in Routes
### Use Case:

- *Users page with users as tab name.(Users)*
- *Orders page with orders as tab name(Orders)*

*Then simply use title property in Routes as below*
### Code
```ts
export const APP_ROUTES: Routes = [
  {path: '/users', component: UsersComponent, title: 'Users'},
  {path: '/orders', component: OrdersComponent, title: 'Orders'}
];
```

## 2. Title with Resolve
### Use Case:

- *Users page with current user name in tab name.(User- Bharath)*
- *Orders page with order id in tab name.(Order Id:1)*

*Then we should create a service which implement `Resolve` class from Router module as shown below.*
### Code: 
```ts
@Injectable({
  providedIn: "root"
})
export class CustomTitleResolver implements Resolve<string> {
  
  resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<string> | Promise<string> | string {
// Have fun with naming
    return "<<project-name>> -" + route.paramMap.get("id") || "";
  }
}

```

*Update Routes with title property*

```ts
export const APP_ROUTES: Routes = [
  {path: '/users/:id', component: UsersComponent, title: CustomTitleResolver },
  {path: '/orders/:id', component: OrdersComponent, title: CustomTitleResolver }
];
```

## 3. Title Strategy

### Use Case:
*If you want a more generalized pattern, that will be applied **all over the application**.*

- *Prefixing a text to tab title.(Project X Users)*
- *Suffixing a text to tab title.(Users Project X )*

*Then create a service that extends `TitleStrategy` and add it as Provider in AppModule.*

### Code
```ts
@Injectable({
  providedIn: "root"
})
export class CustomTitleStrategy extends TitleStrategy  {
  constructor(private readonly title: Title) {
    super();
  }

  override updateTitle(routerState: RouterStateSnapshot): void {
    const title = this.buildTitle(routerState);
    if (title !== undefined) {
      this.title.setTitle(`myImpact (${title})`);
    } else {
      this.title.setTitle('myImpact');
    }
  }
}
```

*Naming Strategy should be added as provider in app module, so that angular is aware that you have provided an alternative Naming strategy.*

```ts
@NgModule({
  declarations: [
  ],
  imports: [
  ],
  providers: [{
    provide: TitleStrategy,
    useClass: IAMTitleStrategy
  }],
  bootstrap: [AppComponent]
})
export class AppModule {
}
``` 

### Note
Depending on your use case, you can use either of these ways and also mix up both Resolve and naming Strategy like me 

![Dynamic Tab titles using angular](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ebhzkmn2i5h5yjqn757b.png)
 
 
 
Happy coding 👨‍💻 !!
Postman API Session
Tags: postmanstudent, postmanapi, duhacks
Published: 2022-07-17 17:24:58

- It was glad to have such wonderful session conducted by Mr.Ali Mustufa on 101 API using Postman during hackathon of DuHacks #duhacks on 16th July,2022.
- I was not knowing much about the term API(Application Programming Interface) but it was great to know all that kind of stuff.
- It was great to know how the two communicate with each other using requests and responses using API's.
- Great experience and gained knowledge about API and Postman.
- Session + Hackathon is best experience.
- Hope such hackathon and session come soon.!
A simple NextJS blog template for developers [Open Source]
Tags: javascript, react, opensource, beginners
Published: 2022-07-17 17:00:31


I have developed a simple NextJS blog template for developers. It is still under active development.

https://github.com/devkiran/nextjs-blog-template

The following pages are available in the template:

- Home
- Projects
- Blog
- Contact

It uses the following tech stacks:

- NextJS
- Contentlayer
- React Markdown
- Tailwind CSS
- TypeScript
- ESLint
- Prettier
- Husky

Feel free to contribute!
I Made React Router v6 Type-Safe
Tags: showdev, react, typescript
Published: 2022-07-17 17:00:06

I updated my [react-router-typesafe-routes](https://github.com/fenok/react-router-typesafe-routes) for React Router v6. It's almost a complete rewrite, because React Router has changed quite significantly.

✨ Highlights:

- Full support for nested routes.
- Typing / validation of every URL part and state.
- Optional inferring of path params from provided `path`.
- Thin wrappers around React Router hooks for dealing with params in a type-safe way.
- Support for web and React Native (I didn't really test React Native 😅).

A detailed description is available at the [project page](https://github.com/fenok/react-router-typesafe-routes#readme). I hope it will help you in making your apps a little safer.
For those who wish to have a better resume. Just Contribute to this.
Tags: beginners, discuss, angular, webdev
Published: 2022-07-17 16:58:24

I have struggled a lot on finding a open source project to contribute just to make my profile good for recruitments and will be a great opportunity to learn how other people really code.

So here is a simple [password generator web app](https://rp-generator.netlify.app/) that is already live.

Let me know if you guys want to contribute so that you can something as project on a resume. 

Share this post to the students who are excited to start.

There are a lot of things that can be done here. Comment down below or contact me at [Twitter](https://twitter.com/papashrihari) I will just start up with some of the issues in the site (Mostly UI and Additonal Enhancements of your choice) 

{% embed https://github.com/ShrihariMohan/random-password-generator %}

Thanks & Happy Coding
_Peace_ 🕊
React.StrictMode
Tags: javascript, react, beginners, flatiron
Published: 2022-07-17 16:24:31

First, a little background on me. I am a mechanical engineer who has spent the last 8+ years in oil & gas. As my career "matured", I spent the majority of my time as a project manager. Over the past few years, I've struggled with the monotony that comes with project management - I rarely had the opportunity to deeply explore any aspect of my projects without the risk of sacrificing my administrative duties on another facet. I became frustrated with the lack of academic enrichment and decided to make a career pivot by enrolling in FlatIron School to pursue a career in Software Engineering.

I intend to use this blog as a medium to explore topics that I found interesting as a beginner. My hope is that other beginners will find my explanations useful, but even if another soul never reads these posts, it's still a beneficial learning exercise for me to compile the information. 

**So let's begin!**

react.StrictMode

What is StrictMode? When should I use it? We'll dive into that eventually, but let's imagine this situation.....you've just been asked to create your first React App. You head over to your terminal, and punch in: npx create-react-app

You wait a few seconds, cd into your new directory, then run npm start. The beautiful image of a spinning atom appears and you pull up your code. In your index.js, you notice that create-react-app has taken the liberty of wrapping your App in StrictMode:

React.StrictMode
    App
  React.StrictMode

Why? What does it do? You decide to explore a little bit and drop a console.log in your App.....it appears twice. Why? You only logged it once.....why is your App code appearing to execute twice? 

StrictMode is a tool that can be used to highlight potential issues in your code. It activates additional checks and warnings that are useful for future-proofing your code for newer versions of React. More specifically, StrictMode helps with:

- Identifying components with unsafe lifecycles
- Warning about legacy string ref API usage
- Warning about deprecated findDOMNode usage
- Detecting unexpected side effects
- Detecting legacy context API
- Ensuring reusable state

This is all great, but why is my code executing twice?

Answer: StrictMode renders components twice to detect any problems or warnings with your code; HOWEVER, THIS ONLY HAPPENS ON DEV AND DOES NOT AFFECT PRODUCTION.

Whew, what a relief! No need to frantically search through your code wondering why it's rendering twice (like I did). It's the normal process that StrictMode uses to evaluate the code and will have no impact on performance once deployed for production.

Feel free to utilize StrictMode for all of the good habits that it reinforces without the worry about production performance!

If the double rendering causes you anxiety, you can easily disable it by removing the tags around the App (or anything else that you've added it to).

Happy coding!