teleren/devto huggingface dataset:
Creating HttpCookie Class in C#
Tags: aspnet, httpcookie, csharp, tutorial
Published: 2022-11-07 14:26:55

Here, I want to Initialize **Cookie** in my Login Page. Firstly, what's a **Cookie**? This is a piece of information that's stored on the client's machine especially user preference information like Username, Password etc.

Now, Once logged in, I want the system to pull the user's records/information and store in the cookies. You can also set the number of times for your cookies login to be active, that's storing it and holding it for a particular duration. This here, makes it persistent or non-persistent. 

Since, I want to initialize it on when **"Logged-In"**, meaning I want Login records such as Username and Password etc.**("UserInfo")**. So, my block of code should be inside the Login Button click **btnLogin_Click** of my Login Page. So, I started off by creating the Cookie with the below block of code: E.g;
```
HttpCookie cookie = new HttpCookie("UserInfo");
```
Then I Check if the cookie exists in the current request by reading the Cookie Info and displaying it and also printing the properties of each cookie object with the below code;

```
 if (cookie != null)
{
 //This here, prints the properties of each cookie object
 cookie.Values.Add("Username", cookie.StaffUsername);
 cookie.Values.Add("StaffNumber", cookie.StaffNumber);
 cookie.Values.Add("StaffName", (cookie.FirstName + " " + 
 cookie.LastName));
 cookie.Values.Add("Address", cookie.Address);
 cookie.Values.Add("StaffID", Convert.ToString(cookie.StaffID));

 // This here, Sets the value of cookie to current date time.
 cookie.Value = DateTime.Now.ToString();

 //This here, Sets expiry to cookie object -clears within an Hour.
 cookie.Expires = DateTime.Now.AddHours(1);

//This sets the HttpContext object for the current HTTP request.
 HttpContext.Current.Response.AppendCookie(cookie);
  }
```
This is how I Initialized My cookie in my Login Page, I'll be writing more on Cookies as much as I'll be getting to use it.😊
30 cybersecurity search engines - danielmakelley
Tags: webdev, cybersecurity
Published: 2022-11-07 14:17:20

####   Original Tweet From  [@danielmakelley](https://twitter.com/danielmakelley)
{% embed https://twitter.com/danielmakelley/status/1588465944351084545 %}


1. Dehashed—View leaked credentials.
2. SecurityTrails—Extensive DNS data.
3. DorkSearch—Really fast Google dorking.
4. ExploitDB—Archive of various exploits.
5. ZoomEye—Gather information about targets. 
AdSpace Here!
6. Pulsedive—Search for threat intelligence.
7. GrayHatWarfare—Search public S3 buckets.
8. PolySwarm—Scan files and URLs for threats.
9. Fofa—Search for various threat intelligence.
10. LeakIX—Search publicly indexed information. 
AdSpace Here!
11. DNSDumpster—Search for DNS records quickly.
12. FullHunt—Search and discovery attack surfaces.
13. AlienVault—Extensive threat intelligence feed.
14. ONYPHE—Collects cyber-threat intelligence data.
15. Grep App—Search across a half million git repos. 
AdSpace Here!
16. URL Scan—Free service to scan and analyse websites.
17. Vulners—Search vulnerabilities in a large database.
18. WayBackMachine—View content from deleted websites.
19. Shodan—Search for devices connected to the internet.
20. Netlas—Search and monitor internet connected assets. 
AdSpace Here!
21. CRT sh—Search for certs that have been logged by CT.
22. Wigle—Database of wireless networks, with statistics.
23. PublicWWW—Marketing and affiliate marketing research.
24. Binary Edge—Scans the internet for threat intelligence. 
AdSpace Here!
25. GreyNoise—Search for devices connected to the internet.
26. Hunter—Search for email addresses belonging to a website.
27. Censys—Assessing attack surface for internet connected devices.
28. IntelligenceX—Search Tor, I2P, data leaks, domains, and emails. 
AdSpace Here!
29. Packet Storm Security—Browse latest vulnerabilities and exploits.
30. SearchCode—Search 75 billion lines of code from 40 million projects. 

Join 12,000+ subscribers here receiving weekly curated cybersecurity content:

 [https://danielmakelley.com/newsletter](https://danielmakelley.com/newsletter) 



Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
Amazing VS Code Extensions for Frontend Developers 🎨 - imAlfaiz
Tags: webdev, vscode, frontend, productivity
Published: 2022-11-07 14:03:53

####   Original Tweet From  [@imAlfaiz](https://twitter.com/imAlfaiz)
{% embed https://twitter.com/imAlfaiz/status/1589151234119716864 %}



###1|. Live Server

 [https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) 

###2|. CSS Peak

 [https://marketplace.visualstudio.com/items?itemName=pranaygp.vscode-css-peek](https://marketplace.visualstudio.com/items?itemName=pranaygp.vscode-css-peek) 
AdSpace Here!!
###3|.  Better Comments

 [https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) 

###4|.  Prettier - Code formatter

 [https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 

###5|. Colorize

 [https://marketplace.visualstudio.com/items?itemName=kamikillerto.vscode-colorize](https://marketplace.visualstudio.com/items?itemName=kamikillerto.vscode-colorize) 
AdSpace Here!!
###6|. JavaScript (ES6) code snippets

 [https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets) 

###7|. Tailwind CSS IntelliSense

 [https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) 
AdSpace Here!!
###8|. Windi CSS Intellisense
 [https://marketplace.visualstudio.com/items?itemName=voorjaar.windicss-intellisense](https://marketplace.visualstudio.com/items?itemName=voorjaar.windicss-intellisense) 

It's a wrap!

If you liked this Thread,
make sure to:

1. Follow me ✅
2. Retweet this post 🔁
3. Turn on the notification 🔔 



Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
World Wide Directory
Published: 2022-11-07 13:59:48

Listing your business to a world wide directory is the best way to ensure that you are getting the most out of your SEO efforts.

The Importance of Listing Your Business to a World Wide Directory

Today, it's more important than ever for businesses to be found on the Internet. In this article, we'll cover why listing your business on a World Wide Directory is an important step in achieving success with SEO and digital marketing.

First, let's talk about how search engines work when people are looking for information. When someone types in a search query, their search engine will show them results based off their past browsing history and other factors like location or language. If they've never visited your website before, then they'll see whatever comes up first on the SERP (Search Engine Result Page).

If you want your business to rank higher in Google's SERP (Search Engine Result Page), then you need to make sure that you're listed on major search engines. More importantly, you need to be listed on the top 3 major search engines in order to rank higher. The way that you achieve this is by re-doing your SEO strategy and getting listed on the most popular search engines in order of industry relevance.

[https://college-degree-coach.com/](https://college-degree-coach.com/)
FLiPStack for November 13, 2022
Tags: apachepulsar, spring, jdk17, streaming
Published: 2022-11-07 13:59:39


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

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

#ApachePulsar #ApacheFlink #Spring #DeltaLake #CDC  #SQL  #OpenSource #ApacheBookeeper #ApacheCon  #Containers #K8 #Kubernetes #Cloud #FLiPNStack #NovemberConferences 

Please subscribe to your favorite podcast channel. Matt Yonkovit.




CODE + COMMUNITY

Join my meetup group NJ/NYC/Philly/Virtual:

This is Issue #57!!


Now with Apache Pulsar support!!!

[https://github.com/apache/incubator-seatunnel](https://github.com/apache/incubator-seatunnel)

**CODE**

https://github.com/tspannhw/spring-pulsar-gtfsrealtime

**TALKS**

{% embed https://www.confluent.io/events/current-2022/lets-monitor-the-conditions-at-the-conference/ %}

{% embed https://www.youtube.com/watch?v=Vw-jlU8STBk %}

{% embed https://www.slideshare.net/bunkertor/all-day-devops-flip-stack-for-cloud-data-lakes %}

**ARTICLES**


**EVENTS**

Nov 15, 2022. OSA Con. Virtual. 


Nov 16-18, 2022. PASS Data Community Conference. Virtual.


Nov 20, 2022 9:00 pm. Pulsar Summit Asia. Virtual.


Nov 23, 2022: Big Data EU. Virtual.


Nov 29, 2022: Machine Intelligence Guild Speaker of the Month. Virtual.

Dec 6-8, 2022: Spring One: San Francisco

Dec 7, 2022: 3:00 pm 


Dec 7, 2022: 4:00 pm


December: LakeFS Meetup: San Francisco


Pinot / Pulsar Meetup

Hazelcast Event



**TOOLS**

[https://docs.helix-editor.com/title-page.html](https://docs.helix-editor.com/title-page.html)

[https://sshenc.sh/](https://sshenc.sh/)

[https://textshader.com/](https://textshader.com/)

[https://github.com/openrewrite/rewrite](https://github.com/openrewrite/rewrite)

[https://ntfy.sh/](https://ntfy.sh/)

[](https://www.prowlapp.com/api.php#apilimits)

[](https://github.com/slashbaseide/slashbase)
November - Month of Talks
Published: 2022-11-07 13:57:58

https://www.linkedin.com/pulse/november-month-talks-tim-spann-/

#ApachePulsar #ApacheFlink #Spring #DeltaLake #CDC  #SQL  #OpenSource #ApacheBookeeper #ApacheCon  #Containers #K8 #Kubernetes #Cloud #FLiPNStack #NovemberConferences #AllDayDevops #AIDevWorldExpo

It was an interesting Halloween week, with lots of cool conference talks and more to come.

They have added handles to Youtube, so here is one of my Youtube sites:


Apache Pulsar 2.10.2 is out!   Read the notes.

It was great speaking at the Aerospike Real-Time Forum.   The food, tech, speakers, attendees, and venue were amazing.  A big thanks to Aerospike, Databricks, Starburst Data, and StreamNative for making this happen.   








Add alt text
No alt text provided for this image
Photo by Nick (Aerospike)
Please subscribe to your favorite podcast channel. Matt Yonkovit.




CODE + COMMUNITY
Join my meetup group NJ/NYC/Philly/Virtual:

This is Issue #56!!


RELEASES



CODE

TALKS



ARTICLES


EVENTS
Nov 10, 2022 at 1:30PM EST: AllDayDevops. Virtual.


Nov 15, 2022. OSA Con. Virtual. 


Nov 16-18, 2022. PASS Data Community Conference. Virtual.


Nov 20, 2022 9:00 pm. Pulsar Summit Asia. Virtual.


Nov 23, 2022: Big Data EU. Virtual.


Nov 29, 2022: Machine Intelligence Guild Speaker of the Month. Virtual.

Dec 6-8, 2022: Spring One: San Francisco

Dec 7, 2022: 3:00 pm 


Dec 7, 2022: 4:00 pm


December: LakeFS Meetup: San Francisco


Pinot / Pulsar Meetup

Hazelcast



TOOLS
Blockchain Development with .NET
Tags: blockchain, dotnet, crypto
Published: 2022-11-07 13:39:39

Join us Live for FREE to inspire, learn and deep dive into Blockchain technologies and its development with .NET.

[Registration Link
](https://teams.microsoft.com/registration/xn_aUK8WfkKAc_VylzqqFA,luOnboMf0ECz7JmsVI-9rw,GSDZhnS1w0Cz3bqi3FEcFA,DDnx7Q5P9kuy0wLfodAd3Q,Q6P9jZDjz0-JF2M2llWNww,XunGXVbMuEG6Ty05Q47TOg?mode=read&tenantId=50da7fc6-16af-427e-8073-f572973aaa14)
This is a series of Webinars where we discuss, share and demonstrate about Blockchain development with .NET.
Blockchain is an emerging technology of this era. Without any doubt, blockchain is going to make several headlines, news, and research topics in the foreseeable future.

https://www.eventbrite.com/e/blockchain-development-with-net-tickets-462488665047

Blockchain is a technology for record-keeping and contract enforcement. It uses cryptography to make it extremely difficult to modify the previous history. Blockchain technology is referred to as distributed ledger, which is just like an accounting ledger that contains the history of transactions.

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

In this series of sessions, we will learn, discuss and deep dive into Blockchain technologies and its development with .NET platform. Furthermore, we develop Blockchain solutions and talk about the applications of it in broader term.
https://rijsat.com/2022/11/06/journey-blockchain-development-with-net/
The errors you may face for not whitelisting the IP Address (0.0.0.0) in your MongoDB Network Access
Tags: mongodb, network, nosql, errors
Published: 2022-11-07 12:54:13

You might face **two common errors** for not whitelisting the 0.0.0.0 IP address in **MongoDB Network access** and they are the following:

**<u>Problem-1</u>**

You may encounter an error like the one below in your local server:

**`MongoServerSelectionError: connection to 52.64.0.234:27017 closed at Timeout._onTimeout (C:\Users\YOUNG\node_modules\mongodb\lib\core\sdam\topology.js:430:30) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)`**

**<u>Problem-2</u>**

when you host your app in Vercel, you may find an error similar to the one shown in the picture:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dzn6zdnv81sgoaigpoom.jpg)

**<u>Solution</u>**

To fix these errors, you will just have to add '**allow access from anywhere**' in your MongoDB Network Access. But how???

Here are some easy steps you can follow:

1) Login into your [MongoDB Atlas account](https://account.mongodb.com/account/login), go to the **Network Access** and click '**Add IP Address**'

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


2) Click '**Allow Access From Anywhere**' and then click the '**Confirm**' button



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

Well done!!! You have successfully whitelisted the 0.0.0.0 IP Address in your Network Access.

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

Now, you will just have  to restart your local server(**nodemon index.js/node index.js/npm start/nodemon start**) to fix the error discussed in **problem 1** and redeploy your app in Vercel to fix the error discussed in **problem 2**:
**`vercel
 vercel --prod`**
NextJS with IIS
Tags: nextjs, nextauth, iis, deployment
Published: 2022-11-07 12:54:01

I've a NextJS application built with .net core web api as backend with these two running side by side on different ports. While the NextJS app is hosted on NodeJS server a reverse proxy is created for it in IIS so it can be accessed via http port 80/443, web api is hosted on IIS server on a different port 7240 which is accessible only locally to NextJS app. To add to the list, NextJS app is integrated with Azure AD for authentication purposes and everything is tying together well on the server locally after deployment. 

However, the problems start when I'm tying to access the NextJS app from internet facing URL using the reverse proxy.

- The workflow I'm expecting was that NextJS app public URL (reverse proxy) redirects to Azure AD to authenticate users and then based on the reply URL it redirects back to the same public facing URL. But the flow was going to the local hosted app url which is a NEXTAUTH_URL hosted on a specific port 3000.

- The NextJS app is trying to connect to the web api hosted on port 7240 via public url instead of connecting to it as a local hosted app on the server itself.

I'm somehow unable to figure out how to get this flow working with public url instead of running it on NodeJS default port 3000 which is accessible only on the server.

Can someone please help who has knowledge or experience with this.
How to pass command line arguments to a Node.js app?
Tags: node, javascript, beginners, programming
Published: 2022-11-07 12:44:08

## Introduction

Similar to a Bash script where you can pass arguments to a script using the `$1` syntax, you can also pass arguments to a Node.js app.

In this quick tutorial, you will learn how to pass arguments to a Node.js app using the [`process.argv` array](https://nodejs.org/docs/latest/api/process.html#process_process_argv).

## Prerequisites

Before you get started, you will need to have Node.js installed:

- [Download Node.js](https://nodejs.org/en/download/)

## Pass arguments to a Node.js app

Let's start by creating a new file called `script.js` and adding the following code to it:

```js
const process = require('process');

console.log(process.argv[2]);
```

A quick rundown of the `process.argv` array:

- `process.argv[0]` is the path to the Node.js executable
- `process.argv[1]` is the path to the script file
- `process.argv[2]` is the first argument passed to the script
- `process.argv[3]` is the second argument passed to the script and so on

Let's run the script with the following command:

```bash
node script.js DevDojo

# Output:
DevDojo
```

### Printing all arguments

To print all arguments, you can use a `forEach` loop just as you would with a standard array:

```js
const process = require('process');

process.argv.forEach((val, index) => {
  console.log(`${index}: ${val}`);
});
```

Let's run the script with the following command:

```bash
node script.js hi there devs
```

We are now passing 3 arguments to the script and in this case, the output of this script will be:

```bash
0: /opt/homebrew/Cellar/node@16/16.16.0/bin/node
1: /Users/bobby/dev/script.js
2: hi
3: there
4: devs
```

## Conclusion

This is pretty much it! I hope that you find this useful!

In case you are new to Node.js I could suggest the following tutorial on how to get started:

[How To Write Your First Node.js Script](https://devdojo.com/bo-iliev/how-to-write-your-first-nodejs-script)

To learn more about arguments in Bash scripts, you can read the following article:

[Bash Scripting Tutorial](https://devdojo.com/guide/bash)
Best Book for Learning JavaScript?
Tags: webdev, javascript, beginners, programming
Published: 2022-11-07 12:33:35

Hello Guys I am **learning front-end development.** Now I am Learning ReactJS, but somewhere I feel I need to master JavaScript to use React efficiently.But I have very limited knowledge on JS, so I am thinking to study on JavaScript and practice along with that. 

So **if you know any books that is good and efficient for beginners**, Please suggest me that. I will purchase that book ⚡🚀.

Once again, Thank you ❣️
How to handle anything
Tags: javascript, tutorial, reactive, rjsf
Published: 2022-11-07 12:05:24

---
title: How to handle anything
published: true
description: In this short instalment I show how I have changed the framework from just handling clicks to handling any element event.
tags: javascript, tutorial, reactive, rjsf
series: DIY reactive framework
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1eble812kv34qoah8l1k.png
---
This is just a small change. Initially I created functionality to allow for click events to be handled, [like so](https://github.com/Mellen/rjsf/blob/b9729a2135606f201ea967d68a932c67399256ae/rjsf.js#L66):

``` javascript
if(el.getAttribute('onclick'))
{
  let onclick = el.getAttribute('onclick');
  el.setAttribute('onclick', '');
  if(onclick in _internal.originalViewmodel.functions)
  {
    el.addEventListener('click', _internal.originalViewmodel.functions[onclick].bind(_internal));
   }
}
```
Obviously people will want to handle any element event, so I need to expand handling to allow for that.

My chosen method is a little brittle. I assume an attribute that starts `on` is and event, and assign accordingly.

``` javascript
for(let attr of el.attributes)
{
  if(attr.name.startsWith('on'))
  {
    let eventName = attr.name.substring(2);
    let eventHandlerName = attr.value;
    if(eventHandlerName in _internal.originalViewmodel.functions)
    {
      el.setAttribute(attr.name, '');
      el.addEventListener(eventName, _internal.originalViewmodel.functions[eventHandlerName].bind(_internal));
    }
  }
}
```
So now this is possible:

``` html
<div id="app">
  <input type="text" onkeyup="annoy">
</div>
```
``` javascript
import {rjsf} from '../rjsf.js'

(function()
{
  const appElement = document.getElementById('app');

  const app = new rjsf(appElement);

  const viewmodel = 
        {
          functions:
          {
            annoy: function(e)
            {
              e.preventDefault();
              alert('this is annoying isn\'t it?');
            }
          },
        };

  app.init(viewmodel);

})();
```
Which will alert a message every time there is a keyup event in the input box.

Next time will be a longer article investigating how to make a for element.

Please let me know any thoughts or questions you have in the comments below.

❤️, share, and follow for the next instalment!
Codédex Launch on Product Hunt! 🚀
Tags: news, startup, codenewbie, python
Published: 2022-11-07 12:01:08

Hi Devs!

It’s Sonny from [Codédex](https://www.codedex.io) –– a brand new learn to code platform for Gen Z. 

We’re a small-but-mighty team based in Brooklyn, NY but have teammates across the globe.

Since June 2022, we’ve gone full in on our mission to empower the next generation of builders and dreamers. And today, we are finally launching to the world on Product Hunt — please support us!

Head over to Product Hunt to give us an upvote! We are aiming for the Top 5 Products of the Day and it would mean the world if you can give us 30 seconds of your time.

⬆️ [https://www.producthunt.com/posts/codedex](https://www.producthunt.com/posts/codedex) ⬆️

Here's a preview of the site:

![Home page GIF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwqrfddamlfs0bxk392i.gif)

Lastly, huge shoutout out to the whole team: Dharma, Malcolm, Asiqur, Jerry, Rose, and Lil for working on this night and day for the past few months. LFG team!

Happy coding,
Sonny 🤠