teleren/devto huggingface dataset:
Token Gating Websites with Collab.Land
Tags: web3, security, nft, community
Published: 2023-01-19 13:46:03


Token gating is the idea of using tokens as a means of verifying membership or access to a community or resource. This can be done by requiring users to possess certain tokens in order to join a community or access certain resources.

This concept has gained significant traction in recent years, particularly within decentralized autonomous organizations (DAOs) and non-fungible token (NFT) communities. At its core, token gating involves using tokens to grant or restrict access to a community or resource. In this blog post, we'll explore the history, use cases, advantages, challenges, and future of token gating. We’ll also explore the possibilities of extending its current usage to cater for developers building for the web.

Yesterday, Collab.Land announced a new `/access-control` endpoint for its token gating API that allows developers to control access to their websites and web applications based on the possession of specific tokens.

The endpoint accepts two parameters:

`account` - The wallet address of the user.

`rules` - The token gating rules that specifies the token(s) to look for in the users address.

For each rule, Collab.Land will return a response indicating whether or not the rule has been granted or denied for the user. Here’s a sample request to the Collab.Land /access-control endpoint:

**POST**: https://api.collab.land/access-control/check-roles

**BODY**:

```json
{
  "account": "0x01c20350ad8f434bedf6ea901203ac4cf7bca295",
  "rules": [
    {
      "type": "ERC721",
      "chainId": 1,
      "minToken": "1",
      "contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
      "roleId": "001"
    }
  ]
}
```

Where account represents the users wallet address and rules is an array of objects representing each rule to be checked against the users wallet.

This call would return a sample response like this:

```json
{
  "roles": [
    {
      "id": "001",
      "granted": true
    }
  ]
}
```

To learn more about the Collab.Land token gating APIs, please read the official documentation or dive into a practical tutorial to build a gated website in minutes. You can also get your hands dirty with the Github repo. Want to build a token-gated website with JavaScript? here’s a sample code snippet to call the Collab.Land TGR endpoint using fetch:

```js
const res = await fetch(`https://api.collab.land/access-control/check-roles`, {
method: 'POST',
headers: new Headers({
    Accept: 'application/json',
    'X-API-KEY': process.env.COLLABLAND_KEY,
    'Content-Type': 'application/json',
}),
body: JSON.stringify({
    account: myWalletAddr,
    rules: [
      {},
      {}
    ]
  })
});
```

Using the website token gating APIs, Collab.Land extends the successful patterns of token-granted access to communities and DAOs to the web. You can learn how to build a token-gated website [here](https://dev.collab.land/tutorials/token-gating) or watch the video tutorial below
{% youtube EUVdGQuD_kw %}
"Hate altered into love" [No pun intended]
Tags: webdev, programming
Published: 2023-01-19 13:33:31

I hate stuff a lot, specific techniques, methods, gadgets, language, and frameworks. I have hated a lot of stuff in my past, but the process altered the hatred into love (let's say like).

I used to hate Django Rest Framework a lot, a lot, and now I am spending most of my time with it. You guys might say, hate your crush then... wait something's coming.
Hatred for Tailwind CSS was at the peak of my mind, and you guessed it right, I just love it so hard that I can punch one's face if he/she disagrees with the fact that "Tailwind is awesome".

The same goes with JWT, and JetBrains IDE (PyCharm, WebStorm, RubyMine, and others).

But I used to hate React, I learned it, and built three web apps with React/NextJs, and still hate it. So, I guess, hating my crush is not a good idea.
By the way, an exceptional case, I used to like Svelte, but now it's love.

Hey? Tell me something you hate that turned into a love that makes you go banana.
4 useful Terraform open-source tools
Tags: opensource, terraform, ci, aws
Published: 2023-01-19 13:32:19

{% youtube 2JA2KRE63q4 %}


Here is a list of some popular open-source Terraform tools that may be useful for your infrastructure as code (IaC) needs: 


![Design AWS cloud architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3gkmoxsb3w0xz426cxe.png)

1. **Tfsec:** a static analysis security tool that can be used to scan your Terraform configuration files and identify potential security issues. It checks for things like hardcoded secrets, insecure resource configurations, and other security best practices. 
2. **Infracost:** a tool that allows you to see the cost breakdown of your infrastructure resources on a monthly and hourly basis, helping you optimize your costs.
3. **OPA (Open Policy Agent):** a policy engine that can be used to enforce policies on infrastructure as code, including Terraform configuration.
4. **Terrascan:** a security scanning tool that analyzes Terraform configuration files and plans to identify potential security issues.

These tools can be run as a standalone tool or integrated into your CI/CD pipeline and help you streamline your infrastructure management processes.

Here are some examples of how these tools can be used as part of your CI workflow:


![Automate your CI/CD pipeline](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sbxuxb15xqls6bnmxbsi.png)

1. **Tfsec, Terrascan:** These tools can be run as part of your CI pipeline to check your Terraform configuration files for potential security issues. This can help you identify and fix issues before they get deployed to your infrastructure.
2. **OPA:** OPA can be used to enforce policies on your infrastructure as code. By integrating OPA into your CI pipeline, you can automatically validate your infrastructure configuration against your defined policies to ensure compliance.
3. **Infracost:** Infracost can be used to calculate the estimated cost of your infrastructure resources, based on your Terraform configuration files. By integrating Infracost into your CI pipeline, you can track the cost of your infrastructure over time and identify areas where you can optimize your costs.

Overall, integrating these tools into your CI workflow can help you automate the process of checking your infrastructure as code for issues, ensuring that your infrastructure is secure, compliant, and cost-optimized.

Do you have other Terraform-related open-source tools that you recommend? Please go ahead and add in the comments!

**[Sign up for free on Brainboard](https://app.brainboard.co/register)**

_> Visually design, deploy and manage cloud infrastructure with AWS, Azure, GCP & OCI. Start now and deploy in 1 hour._
Restrict Angular input to number only
Tags: webdev, angular, beginners, typescript
Published: 2023-01-19 13:30:16

You must create a **directive**, **directives** in Angular allow you to attach behavior to elements in the DOM. 

 - **Create a file**: number-restrict.directive.ts
 

```TypeScript
import {Directive, ElementRef, EventEmitter, HostListener, Output} from '@angular/core';

@Directive({
    selector: 'input[restrictNumbers]'
})
export class NumberRestricDirective {

    @Output() valueChange = new EventEmitter()

    constructor(private elementRef: ElementRef) {
    }

    @HostListener('input', ['$event']) onInputChange(event) {
        const initalValue = this.elementRef.nativeElement.value;
        const newValue = initalValue.replace(/[^0-9]*/g, '');
        this.elementRef.nativeElement.value = newValue;
        this.valueChange.emit(newValue);
        if (initalValue !== this.elementRef.nativeElement.value) {
            event.stopPropagation();
        }
    }

}
```
- **In your app.module.ts, add**: NumberRestricDirective to your declarations like that:

```TypeScript
@NgModule({
  imports:      [ BrowserModule, FormsModule ],
  declarations: [ AppComponent , NumberRestricDirective ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }

```
-**Add restrictNumbers attribute to your input balise** :

```html
<input  type="text" [(value)]="value" restrictNumbers/> 

```
And It's Okay
How to set up your development environment for React native
Published: 2023-01-19 13:00:23

If you are new to mobile development, the easiest way to get started is with Expo Go. Expo is a set of tools and services built around React Native and, while it has many features, the most relevant feature for us right now is that it can get you writing a React Native app within minutes. You will only need a recent version of Node.js and a phone or emulator. 

first you need to install the needed package.
npx create-expo-app AwesomeProject

cd AwesomeProject
npx expo start

Install the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.

Alternatively you can manually type the exp url on the expo go app and connect manually from your phone.


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

Now that you have successfully run the app, let's modify it. Open App.tsx in your text editor of choice and edit some lines. The application should reload automatically once you save your changes.

That's it!
Congratulations! You've successfully run and modified your first React Native app.
SRE book notes: The Evolution of Automation at Google
Tags: sre, automation, books
Published: 2023-01-19 12:54:56

These are the notes from [Chapter 7: The Evolution of Automation at Google](https://sre.google/sre-book/automation-at-google/) from the book [Site Reliability Engineering, How Google Runs Production Systems](https://sre.google/sre-book/table-of-contents/).

This is a post of a series. The previous post can be seen here:

{% embed https://dev.to/bitmaybewise/sre-book-notes-monitoring-distributed-systems-5fai %}

---

> doing automation thoughtlessly can create as many problems as it solves

---

> It isn’t appropriate to automate every component of every system, and not everyone has the ability or inclination to develop automation at a particular time. Some essential systems started out as quick prototypes, not designed to last or to interface with automation.

---

> Automate Yourself Out of a Job: Automate ALL the Things!

![Automate ALL the Things!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1s6s2o3ed2wz28ahpdnv.jpg)

---

> We graduated from optimizing our infrastructure for a lack of failover to embracing the idea that failure is inevitable, and therefore optimizing to recover quickly through automation.

---

> A team not running automation has no incentive to build systems that are easy to automate.

---

> The most functional tools are usually written by those who use them.

---

> shipping and iterating rapidly might allow you to implement functionality faster, yet rarely makes for a resilient system.

---

A post worth reading, from the Engine Yard blog: 

{% embed https://www.engineyard.com/blog/pets-vs-cattle/ %}

---

If you liked this post, consider subscribing to my newsletter [Bit Maybe Wise](http://bitmaybewise.com/).

You can also follow me on [Twitter](https://twitter.com/bitmaybewise) and [Mastodon](https://mastodon.online/@bitmaybewise).

---

Photo by [Lenny Kuhne](https://unsplash.com/@lennykuhne) on Unsplash
A JavaScript roadmap is a plan or guide for learning and mastering the JavaScript programming language
Tags: javascript, programming, tutorial, career
Published: 2023-01-19 12:51:27

**Basic JavaScript**: Learn the basics of JavaScript such as variables, data types, operators, control flow, and functions.

**JavaScript Objects**: Learn about objects in JavaScript, including object literals, constructors, and the this keyword.

**JavaScript Arrays**: Learn about arrays in JavaScript, including array methods such as map(), filter(), and reduce().

**JavaScript Document Object Model (DOM)**: Learn how to manipulate web pages using JavaScript and the DOM.

**JavaScript Browser API**: Learn how to interact with the browser using JavaScript, including working with events, the browser history, and the browser's storage.

**Advanced JavaScript**: Learn more advanced concepts in JavaScript such as closures, prototypes, and the this keyword.

**JavaScript Frameworks**: Learn to use JavaScript frameworks such as React, Angular, or Vue.js to build web applications.

**JavaScript Build Tools**: Learn to use build tools such as Webpack, Babel, and Grunt to optimize and bundle JavaScript code.

**JavaScript Libraries**: Learn to use popular JavaScript libraries such as jQuery, Lodash, and Moment.js.

**JavaScript Best Practices**: Learn about best practices in JavaScript development, including code organization, debugging, and testing.
Is Javascript the king of software languages?
Published: 2023-01-19 12:51:09


JavaScript is a popular programming language that is widely used for web development and can also be used for server-side programming with technologies such as Node.js. Its diverse application on both server side and client side frameworks such as react.js, VUE.js and NEXT.js and the plethora of applications that can be built and managed using javascript and its diverse frameworks one is tempted to say that " Javascript is the king of software languages" and you might not be wrong to think so.

JavaScript can create different kinds of software such as games, computer programs, web applications, and even technologies like blockchain. However, JavaScript is arguably the most popular programming language for the web. For example, more than 125,000 jobs on LinkedIn are looking for working professionals skilled in JavaScript.

However, it is not considered the "ultimate software language" as it may not be the best fit for all types of projects and there are other languages with their own strengths and use cases. Ultimately, the choice of programming language depends on the specific requirements of the project and the preferences of the developers.

What do you think...??
Java Technology Trends that you must know
Tags: java, javascript, react, bigdata
Published: 2023-01-19 12:49:10

Given the fact that Java has been around for over a quarter-century, new [java technology trends](https://www.infiraise.com/java-technology-trends-that-you-must-know/) emerge on a daily basis. By incorporating these trends into your next Java project, you’ll be able to keep up with the modern consumer.

Watch this space if you want to see what your company can achieve with the latest Java technology trends.

## Top 8 Java Technology Trends To Watch in 2022


### 1. GIT
  
  Almost every developer you encounter will be familiar with 
  GitHub, but few will have mastered Git, a command-line version 
  a management system that requires a little more knowledge.

### 2. Big Data

  Data management is a notion that back-end engineers are familiar 
  with. Big data, on the other hand, necessitates special care. 
  Large and complicated data sets, as well as the approaches to 
  data engineers must use to cope with them, are referred to as 
  big data.

### 3. Serverless Architecture

  An application that operates without requiring you to manage the 
  the infrastructure of a real server is referred to as serverless 
  architecture or serverless computing.

### 4. Spring Framework

  Spring Framework is a lightweight, easy-to-deploy Java 
  technology that every [competent Java developer] 
  (https://www.infiraise.com/hire/hire-java-developer/) should 
  have.

### 5. Artificial Intelligence (AI)

   The sheer promise of AI-driven apps earns them a standing 
   ovation.

### 6. Mobile and Android Development

   For many years, Java plays a prominent role in [Android 
   development](https://www.infiraise.com/hire/hire-android-developer/). But, as is customary in the tech sector, there’s 
   always something fresh to look forward to. Mobile app 
   developers, for example, may now utilize Java to create apps 
   for wearables like smartwatches and fitness trackers.

### 7. Remote Access

   There’s no better time to adopt Java than now, with the COVID- 
   19 pandemic radically altering how and where workers get their 
   job done.

### 8. Java 9-17

  Though you might have Java developers on your team, Java hasn’t 
  made any dramatic changes to the language since Java 8.


Java is a powerful and versatile programming language with a lot to offer. All you have to do now is put the tools to work.

Of course, the Right people are also required. You may have just killed two birds with one stone if you’re hunting for [Java developers](https://www.infiraise.com/hire/hire-java-developer/).

Article Source:https://www.infiraise.com/java-technology-trends-that-you-must-know/
Python RoadMap - With DSA
Tags: python, webdev, programming, tutorial
Published: 2023-01-19 12:32:11

1.Lists and Tuples

- Creating and manipulating lists and tuples
- List and tuple methods (append, insert, remove, etc.)
- Using lists and tuples in loops and control structures


2.Dictionaries and Sets

- Creating and manipulating dictionaries and sets
- Dictionary and set methods (get, items, etc.)
- Using dictionaries and sets for efficient data lookups


3.Strings and Regular Expressions

- Working with strings and string methods
- Using regular expressions for pattern matching


4.Control Structures

- If-else statements
- For and while loops
- Iterating through data structures
- Using the range() function


5.Functions

- Defining and calling functions
- Parameters and arguments
- Return values
- Scope


6.Recursion

- Understanding recursion
- Implementing recursive algorithms
- Tail recursion


7.Sorting and Searching

- Sorting algorithms (e.g. bubble sort, merge sort, quick sort)
- Searching algorithms (e.g. linear search, binary search)

8.Data Structures

- Stacks and Queues
- Linked Lists
- Trees and Graphs
- Hash Tables


9.Advanced Topics

- Dynamic Programming
- Greedy Algorithms
- Divide and Conquer
- Backtracking
- Complexity Analysis


10.Standard Libraries

- Using built-in libraries for common tasks
- NumPy and SciPy for scientific computing
- Pandas for data analysis
- Scikit-learn for machine learning
- Matplotlib for data visualization
- NetworkX for graph and network analysis


11.Good Practices

- Code organization
- Writing clean and readable code
- Debugging techniques
- Best practices for optimization
- Using version control system
- Enforcing coding conventions
State management with Nuxt 3
Tags: webdev, javascript, beginners, programming
Published: 2023-01-19 12:20:39

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

State management in Nuxt 3 refers to the process of managing and updating the data or state of a Nuxt application. This is typically done using a library called Vuex, which is a centralized store for all the data in a Nuxt application.

In Vuex, the data is stored in a centralized store called the "state", which can be accessed by any component in the application. The state can be updated using "mutations", which are functions that are used to change the state. The mutations are triggered by "actions", which are functions that are used to perform specific tasks and trigger the mutations.

For example, if you have a user login feature, you would have an action that handles the login process, and a mutation that updates the state with the user's information. The component that displays the user's information would then access the state to display the updated information.

In addition to the state, actions, and mutations, Vuex also has a feature called "getters", which are functions that are used to retrieve specific pieces of data from the state. This allows for more efficient data retrieval and can prevent unnecessary re-rendering of components.

Overall, state management in Nuxt 3 allows for a centralized and efficient way to manage and update the data in a Nuxt application. It also allows for easy communication between components, which can help to keep the code organized and maintainable.

Guillaume Duhan
What is the Cost of Building an App like Zomato?
Tags: webdev, react, node, android
Published: 2023-01-19 11:48:31

Creating an app like Zomato can be a complex and costly endeavor. There are several factors that will determine the **[overall cost of building an app](https://www.groovyweb.co/blog/how-much-does-it-cost-to-develop-an-app-cost-breakdown/)**, including the complexity of the features, the development team, and the region in which the app is being built.

One of the main factors that will affect the cost of building an app like Zomato is the complexity of the features. For example, a basic app that allows users to search for nearby restaurants and place orders would be less expensive to build than an app that includes advanced features such as personalized recommendations, real-time tracking, and group ordering.

Another factor that will impact the cost of building an app like Zomato is the development team. Hiring a team of experienced developers with expertise in mobile app development, database management, and user experience design will be more expensive than hiring a less experienced team. Additionally, the region in which the app is being built can also affect the cost. Building an app in a developed country like the United States or Canada will typically be more expensive than building the same app in a developing country.

Based on these factors, the cost of building an app like Zomato can range from $50,000 to $250,000 or more. However, the best way to get a more accurate estimate is to consult with a development team and discuss your specific requirements.

In addition, it's important to note that the cost of developing an app like Zomato is not a one-time expense. There will be ongoing costs associated with maintaining the app, including server costs, security updates, and bug fixes. Additionally, you may also need to invest in marketing and advertising to promote your app and attract users.

In summary, the **[cost of developing an app like Zomato](https://www.groovyweb.co/app-cost-calculator)** can vary greatly depending on various factors such as complexity of the features, the development team, and the location of development. It's important to consult with a development team and discuss your specific requirements to get a more accurate estimate. Additionally, it's important to keep in mind that the cost of developing the app is not a one-time expense and there will be ongoing costs associated with maintaining the app.

Without a doubt, Zomato, which started its journey in 2008, has established itself as the first choice when it comes to reliability and accuracy in finding nearby restaurants. These apps are the only way to meet your needs in every department, whether it is related to location, atmosphere, menu, rating, price, home delivery and many more.