teleren/devto huggingface dataset:
TypeScript SETUP by SilvenLEAF
Tags: javascript, typescript, node, silvenleaf
Published: 2021-10-14 01:56:29

Ahoy there! Let's set up the environment for playing with TypeScript and learn how to run those TypeScript files! 

# Step 0: Install TypeScript
First let's install TypeScript globally if you don't have it yet.
```bash
npm i -g typescript
```
(By the way, **"npm i X"** is the short-hand for **"npm install X"**)

Now, let's create your project folder and open it in your beloved editor (mine VS Code)

## Step 1: init tsconfig
Let's init the tsconfig file, type the following command
```bash
tsc --init
```
(This **"tsc"** command will only work if you have typescript globally installed)

It'll create a **"tsconfig.json"** file. Now, what does it do you ask? TypeScript is the superset of JavaScript and how we want to compile it will be defined by this tsconfig file. The best part is, it'll give you **linting** (the red lines whenever there is an error in your code or logic) and also explicitly tell you what mistakes you are doing and in some cases possible solutions as well. Amazing right?

## Step 2: run TypeScript files
Now you created a TypeScript file, wrote your code, for example an **app.ts** file with this content
```bash
console.log('Hello there TypeScript! You are AMAIZING!!')
```
Now how to run this file? If it were a JavaScript file, like app.js, you might run **"node app.js"** or **"nodemon app.js"**, right? So let's find the TypeScript versions for those!

Let's install the packages
```bash
npm i ts-node ts-node-dev
```
**"ts-node"** is the TypeScript version for **"node"** and **"ts-node-dev"** is the TypeScript version for **"nodemon"**. So to run the TypeScript file use either of these commands
```bash
ts-node app.ts
```
(Which is basically **"node app.js"**)
```bash
ts-node-dev app.ts
```
(Which is basically **"nodemon app.js"**)


YIPPIE!! You just set up the environment for coding in TypeScript and also learnt how to run those FILES!! YOOOHOOOO!!! But now what?


# What's NEXT?
#### 1. Improved AI BOT that can do anything
#### 2. Insane stuff with JavaScript/TypeScript
#### 3. Debugging TypeScript with VS Code Debugger
#### 4. How to automate anything
#### 5. Sequelize Hooks
#### 6. Automate creating DB Schemas
#### 7. How to create an Android APP with NO XP
(including apk generating)


# Got any doubt? 
Drop a comment or Feel free to reach out to me @SilveLEAF on Twitter or [Linkedin](https://www.linkedin.com/in/silvenleaf/)

Wanna know more about me? Come here! 
[SilvenLEAF.github.io](https://SilvenLEAF.github.io)
Laravel shorts - Old inputs are still inputs
Tags: laravel, php, webdev, shorts
Published: 2021-10-14 01:44:15

If you need some inspiration for designing a 500 error page, all you need to do is to find a stylish site that is built on Laravel and navigate to its login page. Then you open up the developer tools and change the name attribute of the email input field from `email` to `email[]`. Enter some random credentials and submit.

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

<small>Disclaimer: Doesn't work on all Laravel sites and the example isn't all that pretty. If you actually did manage to log into someone's account, don't do anything silly.</small>

## What happened?

Laravel has a feature where it lets you carry over inputs from an old request to a new request.

As the documentation states:
>This feature is particularly useful for re-populating forms after detecting validation errors.

https://laravel.com/docs/8.x/requests#old-input

Here's a quick example:

```php
<form method="POST">
    <h1>Login</h1>
    @csrf
    <input name="email" type="email" value="{{ old('email') }}"><br>
    <input name="password" type="password"><br>
    <input type="submit">
</form>
```
Now, Laravel also has another useful feature that let's you send array inputs via form fields.

```php
<input name="email[]" type="text" value="foo@bar.com">
```
```php
class FooController {
    public function handleForm(Request $request) {
        // array:1 [▼
        //   0 => "foo@bar.com"
        // ]
        dd($request->email);
    }
}
```
Combine the two and somewhere down the pipe you end up with something like `htmlspecialchars(['trololo' => 'lololo'])` which throws an exception because `htmlspecialchars` does not take arrays.

## Takeaways

Is this a real problem? Probably not, at least not in this example. But I wanted to showcase that old inputs are still inputs and should be treated with zero trust until they are validated. Maybe somewhere in your project you have a bit more complex logic that deals with old inputs. It would not hurt to check that what you think is there is actually there. 

The post [Laravel shorts – Old inputs are still inputs](https://hbgl.dev/laravel-shorts-old-inputs-are-still-inputs/) appeared first on [hbgl](https://hbgl.dev).
Ecosia, el Google más social
Tags: spanish, searchengine, google, ecosia
Published: 2021-10-14 01:33:40

Entre las herramientas indispensables de internet destaca por encima de las demás el buscador. Y a pesar de contar con numerosos y variados servicios de búsqueda, todos asociamos este concepto con el gigante estadounidense Google. Y es que estamos tan acostumbrados a su buscador, que pocas veces os paramos a pensar en sus alternativas.
Hoy vengo a hablaros de un proyecto que, si bien no puede competir con los algoritmos de posicionamiento de Google (en realidad, nadie puede), ofrece una solución interesante para quien necesite un buscador eficiente y se preocupe por el medio ambiente. Y es que Ecosia, negocio social fundado en 2009, promete combatir la deforestación simplemente usando su motor de búsqueda.
## ¿Qué tiene que ver la deforestación con buscar por internet?
De todos es sabido que la publicidad en internet genera mucho, muchísimo dinero a las empresas propietarias de los servicios. Por eso la mayoría de aplicaciones web se ofrecen sin coste alguno para los usuarios.
Empresas como Google o Microsoft (Bing), propietarias de los motores de búsqueda más utilizados, basan en la publicidad su principal fuente de ingresos. En este punto, Ecosia promete (y acredita) destinar sus ingresos para “plantar árboles” en lugares del planeta afectados severamente por la deforestación.
## Vale pero, ¿podemos vivir sin Google?
La respuesta es no. Prueba de ello es la alta posibilidad de que estés leyendo este artículo desde un dispositivo Android (Google) o lo vayas a compartir con tus contactos desde tu cuenta de Gmail (de nuevo, Google). Pero si nos ceñimos estrictamente a la barra de búsqueda del navegador, sí podemos apartarnos un poquito de Google.
## ¿Cómo es usar Ecosia en el día a día?
He contactado con una usuaria habitual de Ecosia, que lleva utilizando ese buscador desde hace varios años. Lo primero que me ha destacado es la evolución favorable que Ecosia ha sufrido en este tiempo. Aunque reconoce echar de menos el motor de Google, principalmente en la búsqueda de imágenes, asegura estar contenta con el buscador verde y estar aportando su granito de arena en la labor social de Ecosia.
Yo por mi parte, he estado probando su motor de búsqueda. El resultado me ha sorprendido positivamente, aunque se me hace algo tedioso no disponer de las herramientas avanzadas de la búsqueda de Google. Tal vez Ecosia no sea la mejor opción para quien como yo realiza cientos de búsquedas avanzadas diariamente.
## Conclusiones
Ecosia es ya una alternativa potente a Google para el usuario promedio. Y lo que más destacaría es que pone a disposición de cualquiera colaborar en la lucha por el medio ambiente.
Será interesante ver cómo sigue evolucionando el proyecto. Más aún ahora que la Unión Europea quiere que sean los usuarios quien elijan su motor de búsqueda preferido en lugar de venir de fábrica.

_Muchas gracias a Carla por compartir su experiencia conmigo para poder redactar este artículo._
Contribute and unlock your domain
Tags: unlockyourdomain, hacktoberfest, opensource, javascript
Published: 2021-10-14 00:40:04

##**Unlock your first PR**

Being productive while following the best software development practices has been one of the greatest challenges for developers. Today I can say that with [HerbsJS](https://herbsjs.org) this challenge becomes much easier.

Using and contributing to the project, in addition to participating in a vibrant community, I've been putting into practice building software that delivers value and focuses on what really matters: the domain.

The pillars of HerbsJS are Domain First, creating microservices in Node.js with DDD, Clean Architecture, Authorization and auditing available even for simple applications.

I invite you to break this barrier. Take advantage of Hacktoberfest, visit the HerbsJS website, and contribute to a project that in essence elevates the developer level and enables you to build quality software.

##**Links**

- HerbsJS have a CLI to help [Getting Started](https://herbsjs.org/docs/tutorial/new-project#with-herbs-cli)

- Let's talk on the [HerbsJS discord](https://discord.com/invite/e3cQ66KDv5)

- We are looking forward to your PRs. Let's code: [HerbsJS Github](https://github.com/herbsjs)
#100DaysOfSwift: Project 11 
Tags: ios, beginners, swift
Published: 2021-10-14 00:32:45

Hello, 

I've decided that I wanted to recap what I've learned from the projects that I am doing with #100DaysOfSwift as a way to help me remember. I will start with Project 11 which was a game we created in SpriteKit called Pachinko.

Project 11 Recap:

A SKScene is the parent of a node and nodes are organized in a  tree-like structure to the parent. A frame is a rectangle that contains the contents of the node. Anything in the didMove() method displays on the screen as soon as it loads. The body of this method holds the code for the background image, the edit labels, the slots, the score, and the bouncers.

The touchesBegan ()method detects whenever the user touches the screen. The body of this method holds the feature of the user being able to toggle between "Edit" and "Done". In the editing mode the user can add blocks of different lengths to create obstacles when they try to drop a ball into the slots. This method also holds the code for creating a ball when the screen is touched and allowing the ball to fall. 

Key Takeaways:
1. Anchor points determine what coordinates are used to position children. The bottom left corner of the screen is the considered Y:0. 

2.  SKSpriteNode is used to to grab images from Assets.xcassets. 

3. Set<UITouch> means a set that stores an object representing the location, size, movement, and force of touch occurring on the screen. I.e the user touches the screen and the ball appears and its at a certain location, a certain size, etc.

4. physicsbody = SKPhysicsBody(edgeLoopFrom: frame) creates an impassible boundary around the frame. 

5. collisionBitMask determines what object a node bounces off and contactTestBitMask determines which collisions are reported.
Why single-threaded non blocking javascript out performs better than MultiThreaded systems?
Tags: javascript, node, java
Published: 2021-10-14 00:05:59

Any starter node.js enthusiastic would at least one time ponder, how can a single thread system out perform better than a MultiThreaded system.

And specially many people from multithreaded pardigm, who are evaluating/understading node.js,  would rather find it hard to understand : why Node.js(or any single threaded non blocking JS system) is acclaimed better than multi-threaded system (At least for serving web-traffic!)?

**Node.JS is not faster (doesnot means its slower either), but rather highly efficient in handling a single thread, as compared to a blocking multi-threaded system handling its single thread!**

I have made diagrams to explain this statement with analogies.

![multi threaded system work flow](https://i.stack.imgur.com/yLA5K.png)

![single thread non blocking system](https://i.stack.imgur.com/EtiYI.png)

A multi-threaded blocking system is not capable of utilizing its threads power to its full potential, as a thread is blocked until it evaluates each line of code.

Now offcourse one can build a non blockig system on top of a blocking multi-threaded system (thats what Node.js is under the hood), but its very complex. And you have to do it ever where you need non blocking code in your application or program.

Javascript ecosystem (like nodejs) provide this out of the box as its syntax. The JS language sytanx provide all this feature where ever needed. Morever as its part of its syntax, the reader of the code immeditetly knows that where code is blocking and where its non-blocking.

The blocking part of multithreaded-blocking system makes it less efficient. The thread which is blocked cannot be used for anything else, while its waiting for response.

While a non-blocking single threaded system makes best use of its single thread system.

And hence node.js if used properly can out perform many multi-threaded systems.
Can we scale agile?
Tags: agile, scaledagile, agilemanifesto, softwaredevelopment
Published: 2021-10-19 11:59:45

---
title: Can we scale agile?
published: true
date: 2021-10-14 00:00:00 UTC
tags: agile,scaledagile,agilemanifesto,softwaredevelopment
canonical_url: https://jhall.io/archive/2021/10/14/can-we-scale-agile/
---

Scaling agile is a big topic. There are several ready-made frameworks that ostensably address this: [SAFe](https://www.scaledagileframework.com/), [LeSS]([https://less.works/](https://less.works/)) and [Nexus](https://www.scrum.org/resources/nexus-guide) are probably the most popular.

But I’m going to skip past these frameworks today and focus on the [Manifesto for Agile Software Development](https://agilemanifesto.org/) with one question in mind: Does it make sense to scale these practices outlined in the manifesto? Can they even _be_ scaled to hundreds or thousands of people?

**Spoiler alert!** I don’t believe so.

But let me explain why, by pointing out the elements of the agile manifesto which cannot be scaled to large groups:

> Individuals and interactions over processes and tools

Individuals and interactions… this requires operating at a scale where individuals and interactions are visible. That’s a bit fuzzy, but it probably at least means working in groups of people below [Dunbar’s number](https://en.wikipedia.org/wiki/Dunbar%27s_number). It likely means working in groups of 12 or fewer.

> Customer collaboration over contract negotiation

Can hundreds or thousands of engineers collaborate with customers? I don’t really think so. Collaboration needs to happen between individuals, or small groups.

Let me now look at some of the [principles](https://agilemanifesto.org/principles.html) behind the agile manifesto:

> The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.

Good luck having a face-to-face conversation with hundreds or thousands of people. This principle alone puts an upper bound on how large a group can be and still be “agile” according to the manifesto.

> The best architectures, requirements, and designs emerge from self-organizing teams.

1,000 engineers cannot be self-organizing. At best, they’ll self-select a leader (i.e elect a union president) who does the organization for them.

> At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

Here it is, in black-and-white: The unit of agile software development is “the team”. If you have two teams, you have “two agiles” (yes, I know that’s a grammatical stretch…).

So in my view, the Agile manifesto makes it pretty clear, although not entirely explicit, that agile software development happens at the team level. As such, it _cannot_ be scaled beyond the boundaries of a single team.

Obviously, it’s possible to have more than one agile team in a company, though. I’ll talk about that in the coming days, so be sure to [subscribe](https://jhall.io/daily) so you don’t miss it.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Asp.net core Routing Route Handler Giriş.
Tags: dotnet, csharp
Published: 2021-10-13 23:55:20

Diyelim ki controller'lara düşmeyen bir istek yapmanız gerekiyor mesela mustafa'ya bir şeyler söyleteceksiniz ama bunun için controller da metot koymak gereksiz diye düşünüyorsunuz.

Örneğin: 

```
https://localhost:5001/mustafa?saysomething=BenimAdimMustafa
```

dediğimizde sayfada : 

```
BenimAdimMustafa
```

yazmasını istiyoruz ama bu isteğin controller'dan geçmesini de istemiyoruz. O zaman ne yaparız ?


1.) Model-view-controller projesi oluşturun.

2.) SaySomething adında bir class oluşturalım : 

```
public class SaySomething
    {
        public RequestDelegate Handler()
        {
            return async c => await Task.Run(async () =>
            {
                string message = c.Request.Query["saysomething"].ToString();
                await c.Response.WriteAsync(message);
            });
        }
    }
```

3.) endpoint'lerimizi aşağıdaki gibi değiştirelim : 
```
app.UseEndpoints(endpoints =>
            {
                endpoints.Map("mustafa", new SaySomething().Handler());
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
```

Şimdi uygulamayı çalıştıralam ve aşağıdaki linke istek atalım : 

https://localhost:5001/mustafa?saysomething=BenimAdimMustafa

Gördüğünüz üzere : 

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

Sonuç : 

* Eğer controllerdan geçmesini istemediğiniz bir istek yapmak istersek custom Route Handler oluşturabiliriz.

* endpoints.Map belirli bir path için belirli bir metot çalıştırmamıza yarayabilir. Ve endpoints.Map metodu ikinci paramere olarak RequestDelagete döndüren bir metot alır.

Bir dahaki yazımda görüşmek dileğiyle.

En iyi dileklerim ile.

Mustafa Samed Yeyin.
Ddosify | High-performance load testing tool, written in Golang (opensource) ⚡
Tags: testing, go, devops, performance
Published: 2021-10-13 21:58:49

Hi All,
I want to introduce a brand-new open source load testing tool Ddosify. We aimed to create a multi-protocol, easy-to-use, high-performance performance testing tool. 🚀

{% github ddosify/ddosify %}

[https://github.com/ddosify/ddosify](https://github.com/ddosify/ddosify)

- It is currently supporting HTTP(S), HTTP/2. We are going to add as many protocols as possible. So, if you need to perform a load test for a specific protocol, please contact me.

- Test plan creation can be achieved with a configuration(JSON) file. You don’t need to write any line of code.

As I said, our primary focus is creating a load test tool that can do anything related to load testing with the easiest usage. If you think current tools do not meet your requirements, please contact me so we can improve Ddosify based on your needs. ⚡

Feedback is always welcome. Have a lovely day.
What is your favorite database?
Tags: watercooler, database, webdev
Published: 2021-10-13 22:44:13

I am looking for a database for a new project that I am working on. I usually use MongoDB since I can get it working quickly, but I am intrigued with the new providers I am seeing such as Faunadb or Supabase. 

I am curious what your favorite database to work with is? What are the pros and cons? What makes you stick with that database instead of going to another one? How easy is it to update models or schemas as project requirements change? 

I look forward to your comments!
Building a dropdown menu using Alpine.js
Tags: javascript, alpinejs, tutorial
Published: 2021-10-13 22:23:35

[AlpineJS](https://alpinejs.dev/) is a small JavaScript framework for composing behavior directly in HTML markup. In this tutorial I’ll show you how the framework can be used to build a dropdown menu component. If you’ve never worked with Alpine before this will serve as a simple introduction to the framework.

For the purposes of this tutorial you can load the framework via CDN:

```html
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
```

With Alpine loaded create a wrapper `<div>` with the following attributes:

```html
<div x-data="{ open: false }" x-on:click.outside="open = false">
  // ...
</div>
```

`x-data` defines a chunk of HTML as an Alpine component and provides data for that component to reference. `x-on:click.outside` set’s the open data to false which will hide the dropdown when anywhere outside the component is clicked.

Next inside the wrapper `<div>` add a button that’ll trigger the dropdown’s visibility:

```html
<button x-on:click="open = !open">
  My Account
</button>
```

Another `x-on:click` this time we’re only tracking clicks directly on the button itself.

Now for the dropdown menu which is an unordered list with a `x-show` attribute:

```html
<ul x-show="open">
  <li><a href="#">Edit Profile</a></li>
  <li><a href="#">Settings</a></li>
  <li><a href="#">Log Out</a></li>        
</ul>
```

When `open` equals `true` the `x-show` attribute will change the visibility of the `<ul>` element. At this point in the tutorial we have a basic functioning dropdown, let’s add a couple of finishing touches to improve the look and feel. First let’s add an icon that’ll represent the state of the dropdown menu:

```html
<button x-on:click="open = !open">
  My Account 
  <span :class="{'rotated': open}">&raquo;</span>
</button>
```

If you view the source code after the button has been clicked you’ll see the rotated class has been applied to the `<span>` element:

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

We can now apply some CSS to rotate the icon indicating the menu is open:

```css
.rotated {
  transform: rotate(90deg);
  display: inline-block;
}
```

Finally we’ll add a transition so the opening and closing of the dropdown appears smoother:

```html
<ul x-show="open" x-transition.opacity>
 ...       
</ul>
```

That’s all for this tutorial. As you’ve just seen by adding some simple Alpine attributes to HTML markup it relatively easy to create a functioning dropdown menu. With what you learnt in this tutorial you could also start building other UI elements with show/hide functionality and Alpine.js.