teleren/devto huggingface dataset:
Few of the useful resources that I use as programmer
Tags: resources, tools, android, webdev
Published: 2020-07-05 20:07:26

When I started as a beginner I didn't know what things to use, how to use, what to read & where to read which would help me in my learning phase and make my journey a little smoother.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dnuqh7oglenez4feaawz.jpg)

So, Initially my journey was rough, most of the beginner's journey are I guess. But slow and steadily I started stumbling upon some of the resources which I was very intrigued about and wondered if I knew about it long before.

Some of the resources was introduced by tutorials from either *YouTube* or some courses online or from reading some blogs.
I still remember, I felt like I had discovered a new tool for me to be *greater* at paths.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a3qlrsj7yberx2xpsvsd.jpg)

I'm being too dramatic I know, you can ignore that.
Well I feel I should share these resources so that any beginner who might be looking for it may stumble into this post and stumble less in their path to greatness.

So, these are the list of some of the resources that I use(random orders) : 

1. [Json pretty print](jsonformatter.org)
   * It is used to format a compacted json document into a human 
   readable format.
2. [Markdown github guides](guides.github.com/features/mastering-markdown/)
   * It consists of basic markdown syntax which is used mostly and 
   i refer to it when not in mind.
3. [Codesandbox](codesandbox.io)
   * An online code editor just like vs code, how cool is that. 
   You can edit online, save online, push changes to respostiory 
   online and what not. This is a must try resource.
4. [Coggle a mind map creator](coggle.it)
   * This is one of the best i came across, It is so satisfying to 
   be able to arrange your thoughts and ideas so systematically. 
   When some might prefer pen and paper to be the best, but this 
   saves time and it makes things so easy and appealing.
5. [Android material Io color tester/picker](material.io/resources/color)
   * This is for Android developers, here you can test out color 
   palettes in the layout like it would appear in the real device.
6. [Online sqlite database reader](sqliteonline.com)
   * It is used used to read .db file which is an sqlite database 
   file.
7. [Color palette picker](paletton.com)
   * It is a overall color palette selector, you can select and 
   customize custom color palettes.
8. [Online picture resizer](picresize.com)
   * This is very helpful as i have to work a lot with pictures so 
   it saves my time and does the work with less effort.
9. [Github markdown emojis](gist.github.com/rxaviers/7360908)
   * These are github emojis if one would like to use it, this is 
   for fun.

*So, hope these resources help you in anyway and will keep on updating if I come across any more. Till then see you in next stumble.*
Typescript Mixin example
Tags: typescript, mixin, typescriptmixin, multipleinheritance
Published: 2020-07-05 20:07:23

Typescript doesn't allow multiple inheritance through classes, although an interface extends multiple classes but it doesn't inherit methods implementation, it inherits only method declaration.

    class One {
        one() {
        }
    }

    class Two {
        two() {
        }
    }

    interface Three extends One, Two {
       // inherits One's, Two's method declarations
       one();
       two();
    }

There is another way to inherit methods from multiple special class(In typescript mixin used as function) called Mixin. According to Wikipedia, In object-oriented programming languages, a mixin (or mix-in) is a class that contains methods for use by other classes without having to be the parent class of those other classes. How those other classes gain access to the mixin's methods depends on the language.

Mixins are sometimes described as being "included" rather than "inherited". Basically in typescript Mixin is used to create a class. To this newly created class it adds new property and adds property from existing class.

it can be said as  

     Base/our class properties -> [ Mixin adds properties] -> NewClass

and then you can add few more properties

    NewClass  properties -> [ AnotherMixin adds properties] -> AnotherNewClass


Steps to use Mixin  
1. Create your class with properties, lets say User.
2. Create constructor function
3. Create Mixin function which return new class with new properties added by mixin and properties from User class.

Implementation  
1. let's create a User class with property name

         class User {
           name: string;
        }

2. let's create constructor function, used to create mixin class. refer this link for more details : [instantiating generic type](https://blog.rsuter.com/how-to-instantiate-a-generic-type-in-typescript/)

         // declaring generic type

         type Constructor<T = {}> = new (...args: any[]) => T;

   

3. A mixin function that adds new property and returns new class

        function Timestamped<TBase extends Constructor>(Base: TBase) {
          // User is considered as Base and Base is extended by new class
          // return a class, combining "name" and "timestamp"  
          return class extends Base {
            timestamp = Date.now(); // goes inside new class constructor 
          };
        } 


New class is named as TimestampedUser
it consists of new property timestamp and "name" from User

      const TimestampedUser = Timestamped(User);
      const timestampedUserExample = new TimestampedUser();
      timestampedUserExample.name = "vishruth";
      console.log(timestampedUserExample.name); //"vishruth"
      console.log(timestampedUserExample.timestamp);//1593976747100


You can create another Mixin and keep add properties to new class TimestampedNewMixinUser. like

          // define NewMixin function here and call like below    
          const TimestampedNewMixinUser = Timestamped(NewMixin(User));
Sinatra Ruby Web App
Tags: codenewbie, ruby
Published: 2020-07-05 20:00:48

Hi Guys! 
This has been crazy times, for the world and as a student is been the hardest months in terms of learning to code... 
I am a student in Flatiron School and for our second module we need to create a Sinatra Web App using MVC which stands for MODELS, VIEWS AND CONTROLLERS!
I've noticed that my previous post was a little meh on showing my experience doing this application so I will share a little more on this post.
I am going to share some of my files from my app hoping it will be helpful for you. In my application I am using,Sinatra Active Record, MVC, CRUD as well as uniqueness of validation for user login attribute. 
First I would like to share my Gemfile...

gem "sinatra", "~> 2.0"

gem "require_all", "~> 3.0"

gem "pry", "~> 0.13.1"

gem "shotgun", "~> 0.9.2"

gem "activerecord", "~> 6.0"

gem "sinatra-activerecord", "~> 2.0"

gem "sqlite3", "~> 1.4"

gem "rake", "~> 13.0"

gem "bundler", "~> 2.1"

gem "bcrypt", "~> 3.1"

You will need to set up your controllers as well as your views to make sure your app is working, make sure you use Session Secret and enable your Sessions just like this code below.

class ApplicationController < Sinatra::Base 

    set :views, ->{File.join(root,'../views')}
    enable :sessions
    set :session_secret, ENV["SESSION_SECRET"]
end 
Once you have this you can get started with your SINATRA CRUD, which stands for Create, Read, Update and Destroy.

class SessionsController < ApplicationController

    get '/login' do 
        erb :"sessions/login"
    end 

    get '/signup' do 
        erb :'sessions/signup'
    end 
    
    post '/signup' do
        @user = User.new(username: params[:username], password: params[:password])
        if @user.save 
            session[:user_id] = @user.id 
            redirect'/cocktails'
        else
         erb :"sessions/signup"
        end
    end 

    post '/login' do 
         user = User.find_by(username: params[:username])
        if user && user.authenticate(params[:password])
            session[:user_id] = user.id
            redirect'/cocktails'
        else  
            @error = "Invalid Username or Password"
            erb :"sessions/login"
        
        end 
    end 

    delete '/logout' do 
        session.clear
        redirect '/home'
        erb :'/cocktails'
    end 
end 
I've been RESTful in my code because is a requirement on my project, I think is a good practice to follow but is your choice to whether you use it or not.
I am happy to share my GitHub page so you guys can see my complete project, I hope this post is somewhat helpful to you.

https://github.com/sarisgar28/sinatra_project

Happy Coding!
Tecnologías para arquitecturas basadas en microservicios: Patrones y soluciones para aplicaciones desplegadas en contenedores
Published: 2020-07-05 19:58:59

---
title: Tecnologías para arquitecturas basadas en microservicios: Patrones y soluciones para aplicaciones desplegadas en contenedores
published: true
description: 
tags: 
cover_image: https://i.imgur.com/bwPVsFD.jpg
---
https://www.amazon.es/Tecnolog%C3%ADas-para-arquitecturas-basadas-microservicios-ebook/dp/B08CBDSCHV

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m1setpvod1aqiw87bf53.png)

El objetivo de este libro es presentar cómo desarrollar arquitecturas basadas en microservicios, conociendo los principales frameworks de desarrollo y herramientas orientadas al despliegue de las aplicaciones mediante el uso de contenedores y orquestadores. Gracias al uso de plataformas basadas en contenedores y orquestadores conseguimos alta disponibilidad, al tener varias instancias disponibles en distintas máquinas al mismo tiempo, escalabilidad, donde cada microservicio es capaz de escalar individualmente y despliegue de nuevas versiones en un tiempo mínimo.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oh3v4htw3dnmx80wmtfx.png)

El lector aprenderá los diferentes patrones que podemos utilizar cuando tenemos en mente el desarrollo de una aplicación basada en microservicios. El conocimiento de las buenas prácticas y patrones de desarrollo de software hace que los aplicaciones cumplan con todas las métricas de calidad de desarrollo como robustez, mantenibilidad, desacoplamiento y escalabilidad.
Introducción a las arquitecturas basadas en microservicios
2. Generadores de microservicios
3. Patrones de diseño
4. Microservicios en Java
5. Programación reactiva
6. Tecnologías basadas en contenedores
7. Introducción a Service mesh
8. Plataformas serverless
9. Arquitecturas basadas en eventos
10. Arquitecturas big data
11. Glosario de términos
SecDevOps containers
Tags: security, containers, docker, kubernetes
Published: 2020-07-05 19:50:48

---
title: SecDevOps containers
published: true
description: 
tags: security,containers,docker,kubernetes
cover_image: https://i.imgur.com/7Mr3OlL.png
---
https://speakerdeck.com/jmortega/secdevops-containers

In this talk I will speak about main tips for integrating Security into DevOps. I will share my knowledge and experience and help people learn to focus more on DevOps Security. In addition to the so-called best practices, the development of efficient, readable, scalable and secure code, requires the right tools for security development.
These could be the main talking points:
-How to integrate security into iteration and pipeline application development with containers.
-How to secure development environments.
-DevOps security best practices
How to build confidence in coding any programming language?
Tags: productivity, computerscience, javascript, css
Published: 2020-07-05 19:47:58

I have started to take on the tutorial on Udemy to understand the basics of web development and today I am finding that it is very easy. But, it was not like this always, around 8 months ago, when I wanted to learn how to code and be good at it. 

I started to code along with my job. I wanted to switch my career from a support engineer to a developer. I was unable to keep up my motivation and left to code. The feeling to implement the concepts that I learned was terrifying. I thought giving interviews will help as I was caring about me earning money instead of giving value to the company. To get through interviews I focused on interview questions instead of learning to code. I failed many interviews. I did not give up, tried hard. Prepared for all the interview questions that I found on the internet. Somehow, I cracked an interview and got a job.

My motivation to code also disappeared with me getting a job, coz my motivation was to earn, but it was not the right way to approach mine wants to earn. I had to struggle a lot in my career due to this. Due to a lack of passion and fear to complete on deadlines I was not able to meet up with the expectations. This was impacting on my self-image. But the reason I was struggling was that I wanted to perform in a field where I have not understood the concepts beforehand and practiced applications of the concepts.

On further self-introspection, I found that I did not have a learning attitude due to which I am unable to sit for learning to code and implement what I learned. I was under the influence of developers on twitter who always said to code which was the only way to be good at it. I decided to dedicate some time to it every day. I failed abruptly when I implemented it, it felt like my mind used to get a freeze in 15 minutes of study. But, that was my target I used to sit there although I didn't like it. To study for 1 hour a day, even if it means to stare at the computer screen in the name of the study.

Slowly I started to study some days and take a gap of 4 to 5 days because I felt depressed. I was learning in my first project and due to poor performance, they didn't want me. I was thrown to another project.

Now I have had the experience of being in touch with code for 3 months and some coding experience. This project was a little chill and I found time for myself where I dedicated time for me to study. I took up this web developer course, I never completed my basics. I also implement what I study, it helps in cementing the concepts.

Its been about 8 months now. I have not become some expert in 8 months, but I have changed my attitude, I ask for help, I know how to prioritize things, coding doesn't look like a nightmare now and I have learned to discipline myself. 

I can see I am growing at a very good speed. I hope to grow at a high-speed rate like a fire in the forest. I am working with all my heart and being connected to the developer community and twitter community that fills my heart with motivation.
Python Memory Management 101.Deeping in Garbage collector
Tags: python, memory, managment
Published: 2020-07-05 19:47:38

---
title: Python Memory Management 101.Deeping in Garbage collector
published: true
description: 
tags: python,memory,managment
cover_image: https://i.imgur.com/Gh6aF8B.png
---
https://speakerdeck.com/jmortega/python-memory-management-101-dot-deeping-in-garbage-collector

In this talk I will try explain the memory internals of Python and discover how it handles memory management and object creation.
The idea is explain how objects are created and deleted in Python and how garbage collector(gc) functions to automatically release memory when the object taking the space is no longer in use.
I will review the main mechanisms for memory allocation and how the garbage collector works in conjunction with the memory manager for reference counting of the python objects.
Finally, I will comment the best practices for memory management such as writing efficient code in python scripts.
These could be the main talking points:
-Introduccition to memory management
-Garbage collector and reference counting with python
-Review the gc module for configuring the python garbage collector
-Best practices for memory managment
Days 20-25
Tags: 100daysofcode
Published: 2020-07-05 19:41:11

## Day 20, June 27, 2020

I'm not sure if I should "count" this day, but I am. I didn't really work on any of the coding projects I've been doing. Instead, I decided to get back into an internet hobby I've had on and off for more than half my life. This included spending a few hours working with HTML, PHP and CSS. I still don't totally understand how PHP works... like how you can just change .html to .php and PHP can start working. I'm happy about it because it makes things easier, I just don't understand it. I'm thinking about ways I could build similar websites using JavaScript. I'm sure it's possible!

## Day 21, June 28, 2020

Today I worked on a few of fCC's functional programming challenges. I took a few days away from them and suddenly they seem less scary and confusing! They're **still** a lot harder than other exercises, but that's good. I feel like I'm getting a better grasp on the methods that have been confusing the hell out of me this whole time (like map, reduce, filter, etc.). Tomorrow I'm hoping to get back to my earlier days of #100daysofcode where I worked on Python and JavaScript.

## Day 22, June 29, 2020

**Python:** I did the first few exercises on min-heaps.

## Day 23, July 2, 2020

I missed a few days. :( 
**Python:** I did more min-heaps exercises.

## Day 24, July 3, 2020

I started reading *Automate the Boring Stuff with Python*. I've been mostly skimming the beginning intro Python parts except for the exercises so I can get to the automation parts.

## Day 25, July 4, 2020

I did a few projects from *Automate the Boring Stuff*, but realized that the actual automation projects, while cool, aren't really going to help me.
Tools for code coverage analysis in .NET
Tags: dotnet, csharp, testing
Published: 2020-07-05 19:40:01

An advantage of the unit tests is given additional coverage to own code. First, let's find what we need.

![](https://dev-to-uploads.s3.amazonaws.com/i/d9qksy0x7ovgzo2xdtyx.jpeg)

---

Since my beginnings in .NET, it was very common for me to hear that, to run the tests and see the coverage of the code, it was necessary to have *ReSharper* and *dotCover* installed (both created by *JetBrains*). However, this requires a license that is paid, either on your own or through the organization you belong to.

---

_The ReSharper license can also be obtained at a discount (and even free for other uses). You can learn more [here](https://www.jetbrains.com/es-es/store/#discounts?billing=yearly)._

---

Still, two things can happen:

- That for some reason (whether socio-economic or of any other nature) **you cannot** get the license.
- Your computer is not high performance, so using *Visual Studio* with *ReSharper* can be *frustrating in terms of performance**.

---

_You can optimize Visual Studio and the ReSharper itself, although its effectiveness depends on the equipment in question._

---

# When and when not?

Although *ReSharper* provides a series of improvements regarding the *stock* features of *Visual Studio* (that depends on your own choice), if we limit it to tests and coverage, it will not always be necessary.

## To run only unit tests

- With any variant of **_ Visual Studio_ (Community, Professional or Enterprise)**, we already have a [visualization environment] (https://docs.microsoft.com/es-es/visualstudio/test/run-unit-tests-with-test-explorer?view=vs-2019) of tests and review in case of errors.

---

_By default it supports MSTest, although you can add [support for NUnit or xUnit] (https://docs.microsoft.com/es-es/visualstudio/test/install-third-party-unit-test-frameworks?view=vs-2019)_

---

## To analyze code coverage

- If we have **_Visual Studio_ Enterprise (since 2015)**, we have a [*stock* environment to view] (https://docs.microsoft.com/es-es/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2019) the coverage percentages.
- Otherwise, if it makes sense to have an alternative tool.


# Alternatives for coverage

While there is the option of using *ReSharper* and *dotCover*, we just reviewed it because it was not always feasible. The good news is that there are alternatives, a very good and open source to be able to fulfill the purpose. We'll see in another article.

---

# Conclusions

- We should take more advantage of the tools that Visual Studio provides by default.
- The open-source philosophy gives us very good alternatives when licenses are our main impediment.

---

_The effort depends on the knowledge of a team regarding the tools._

---

Now that we know what tools to use, we have to see how we analyze the coverage itself. Although that will be for another article 😉.

---

_(Versión en español en [Medium](https://medium.com/@rruizdev/cobertura-del-c%C3%B3digo-en-net-qu%C3%A9-usamos-a88d0b04512))_
A Short Guide To Laravel Mix
Tags: laravel, webpack, javascript, css
Published: 2020-07-05 19:35:24

Laravel Mix is a powerful Webpack wrapper that allows you to manage your app's styles and scripts. You can use Laravel Mix in your Laravel project as well as setting it up in other environments. I've also been using Laravel Mix in Wordpress projects (and it's great!) . The Laravel Mix API is very easy and intuitive and will save you a lot of Webpack configuration time. 

Just published a short guide to Laravel Mix here:
https://yossiabramov.com/blog/a-short-guide-to-laravel-mix
Making prompts - an app that gets you out of writer's blocks using Reddit APIs and Deta
Tags: webdev, javascript, deta
Published: 2020-07-05 19:21:59

As developers we know best that sometimes the best way to avoid an idea block is to just start coding (Weeks of coding can save hours of planning, but that's for another story)

Here we are talking about writer's blocks. Coming up with an enjoyable piece of literature can be as challenging as programming, sometimes even more so. 

Prompts (live at [prompts.deta.dev](http://prompts.deta.dev)) is a simple app that I made for writers to exercise their brains hopefully recover from a writer's block. 

![The sleek homepage](https://dev-to-uploads.s3.amazonaws.com/i/i91ji01dzpokaqq8osnr.png)

Prompts works by fetching story prompts from the [r/WritingPrompts](https://reddit.com/r/writingprompts) subreddit and presenting them to you in a minimalistic editor where you can complete the rest of the story. 

![Prompts editor](https://dev-to-uploads.s3.amazonaws.com/i/u0auc47wj6wlwr436ayw.png)

There are several options to spice up the challenge - you can set yourself a timer and see how much you can write in a fixed amount of time and also calculate your typing speed

![Timer and typing speed](https://dev-to-uploads.s3.amazonaws.com/i/rb3qjlbhop64ty0bmt2r.png)

Once you are done, you can keep the story you wrote for yourself by exporting it as a document. If you didn't like the prompt you got you can always load another prompt from the menu.

---

Prompts is hosted with Deta Micros. Deta's Micros or Micro Servers lets you host your Python and Node.js apps in seconds with just their CLI tool. Check out more about them at [deta.sh](https://deta.sh)

The code for prompts is open-source at my GitHub [here](https://github.com/fillerink/prompts). Any contributions are welcome! (If you are planning to run it locally, the instructions to set up your own Deta Micros is given in the repo's README.md file)

Prompts is also featured in ProductHunt. You can check it out [here](https://producthunt.com/posts/prompts-2) 

---

What do you think about prompts? What all features would you like to add to prompts? Share your feedback in the comments!