teleren/devto huggingface dataset:
Define Controllers In Asp.Net Core
Tags: dotnet, aspnetcore
Published: 2020-05-04 20:49:07

There are 4 types of way define controllers in Asp.Net Core: 

1- Inherit from ControllerBase class

```csharp
public class UserController : ControllerBase
{}
```

2- Define a controller with a Name that Contains "Controller" suffix.
```csharp
 public class UserController 
  {}
```
You can define Controller without inherit ControllerBase class. However you have to define specific name class that includes 'Controller' suffix.

3- Define With Controller Attribute
  ```csharp
    [Controller]
    public class User
    {}
```
4- Define Custom Controller Type Class
You can define custom controller like the second step. 
For using this way, you have to add service configuration in StartUp.cs. 
```csharp 
services.AddMvc()
            .ConfigureApplicationPartManager(pm=> 
            {
                pm.FeatureProviders.Add(new ControllerEndpointFeatureProvider());                
            });
```
Then you create ControllerEndpointFeatureProvider class:
```csharp
 public class ControllerEndpointFeatureProvider : ControllerFeatureProvider
    {
// Override IsController method and configure custom 
        protected override bool IsController(TypeInfo typeInfo)
        {
            var isController = base.IsController(typeInfo);
            return isController || 
typeInfo.Name.EndsWith("EndPoint", StringComparison.OrdinalIgnoreCase);
        }
    } 
```
ControllerFeatureProvider has two important methods. One of these is *IsController*. You can override that method to create specific controller type. For example, We introduce controllers type with the end of "EndPoint".
Each class is checked whether it's a controller or not when building project. Thus, you can define the controller class with a name that contains "EndPoint" suffix.
```csharp
public UserEndPoint()
{}
```
Bonus: 
You can suspend controller features with NonController attribute from a controller class . So you cannot reach to this controller with Http Requests
```csharp
    [NonController]
    [Route("api/[controller]")]
    public class User: ControllerBase
    {
        [HttpGet]
        public string Get()
        {
            return "beta";
        }
    }
```

For example, you cannot get information from this controller until you don't remove NonController attribute.  

Please feel free to write comment. Have Fun :)

https://www.strathweb.com/2014/06/poco-controllers-asp-net-vnext/
Build beautiful React Components from NPM Packages in minutes
Tags: react, npm, javascript
Published: 2020-05-04 20:46:46

Learning JavaScript and React within a few weeks of each other was challenging, but I was able to accelerate the speed of my project builds when I discovered free npm packages. The company behind Node package manager has an entire website dedicated to open source components that are easily integrated with React. 

When you find a package to use, simply "npm install" it then include the import at the top of your component file to begin.

Here are 5 packages that helped me build my project with ease:

1)  Moment - "react-moment"

Moment made gave me a simple way to parse dates from an API into the format that I wanted to display to the user. There are multiple options for props and filters depending on your needs.

API JSON date: "2020–08–10" 
User view: Aug 10, 2020
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gkxhkmyacowg30hzxs0g.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7t24iio0yv95x4is2nn6.png)

2)  Loader - "react-loader-spinner"

Loader gave my user something simple but interesting to look at for a few seconds while they waited for the API fetch to complete. You can customize the look and duration of the loader component to fit your style.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qr97u17sa4tak89n9p0x.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hktllnzalljnj6je6ob7.png)

3)  ReactCalendar - "react-calendar"

The calendar was a nice addition as a clean and styled way to present dates to my user with the capability of incorporating date selection. There are many available props to create an interactive calendar.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5mlawxnbyqqhjst8w0kh.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/id2o8hte2jkjxtsutw3g.png)

4)  Map, GoogleApiWrapper, Marker - "google-maps-react"

This one requires an extra step because you'll need to create an account for a Google API key, but it only took a few minutes. Once you're in you can begin customizing the the the size and zoom of the map along with any markers for specific places.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2cgzen9nzy0b2g43gc3t.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mcko0fgbqk46au9jagl3.png)

5)  YouTube - "@u-wave/react-youtube"

Pretty straight forward. If you're looking for a simple way to embed YouTube videos this is a great way to start. It offers lots of display options and player controls.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1ymro8u6lw9oj95w34zb.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mcko0fgbqk46au9jagl3.png)

For more npm packages, visit npmjs.com.
TIL about zshell startup
Tags: zshell, microlearning, commandline, todayilearned
Published: 2020-05-04 20:40:23

---
title: TIL about zshell startup
published: true
description: While starting to rebuild Git, I learned about the order of startup configuration for zshell 
tags: zshell, microlearning, command_line, TIL
series: Learning while Doing
cover_image:
---

_This is a walk-with-me-while-I-do-things series, I'm going to tell you what I learned while I'm learning_

You might remember about [my ordeal](https://dev.to/nirnaeth/yak-shaving-my-way-to-hacktoberfest-day-2-2b5m) with _bash_ and _Catalina_ and _zshell_ and _iTerm_. I bit the bullet and switched to _zshell_. 

I have an alias for starting the _postgres_ server that on _bash_ resides on `.bashrc` (by the way, did you know that `rc` stands for `run commands`?). With _zshell_, you can use `.zshrc` for the same purpose. 

_zshell_ at startup reads these files for the user in the following order:
1. **`.zshenv`** - 
always read when launching the shell, no matter from where. you want the important stuff here.
2. **`.zshprofile`** - 
read at login. don't use, use `.zshlogin` instead. the purpose is the same.
3. **`.zshrc`** - 
read when interactive. this is where you should put aliases, key bindings, coloring, etc.
4. **`.zshlogin`** - 
read at login, use it for things needed once the shell is set up, to execute external commands.
5. **`.zshlogout`** - 
read when the login shell exits, it should be used to release resources acquired during login.

Before each of these, _zshell_ runs the matching files that can be found in `/etc/` for **all** users on the machine.

More info [here](http://zsh.sourceforge.net/Intro/intro_3.html) (official documentation), [here](https://unix.stackexchange.com/a/487889) on StackOverflow, and [here](https://scriptingosx.com/2019/06/moving-to-zsh-part-2-configuration-files/) (switching to zshell because of Catalina).
Cheat Sheet for Updating Objects and Arrays in React State
Tags: react, javascript, beginners, tutorial
Published: 2020-05-04 20:35:52

If we want to use arrays or objects in our React state, we have to create a copy of the value before modifying it. This is a cheat sheet on how to do add, remove, and update items in an array or object within the context of managing React state.

## Arrays

```js
const [todos, setTodos] = useState([]);
```

### Add to array

```js
const handleAdd = (todo) => {
  const newTodos = todos.slice();
  newTodos.push(todo);
  setTodos(newTodos);
}
```

The spread operator is syntactic sugar for creating a new copy of a reference.

```js
const handleAdd = (todo) => {
  const newTodos = [...todos];
  newTodos.push(todo);
  setTodos(newTodos);
}
```

We can also use the spread operator to create copy and append an item with the following syntax:

```js
const handleAdd = (todo) => {
  setTodos([...todos, todo]);
}
```

### Remove from array

```js
const handleRemove = (todo) => {
  const newTodos = todos.filter((t) => t !== todo);
  setTodos(newTodos);
}
```

### Update array

```js
const handleUpdate = (index, todo) => {
  const newTodos = [...todos];
  newTodos[index] = todo;
  setTodos(newTodos);
}
```

## Objects

```js
const [todos, setTodos] = useState({});
```

### Add to object

```js
const handleAdd = (todo) => {
  const newTodos = Object.assign({}, todos);
  newTodos[todo.id] = todo;
  setTodos(newTodos);
}
```

We can use spread operator to create shallow copy as well.

```js
const handleAdd = (todo) => {
  const newTodos = {...todos};
  newTodos[todo.id] = todo;
  setTodos(newTodos);
}
```

Similar to arrays, there's a shortcut for doing this in one line:

```js
const handleAdd = (todo) => {
  setTodos({...todos, [todo.id]: todo});
}
```

### Remove from object

```js
const handleRemove = (todo) => {
  const newTodos = {...todos}
  delete newTodos[todo.id]
  setTodos(newTodos);
}
```

### Update object

Same as adding, it will overwrite the value if the key already exists.

```js
const handleUpdate = (todo) => {
  setTodos({...todos, [todo.id]: todo});
}
```
Does Web Development has Scope?
Tags: webdev, developers, technology, programmers
Published: 2020-05-04 18:54:06

Hello Buddy!
You been on this page simply means that you are quite worried on the above question and deliberately need them to be answered. Hope this post of mine helps to get you to make the decision.
Few weeks before this pandemic I attended a ML (Machine Learning) Introductory Workshop. In this workshop the speaker informed us that their exist a technological curve for every technology and once the Technology has reached it peak point the curve starts falling and hence can be conclude as the downfall of that technology.

The speaker told us that Web Development will have a down fall since many websites itself are building basic business websites for their clients free of cost. **But here’s a catch that’s the not the whole reality .Its true that websites build secondary basic purpose websites for their clients but when it comes for web application development ,it needs web Developers**. Web Development not just creating a UI based Websites. So, I Think “ Web Development has a good scope in future and call for web Developers will be always there in market”.

Thank you for heedful reading.
What would be your training needs?
Tags: discuss
Published: 2020-05-04 20:27:04

So, I've been running in company trainings for years, and recently decided that open subscription trainings and online trainings may be at least as useful and maybe also more fun to do. I started by offering [my Domain Driven Design training online](https://www.delphino-consultancy.nl/ddd_training_online.html).

That's an easy one, because I have all the material of 7+ years of running it. However, I am curious to see what your training needs would be - given that dev.to covers a lot more topics on technology (libraries, frameworks, languages) than on design approaches and the process side of software development. So, feel free to comment and let me know - you may spark a new training that I can offer, to help some of you forward.

Other ideas are also welcome, I've been considering the option of short pre-recorded mini-courses and online Q&A sessions as well. 

Fire away, I'm listening!
Enterprise Data Operations And Orchestration At Infoworks - Episode 131
Published: 2020-05-04 20:25:16

<p>Data management is hard at any scale, but working in the context of an enterprise organization adds even greater complexity. Infoworks is a platform built to provide a unified set of tooling for managing the full lifecycle of data in large businesses. By reducing the barrier to entry with a graphical interface for defining data transformations and analysis, it makes it easier to bring the domain experts into the process. In this interview co-founder and CTO of Infoworks Amar Arikere explains the unique challenges faced by enterprise organizations, how the platform is architected to provide the needed flexibility and scale, and how a unified platform for data improves the outcomes of the organizations using it.</p><p><a href='https://www.dataengineeringpodcast.com/infoworks-data-operations-episode-131/'>Listen Now!</a></p>
Maintainable Infrastructure As Code In Pure Python With Pulumi
Published: 2020-05-04 20:24:36

<p>After you write your application, you need a way to make it available to your users. These days, that usually means deploying it to a cloud provider, whether that's a virtual server, a serverless platform, or a Kubernetes cluster. To manage the increasingly dynamic and flexible options for running software in production, we have turned to building infrastructure as code. Pulumi is an open source framework that lets you use your favorite language to build scalable and maintainable systems out of cloud infrastructure. In this episode Luke Hoban, CTO of Pulumi, explains how it differs from other frameworks for interacting with infrastructure platforms, the benefits of using a full programming language for treating infrastructure as code, and how you can get started with it today. If you are getting frustrated with switching contexts when working between the application you are building and the systems that it runs on, then listen now and then give Pulumi a try.</p><p><a href='https://www.pythonpodcast.com/pulumi-infrastructure-as-code-episode-261/'>Listen Now!</a></p>
Weekly Links – 5/4
Tags: links, build, coding, development
Published: 2020-05-05 14:00:03

---
title: Weekly Links – 5/4
published: true
date: 2020-05-04 20:05:44 UTC
tags: Links,Build,coding,development
canonical_url: 
---

So Happy May 4th, and May the 4th be with you! This is the well documented nerd blog, there would be something wrong if I didn’t make a star wars reference today.

![See the source image](https://sowingtheseed.files.wordpress.com/2016/01/star-wars-meme-1.jpg)

Down to business…

- [Microsoft Build 2020 registration is not only open, it’s FREE, it’s LIVE, it’s VIRTUAL, and it is all FOR YOU](https://www.hanselman.com/blog/MicrosoftBuild2020RegistrationIsNotOnlyOpenItsFREEItsLIVEItsVIRTUALAndItIsAllFORYOU.aspx) : Seriously, build is free. What more do you want?
- [Introducing Visual Studio Codespaces: cloud-hosted development for wherever you’re working](https://devblogs.microsoft.com/visualstudio/introducing-visual-studio-codespaces/) : Really excited to see options like this t hat the future is to do away with a developers machines, and move everything to cloud based.
- [Manage and find data with Blob Index for Azure Storage—now in preview](https://azure.microsoft.com/en-us/blog/manage-and-find-data-with-blob-index-for-azure-storage-now-in-preview/) : Love to see this to help with finding blobs and performance. Exciting opportunity.  
- [DevSecOps for Government](https://devblogs.microsoft.com/azuregov/devsecops-puts-security-at-the-heart-of-program-development/) : As I mentioned before, I love to see innovations for Azure Governments.  
- [CMMC with Microsoft Azure : Audit & Accountability Management](https://devblogs.microsoft.com/azuregov/cmmc-with-microsoft-azure-audit-accountability-management-2-of-10/) : Pretty awesome to see the new guidance around CMMC which will be important to anyone working with the Federal Government.  

### Fun Stuff:

Being May 4th, let’s keep star wars going, very excited to see Rise of Skywalker land on Disney Plus. I didn’t get to see this in theatres but will be watching it tonight, very excited.

<iframe type="text/html" width="640" height="360" src="https://www.youtube.com/embed/8Qn_spdM5Zg?version=3&amp;rel=1&amp;fs=1&amp;autohide=2&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent" allowfullscreen="true" style="border:0;"></iframe>
How to Upload an Object into S3-Compatible Tardigrade Bucket
Tags: cloudstorage, tutorial, opensource, s3compatible
Published: 2020-05-04 20:05:13

---
title: How to Upload an Object into S3-Compatible Tardigrade Bucket
published: true
description: a 5-minute overview of uploading your first object into a decentralized opensource cloud storage bucket
tags: cloud storage, tutorial, opensource, s3 compatible
---

In this tutorial, I demonstrate how to upload and download an object on Tardigrade. In putting together this video I was really pleasantly surprised at how fast the path really is. I had grander plans of a series with each step in a playlist. But what actually happened is that in < 5 minutes timestamp, I already had steps demonstating account creation, making a bucket, uploading and downloading. Kind of cool. It will take a few minutes longer in real life, but still pretty fast.
 
 {% youtube hjaza32elJM %}

For anyone unfamiliar with the platform, it is the enterprise level offering from Storj Labs. Its an S3-compatible, open source, decentralized cloud storage platform. We just offer the storage layer. That means that we're not (for example) Dropbox but a developer COULD build a Dropbox-style solution on top us. Or many other applications too.

For anyone interested in learning more, please join the forum -- linked below. I manage the Community Team, and we love helping and talking with developers

Binaries for Uplink CLI: https://github.com/storj/storj/releas...
Community forum: https://forum.storj.io
Podcast / End-to-End Encryption with JT Olio of Storj Labs
Tags: opensource, decentralized, cloudstorage, encryption
Published: 2020-05-04 19:58:03

---
title: Podcast / End-to-End Encryption with JT Olio of Storj Labs
published: true
description: a discussion between Jocelyn Matthews and JT Olio, talking about how encryption is implemented in the Storj Labs' Tardigrade platform
tags: opensource, decentralized, cloud storage, encryption
---
In this episode I talk with my colleague JT Olio about how the Tardigrade storage platform implements end-to-end encryption. Its full of all the best kinds of nerdery: erasure encoding, shards, segments, and mockery of circa-1998 Javascript guestbook technology
{% youtube Lw7PVM3XjC0 %}

Our conversation  is timely because of recent shifts to larger numbers of people working from home.

The public consciousness around data security is therefore high, as many people are looking to find what they need to know about encryption, how it applies to them personally, and what are some best practices to be aware of as developers. 

Just a little context to ground the conversation: JT is the Vice President of Engineering here at Storj Labs, and has overseen the team working on Tardigrade to its current state. From its prior iterations written in nodeJS to a complete refactoring and makeover in Go. 

JT's had a long career in this space, and his previous work at Space Monkey and Mozy (one of the original cloud-based backup companies) has gaven him deep experience working with distributed hash tables, cryptography, Reed-Solomon erasure codes, NAT traversal, fairness mechanics, game theory. Along with security, FUSE, embedded Linux, deployment and packaging, user and inventory management. 

Because of this particular path, JT has fostered a team ethos that is very much slanted toward encryption and security by default.
IntelliJ IDEA, Rider IDE Kısayollarına Hakim Olmanın Kısayolunun Kısa Anlatımı
Tags: shortcuts, productivity, programming, intellijidea
Published: 2020-05-04 20:17:29

---
title: IntelliJ IDEA, Rider IDE Kısayollarına Hakim Olmanın Kısayolunun Kısa Anlatımı
published: true
date: 2020-05-04 19:51:49 UTC
tags: shortcuts,productivity,programming,intellij-idea
canonical_url: https://medium.com/@brehpoint/intellij-idea-rider-ide-k%C4%B1sayollar%C4%B1na-hakim-olman%C4%B1n-k%C4%B1sayolunun-k%C4%B1sa-anlat%C4%B1m%C4%B1-4be6c3198489
---

Başlık her şeyi tanımladığı için çok uzatmadan direkt konuya gireceğim. Her zaman yazılımcılar için önerilen bir davranış biçimi olan kısayol kullanımını arttırmanın tartışılmaz şekilde verimlilik yarattığını biliyoruz. Peki gün içerisinde kullandığınız IDE’lerin kısayollarını nasıl öğreniyorsunuz?

Genellersek iki farklı tipte yaklaşıma ulaşabiliriz.  
1. Kendi alıştığı temel kısa yolları aktif olarak kullandığı IDE’ye uyarlamak.  
2. IDE’nin mevcut varsayılan olarak ayarlanmış kısa yollarını kullanmak.

Burada ikinci yöntemi seçen ve **IntelliJ IDEA, Rider** kullanıcısı olanlar için bir önerim olacak.

#### Key Promoter X

[Key Promoter X - Plugins | JetBrains](https://plugins.jetbrains.com/plugin/9792-key-promoter-x)

![](https://cdn-images-1.medium.com/max/1024/1*vy7D3Ygo5cJdWJOv4IJPRw.png)

#### Ne Yapar ve Ne İşe Yarar?

UI üzerinde çalışır iken kullandığınız menülerin ve işlemlerin kısa yollarını size gösterir. Bu işlemi kısayol olmadan kaç defa yaptığınızın kaydını tutar. (hangi kısa yollar sizin için daha önemli)

> Ben bu sayede kullandığım kısa yolların ne kadar sığ olduğunu ve gün içerisinde daha fazla kullanabileceğim kısa yolların olduğunu keşfettim.

**Ben Kendi Kısayollarımı Kullanırım Diyenlere Bir Öneri**

Bir düzen kurmaya çalışıyorsunuz ve kendi kısayollarınızı atıyorsunuz. Bu uğraş verdiğiniz kısayolları dışarı aktararak masanızda bulundurabilirsiniz.

Eskiden (belki hala) kısa yolların cheat-sheet lerine ulaşıp çıktısını alarak masamda bulundururdum.

Eğer siz de bu şekilde ayarladığınız kısa yolların çıktısını almak istiyorsunuz. Aşağıdaki eklentiyi kullanabilirsiniz.

[Keymap exporter - Plugins | JetBrains](https://plugins.jetbrains.com/plugin/7066-keymap-exporter)

#### Tüm Kısayollar
<iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4b9a48ea698fb3f64a23257752109d2/href">https://medium.com/media/d4b9a48ea698fb3f64a23257752109d2/href</a></iframe>

Kısa yolların olduğu sayfaya aşağıdaki bağlantı ile ulaşabilirsiniz.

[Keyboard shortcuts in predefined keymaps](https://www.jetbrains.com/help/rider/Reference_Keyboard_Shortcuts_Index.html)

{% youtube QYO5_riePOQ %}

[IntelliJ IDEA keyboard shortcuts](https://www.jetbrains.com/help/idea/mastering-keyboard-shortcuts.html)
Trying to decide which Star Wars to watch tonight...
Tags: watercooler
Published: 2020-05-04 19:47:03

---
title: Trying to decide which Star Wars to watch tonight...
published: true
description: May the 4th be with you!
tags: watercooler
---

So, it's may the fourth, and you know what that means...

![](https://media.giphy.com/media/4PbEHW8mN4xhK/giphy.gif)

Tonight, I'm gonna celebrate by watching some Star Wars! I've already exhausted The Baby Yoda Show (aka [_The Mandalorian_](https://www.imdb.com/title/tt8111088/)) ... though I wouldn't be surprised if I pop it on again tonight. I also still got a bit of gaming to do in [_Jedi Fallen Order_](https://www.ea.com/games/starwars/jedi-fallen-order), which I think is a seriously excellent Star Wars game.

Anyway, just nerding out a bit!

Are you celebrating May the 4th in any way? Got any suggestions for a Star War movie to watch tonight? Any goofy Star Wars GIFs you wanna share?

![Yoda Hacky sack](https://i.makeagif.com/media/8-15-2017/VmASTs.gif)

May the 4th be with you!
Polyfill for Array.reduce() Javascript
Tags: javascript, reduce, polyfill, interview
Published: 2020-05-04 19:45:48

###
###
###

Just wrote a code for polyfill reduce() in JavaScript, thought I will share it will you all.

```
Array.prototype.myReduce = function(fn, initial) {
    let values = this;

    values.forEach(item => {
        initial = initial !== undefined ? fn(initial, item) : item
    })

    return initial;
}
```

### Using the above

```
var values = [2, 5, 5]
values.reduce((a, b) => a * b)  // 50
values.myReduce((a, b) => a * b)  // 50

```

I have dry tested it for multiple outputs. Do let me know if there can be any improvements. 

Cheers!