teleren/devto huggingface dataset:
Linode + DEV Hackathon Reminder ⏰
Tags: linodehackathon, linode, linux, meta
Published: 2023-02-08 17:45:38

---
title: Linode + DEV Hackathon Reminder ⏰
published: true
description: You still have time to participate in the Linode + DEV Hackathon! 
tags: linodehackathon, linode, linux, meta
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yghqrfo81jak5nk5q52x.jpg
---

### Submissions for the Linode + DEV Hackathon are due on Feb 20th at 11:59 PM UTC.

{% embed https://dev.to/devteam/announcing-the-linode-dev-hackathon-377p %}

---

Akamai Cloud Computing based on Linode provides a number of services and products that give both developers and enterprises the flexibility and support they need to build, deploy, and scale their modern applications.

The [Linode + DEV Hackathon](https://dev.to/devteam/announcing-the-linode-dev-hackathon-377p) is an opportunity to harness Linode to build a new application, write a post about it (your "submission"), and share your work with the world! In doing so, you'll earn a limited-edition profile badge and a DEV sticker pack. You'll _also_ be eligible to win up to $1,000 USD in cash, up to $312 USD towards the Forem Shop, and lots more. 🔥 

Full details and rules for participating in the Linode + DEV Hackathon can be found [here](https://dev.to/devteam/announcing-the-linode-dev-hackathon-377p).

### Don't forget to submit your project by February 20th!

---

If you get stuck at any point, please refer to the [help thread](https://dev.to/devteam/linode-dev-hackathon-help-thread-1cmo) which the DEV and Linode + DEV teams are monitoring. If you instead just want to connect or swap ideas with other participants, the [community discussion thread](https://dev.to/devteam/community-discussion-thread-linode-dev-hackathon-59k1) is the spot to do just that!

If you've already published your submission, great job! Our judges look forward to reviewing your project. Thanks for participating. You're also invited to submit multiple times if you wish!


Happy coding!
global variable
Published: 2023-02-08 17:38:25

instance variable 
```rb 
@var = "I am instance var"
class C
    def examine_var
        puts @var
    end
end

c = C.new 
c.examine_var
```

global variable 
```rb
$gvar = "I am a global var"
class C
    def examin_global
        puts $gvar
    end
end

c = C.new 
c.examin_global
```

```rb 
class Person 
    def whole_name
        n = $first_name + " "
        n << "#{middle_name} " if $middle_name
        n << $last_name
    end
end

david = Person.new 

$first_name = "Pooya"
$last_name = "Ghobadi"

puts david.whole_name
```
JSTools Weekly - 2023#5
Tags: javascript, typescript, node, opensource
Published: 2023-02-08 17:09:51

The latest issues of our weekly newsletter called [JSTools Weekly](https://jstools.substack.com/) just released.


⭐TOP new javascript releases in this issue:


![TOP new javascript releases in this issue:](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c84ye4ca0whufccv1uyl.png)


[See more new javascript releases](https://jstools.substack.com/p/2023-topjstools-5)

🔥HOT javascript tools in this issue:


![TOP new javascript releases in this issue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9q1juebq4vnxwh9v9t4j.png)

[See more hot javascript tools](https://jstools.substack.com/p/2023-hotjstools-5)

✨NEW javascript tools in this issue:


![NEW javascript tools in this issue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h2hzgz8qfdsr7jgqf4vo.png)



[See more new javascript tools](https://jstools.substack.com/p/2023-newjstools-5)
My Journey In The Open Source World - Contributing to other libraries #1
Tags: javascript, typescript, opensource, github
Published: 2023-02-08 17:00:00

[Follow me on Github!](https://github.com/Cadienvan)

Today I will share some of the contributions I made in the Open Source community, hoping to inspire and motivate someone else to do the same.

I will not talk about **all** my contributions as many times we are talking about very little impacts on the library itself, but wanted to mention some important milestones here and there.

---

[paralleldrive/cuid2](https://github.com/paralleldrive/cuid2/pull/17)
Moving globalObj and primes outside of functions scopes to prevent reinitialization allowed a small, yet impactful performance improvement for one of the most known UUIDs generator in the JavaScript panorama.

---

[mcollina/hyperid](https://github.com/mcollina/hyperid/pull/33)
Did you know converting a function into a statement, declaring a variable and changing a Base64-related method could provide a 5% performance improvement on the fastest UUIDs generator library on npm? I didn't, and was thrilled to find it out!

---

See you in the next episode!
For Loop in Solidity
Tags: web3, blockchain, solidity, ethereum
Published: 2023-02-08 16:55:55

>The for loop in Solidity is used to execute a statement or block of statements repeatedly as long as the condition is true

The for loop is the most compact kind of loop available. It is comprised of the three essential components listed below:

- Our counter is initially set to a starting value during the loop startup process. The initialization statement is executed before the start of the loop's execution.

- The test statement is used to determine whether a particular condition is true or false. If the condition is met, the code contained within the loop will be performed; if it is not, the control will be released from the loop.

- The iteration statement is where you can change the value of your counter by increasing or decreasing it.

You can put all three pieces on a single line and split them with a semicolon if you want.

**Syntax**
```
for (initialization; test condition; iteration statement) {
   Statement(s) to be executed if test condition is true
}
```

## For loop examples

**Example 1**
```
pragma solidity ^0.8.0; 
   
// Creating a contract
contract Types { 
     
    // Declaring a dynamic array 
    uint[] data; 
  
    // Defining a function 
    // to demonstrate 'For loop'
    function loop(
    ) public returns(uint[] memory){
    for(uint i=0; i<5; i++){
        data.push(i);
     }
      return data;
    }
} 
```
**Example 2**
```
pragma solidity ^0.8.0;

contract SolidityTest {
   uint storedData=10; 
  
   function getResult() public returns(string memory){
      uint a = 10; 
      uint b = 2;
      uint result = a + b;
      return integerToString(result); 
   }

   function integerToString(uint i)public returns (string memory) {
      if (i == 0) {
         return "0";
      }
      uint j=0;
      uint len;
      for (j = i; j != 0; j /= 10) {  //for loop example
         len++;         
      }
      bytes memory bstr = new bytes(len);
      uint k = len - 1;
      while (i != 0) {
         bstr[k--] = byte(uint8(48 + i % 10));
         i /= 10;
      }
      return string(bstr);//access local variable
   }
}
```
For more content, follow me on - https://linktr.ee/shlokkumar2303
ezy – open-source gRPC client, alternative to Postman and Insomnia
Tags: testing, webdev, api, grpc
Published: 2023-02-08 16:47:57

{% embed https://github.com/getezy/ezy %}

In this release I have concentrated on user experience:

- Full support of shortcuts
- Reworked collections management
- Notifications
- Improved UX

gRPC clients I’ve worked with had drawbacks and didn’t fit my use-case in a way I was expecting, since I’ve started working with gRPC 3+ years ago.

Since then, I wanted a tool that fits any need in gRPC world. This is why I created ezy.

Compared to Insomnia and Postman, ezy offers better streams support, allows you to use Server-Side and Mutual TLS with custom TLS certificates, works with gRPC-Web and has a more slick UI/UX.

If you are looking for a gRPC/gRPC-Web client which fits your needs, give ezy a chance!

I’d love to hear your feedback and answer any questions regarding ezy.
self
Published: 2023-02-08 16:47:02

```rb
class C  
    def C.x # self.x, C == self, self is C
        puts "Class method: <C.x> of class C"
        puts "self: #{self}"
    end
end

C.x # self.x
```

```rb 
class C  
    def C.x
        puts "Class method: <C.x> of class C"
        puts "self: #{self}"
    end
end

class D < C  

end

C.x # self.x -> self is C
D.x # self.x => self is D
```
```rb 
class Test
  def talk

  end
end 

obj = Test.new 
obj.talk
# same as self.talk
```
5 Heavenly VSCode Extensions!! 🤩
Tags: productivity, vscode, programming
Published: 2023-02-08 16:40:01

So, you might have seen my article [What text editor should I use?](https://dev.to/youssefmic/what-text-editor-should-i-use-43a6), and you chose VSCode, so, now here are 5 heavenly VSCode extensions.
So, let's get started with no particular order:

## 1. Better Comments:

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

This extension helps you write well, better comments (pun). You can use the character "?" for a question "!" for a problem "*" for a notice and "TODO" for todos, if you are like me, it's not that helpful because you never write comments 😂.

## 2. Code Runner:

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

It lets you run code in multiple languages like C, C++, Java, JS, PHP, Python, Perl, Ruby, Go, Lua, JavaScript, and many others!
Yeah, really useful!

## 3. Code Spell Checker

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

So, imagine how embarrassing it is to write a misspelled word in your code, UGH! So, quick fix and done!

## 4. Remote Repositories:

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

When publishing your code on GitHub you might have to quickly fix some stuff, therefore, instead of changing the local file and then committing and blablabla, or maybe using the janky GitHub editor, with this extension you can just edit the source code directly in your editor!

## 5. Halcyon Theme

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

This may not be for everyone, but this (for me) is the best VSCode theme ever!

We've come to an end! Hopefully you've enjoyed!!
JavaScript tutorial series: Introduction.
Published: 2023-02-08 16:37:45

If you're on the path of becoming a web developer, be it frontend or fullstack you've probably already heard about JavaScript.

## What is JavaScript? 

JavaScript is a scripting language, used primarily to improve user-webpage interaction and creating dynamic web page content by manipulating the document object model. JavaScript is one of the most popular languages today.

During this series we'll see how JavaScript increases the interaction between the user and the application. 

## In this series we'll take a look at:

- Data types

- Strings

- Arrays

- Objects

- Functions

- Dive into object oriented programming.
Crack Javascript Interviews
Tags: javascript, interview, javascriptjobs
Published: 2023-02-08 16:29:48

{% embed https://www.youtube.com/embed/W33gtWKD10w %}

{% embed https://www.youtube.com/embed/BBSHOhfIGfA %}

Hi Everyone,

Welcome to my YouTube Channel,

Here i will be covering all different ways to prepare for javascript interviews. 

Hi, everyone. Welcome back. And in this playlist, I'm going to talk about JavaScript interview questions. So JavaScript interview questions can be divided into three different sections. Let's say you are preparing for the fresher interview questions or the advanced senior developer interview questions or maybe like tech lead or manager level of questions.

So, I mean, these are different categories. Let's say you are fresher than how can you get an entry-level job in the market

Your learning will be different, your skill set will be different. Let's say you are a senior developer or you're looking for a senior developer position then what all different tool sets skill set you are you required to crack a JavaScript interview that all those things we are going to talk about so I'm going to provide you with different tips and tricks different methods to prepare for the job. You can use hacker rank top coder,  code chef, or any other these kinds of online tools to get hands-on programming. My target is not to prepare you for the data structure and algorithm because that's not what I am targeting 


here I will be preparing you for the interview questions which are targeted on the day to day jobs like, how to write components in react, how to get hands-on on the core JavaScript skills, or maybe some coding interview questions where there will be small problem statements obviously not like reverse linked list or reverse a  tree or something like that. A simplified problem statement which is which can be discussed or can be done by just using basic programming concepts. We will be using hacker rank, which provides a lot of full-stack code tests and certifications. so if you are already aware of all those concepts you can you can just try and test you skills
MVC in Ruby on Rails
Tags: ruby, rails, mvc, webdev
Published: 2023-02-08 16:28:07

Have you heard about the **Model-View-Controller (MVC)** architecture but are not sure what it means? Do not worry, you are not alone! In this article, we will take a look at what the MVC architecture is and how it works in Ruby on Rails.

Think of building a website like building a house. Just like a house has a kitchen, living room, bedrooms, etc., a website also has different components such as databases, HTML templates, and more. In the MVC architecture, these different components are separated into three main parts:

**Model**: The model represents the data of your website, like the database that stores information about your users, products, and more.

**View**: The view is what the user sees on the screen, like the HTML templates that display the information from the database.

**Controller**: The controller acts as a **mediator** between the model and the view. It takes the data from the model and passes it to the view, which then displays it to the user. It also takes the user's inputs and passes it back to the model for processing.

Let's take an example of an online store to understand this better. The **model** will represent the products that are available for sale in the store. The **view** will show the products to the user, and the **controller** will handle the process of adding the product to the cart and taking the payment.

By separating these components, it makes the code more organised and easy to maintain. If you need to make changes to the product information, you only need to update the model, and the changes will automatically be reflected in the view.

In Ruby on Rails, the MVC architecture is implemented by default, which makes it easier for developers to create and maintain web applications. The framework takes care of connecting the model, view, and controller, so the developer can focus on writing the code for each component.

In conclusion, the MVC architecture is a crucial concept for web development, and it is used in many popular web frameworks, including Ruby on Rails. By understanding how it works, you will be able to build better and more organised web applications.

I hope this article has helped you understand the MVC architecture and how it works in Ruby on Rails. If you have any questions, feel free to ask!
Native or Cross Platform: What's Best for Your Next App? (external)
Tags: crossplatform, reactnative, flutter
Published: 2023-02-08 16:17:03

**See the original blog post in [QBurst blog.](https://blog.qburst.com/2023/01/native-or-cross-platform-whats-best-for-your-next-app/)**

Whether to opt for native development or cross-platform is a question as old as the major mobile platforms themselves. Yet it continues to vex clients on the verge of their next app project even in 2023.

- “Shall we use cross platform or native development?”
- “I heard that React Native costs less, so can we use it?”
- “Why Airbnb moved to native development lately?”

I hear a lot of such questions from clients all the time. They are always confused which technology to choose to build their next app. They hear a lot that cross platform is cheaper, but confused why still many people are opting for native development.

I am exploring the options from the experience that I had in the last decade working on both native and cross platform tools to build mobile apps. This will help you to make a decision whether to choose cross platform or native development to build your next mobile app. [Read the blog post here.](https://blog.qburst.com/2023/01/native-or-cross-platform-whats-best-for-your-next-app/)
Keep it STRICT
Published: 2023-02-08 16:16:19

'use strict'; 

is the way to turn strict mode on. 

Strict mode does not fix hoisting :////

Note, hoisting is only really a thing with var. If you use let or const, hoisting doesn't happen. 

let and const variables are block-scoped, which means that if you introduce them in a block (e.g., a conditional) it only exists in that block. This means that it won't seep into other elements of the code external to that block and muddy those.
nesting modules and classes
Published: 2023-02-08 16:13:46

create instance from classes that is in module 
```rb
module Tools
    class Hammer

    end
end

h = Tools::Hammer.new
```
this technique can help it two classes have a similar name but are NOT the same class! 
for example:
```rb
Tools::Hammer.new
```
and 
```rb
Piano::Hammer.new
```
Tool is one case and Piano is another
Svelte Kit Training Sessions
Tags: svelte, sveltekit, javascript, programming
Published: 2023-02-08 16:12:54

Hello everyone welcome to my other blog in this blog, we are going to talk about svelte-kit is a server-side framework built on top of sveltejs which I have already covered it in another playlist, and now I'm going to publish a new playlist on svelte-kit 

{% embed https://www.youtube.com/embed/8b2igO_zpiI %}

In this whole playlist is we will talk about how do we do the routing in the SSR, 
how we can load the data at the client side and server side, how we handle the forms. And how we populate the data in different places.
How we manage the server side session was the user is logged in from either Firebase either audio or just by using username password for the form actions.

We'll talk about the different deployment adapters like deploying this work kit to Netlify versal or your own lambda. 

We'll talk about static site generation and all the different adapters to deploy the application for the svelte kit. We'll talk about advanced routing, hooks, Service workers, and all the different advanced concepts.

[note] 

i am lazy at writing and i do more on putting content on videos you can follow for all these latest seveltekit videos in my playlist 

https://www.youtube.com/watch?v=0coB7zVRY4U&list=PLIGDNOJWiL188A6n7PXYOTOTJKynGhK35
Don't add or change methods in built-in JavaScript objects
Tags: webdev, javascript
Published: 2023-02-08 16:11:33


It is possible to add and modify properties and methods to JavaScript classes and prototypes using the `prototype` property of the class or constructor function.

```javascript
class Dog {
    bark() {
        return "Woof!";
    }
}

// Add a new method to the Dog class
Dog.prototype.howl = function() {
    return "Ooowhooooooo!!!";
};
```

Even though it is possible to use this to add more properties or methods to built-in objects (i.e. `Array`, `String`, etc.), it's generally a bad idea to do it.

The problem is, when you make changes to a native object, you could cause weird bugs across the entire codebase, even in external libraries that your project uses. 

When you add a new method to a native object, there is the chance of name collisions: a native method with the same name might be added in the future.

Those kinds of errors are very hard to find, especially if the developer who found the bug is not the one who changed the native object. They might assume that built-in objects were never modified (which if often the case) and they would take hours trying to debug.

As I've read on other websites: built-in objects aren't your objects, they are everyone's objects. When you make changes to them, you also change everyone's code.

## What are the alternatives?

There are a couple of alternatives to modifying built-in objects. If you add a small number of methods, you can simply create a regular function that takes the object instance as an argument.

Another alternative is to create a new class that inherits from the built-in object. For example:

```javascript
class ShufflableArray extends Array {
    // This method randomizes the elements in an array
    shuffle() {
        const copy = [...this];
        
        let index = 0;
        while (copy.length > 0) {
            const copyIndex = Math.floor(Math.random() * copy.length);
            this[index] = copy.splice(copyIndex, 1)[0];
            index++;
        }
    }
}

const array = new ShufflableArray(1, 2, 3, 4, 5);
array.shuffle();
console.log(array); // Outputs [4, 1, 3, 5, 2]
```

---

Become a Better JavaScript Developer! Easy, actionable steps to level up your JavaScript skills, right to your inbox. [Click here to subscribe](https://nicozerpa.com/newsletter)
module class adjective - noun
Published: 2023-02-08 16:03:11

module should be adjective 
and 
class should be noun 
for example this is wrong way ! 

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

rather we should do this 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hse5kut7co5fsjtpoi8d.png)
Java
Published: 2023-02-08 15:52:16

不同类型的整数一起运算，小类型需要转换为大类型，short、byte、char一律转换为int再进行计算（无论算式中有无int，都需要转换），结果也是int；如果算式中出现了long类型，那么全部都需要转换到long类型再进行计算，结果也是long，反正就是依大的来。

字符串不仅可以跟字符串拼接，也可以跟基本数据类型拼接
Get raw SQL from Laravel Query Builder
Tags: laravel, webdev
Published: 2023-02-08 15:30:48

{% embed https://github.com/PyaeSoneAungRgn/to-raw-sql %}

You can get raw SQL from Laravel Query Builder using [PyaeSoneAungRgn/to-raw-sql](https://github.com/PyaeSoneAungRgn/to-raw-sql)
Keep Vite 4.0.4 server alive always
Published: 2023-02-08 15:28:24

I'm trying to do development in react-admin with vite. I've done something and deployed to the ubuntu server for testing purpose. In the root folder of react-admin project under ubuntu, I'm triggering the Vite server with "yarn dev". Everything is running smoothly without any issue, the only annoying part is the project url was unreachable after 2 hours. I will need to trigger the Vite server with "yarn dev" again. Anyone have any idea to keep the Vite server keep alive without disconnect?