teleren/devto huggingface dataset:
I change my mind, I'm going to follow my heart not my head ...
Tags: python, rails, php, beginners
Published: 2020-09-29 01:34:00

---
title: I change my mind, I'm going to follow my heart not my head ...
published: true
description: 
tags: Python, Rails, PHP, beginners
//cover_image: https://direct_url_to_image.jpg
---

Two weeks ago I wrote a series of posts about my choice of backend framework. I was hesitating between Django (python), Rails (ruby) or Laravel (php). Here is the link on my reflection: https://dev.to/rickavmaniac/django-rails-or-laravel-my-personal-journey-30lh

A few days later, I published my conclusion that I finally chose Laravel (php). This choice was the most logical and reasonable. PHP is very popular and Laravel offers all the tools you need to create great web apps.

Only small problem ... This choice I made with my head and not with my heart. My heart had already switched to Ruby. Since the first day that I started programming with this language I immediately knew that for me it was special. I don't know how to put it in words but it sounds like Ruby really unleashes my creativity and accomplishes what I have in my head.

Why didn't I choose it, you will say? Well you probably know that Ruby's popularity is not at its peak and that Ruby is more of a mature language than young and sexy.

I think I got carried away by the desire to always want more and always something new and especially popular. After all, it's the web and it had to be cool!

It's been a few days now that I program in Laravel and whatever I have nothing to say against this framework, I must admit that it is not Ruby.

So I'm going to do something that I don't often allow myself and pound on my pride and admit that I should have chosen Ruby. My heart had chosen it for a long time and I should have listened to it.

Fortunately, it is not too late. So I am announcing that I will finally do this mega project in Ruby on Rails.

I just wasted a few days of programming but hey, damn it, I'm going to start all over in Rails.

I'm glad I made this decision and wanted to share it with you because I know that in 2020, admitting that we made a mistake and changing our mind is not a very popular concept.

I hope to do nice things with Ruby!

To be continued.
I like being lost
Published: 2020-09-29 01:25:54

I like traveling without map because I am free to choose a way to go. There are many ways to the destination. I can also ask local residents for the way. It is interesting if I travel abroad. I communicate with people who don't speak the same language. If I am lucky, I can speak to whom speak English. Else, I have to use gestures to communicate with them. Fortunately, they understand and show me the correct way.

Sometimes I have to change my plan due to being lost. Although I don't get to the destination as I planned, I have a chance to visit new place. I learn about how people live and work and eat delicious food there. No matter where I go, I believe there is something new for me to learn and enjoy.

Amid COVID-19 pandemic, everything doesn't happen as we planned. That's fine. We can be flexible and change our plans. We will have new targets. We will have something new to learn and enjoy.

Stay safe.
Bootcamp Java Developer Day #9
Tags: java, bootcamp
Published: 2020-09-29 01:18:52

#### Day 9:

Still learning about Collections in Java. Somethings I already knew from python, but I realized I need to study binary trees.

#### 8) Ongoing: Implementing Collections and Streams with Java

Today's topics were:

- Queue
java.util.LinkedList;
java.util.Queue;

- Set
java.util.Set
java.util.HashSet
java.util.TreeSet
java.util.LinkedHashSet

- Map
java.util.Map;
java.util.HashMap
java.util.TreeMap
java.util.HashTable
java.util.Iterator
Is collecting Sentry exceptions part of telemetry?
Tags: help, electron, javascript
Published: 2020-09-29 00:07:25

This is for folks who use some kind of exception collection system like Sentry.

I want to include [sentry.io](https://sentry.io/) to collect error reports.

It is an electron app. The app is installed on user's machines so once installed, I will get exception reports from many places and may be very difficult change the settings if user choses not to download new versions.

My question is, is collecting sentry exception reports considered collecting Telemetry and should take user's permission first?

If so, can you please tell me how to dynamically disable sending in Sentry if user opts-out. I don't see any such option in the API.

Sentry allows to remove ip_address and email before sending the event to their server. I've removed collecting ip_address. There is no registration for my app. So there is no other data like email is collected anyway.

Sentry also seems to give options to trace performance. How helpful is that?
I need three people before I start another side-project
Tags: productivity, sideprojects, discuss, teams
Published: 2020-09-29 01:13:57

---
title: I need three people before I start another side-project
published: true
description: 
tags: productivity, sideprojects, discuss, teams
cover_image: https://s.hdnux.com/photos/01/03/02/41/17573994/3/920x920.jpg
---
I've had this on my mind for a while, but saw https://dev.to/madza/how-do-you-deal-with-half-finished-projects-3jcp and it insprired me to write it down;

For a long time I've had a ever building list of half-started projects. Always over-ambitious, always lacking direction and always getting stuck (since I always seemed use them as an excuse to try new tech too)

Nowadays I've promised myself not to get into them at all, because I've found that by myself I don't have all the tools needed to complete side projects and will always end up sinking so much time, effort and mental energy into something I'll sadly abandon. 

*I'm just a programmer*, the only reason I finish anything professionally is because of good project managers, financial & time pressures from clients, and the fact that there's other projects waiting to start. 

---

I think you need a minimum of three people. The obvious win with three people is a lot of self-indulgent ideas don't stand up to outside scrutiny, but as well I think we need three specific roles covered by three separate people: 
 
1. 💹💲🎁 The __client/business owner/product owner__ role
Someone with a high level business & feature perspective.
They can spec out whats actually required/important & understand paths to profit.

2. 🕕🩺🤍 The __Project manager/producer__ role
Someone who can manage time-frames & priorities & morale.
They understand that time, mental effort & emotional effort (if not directly financial) carry heavy costs.
 
3. 👷‍♀️👩‍💻 The __Coder/Builder__ role
Someone to actually build the thing.
(You and me probably)

Even better if 1. & 2. are not technical. 

This applies if you're spending a lot of time on it, or even if all three of you only commit a few hours a a week to it. 

Programmers so often view themselves as entire islands capable of shifting the world on their own, but I think that it's a really uncomfortable weight to put on yourself and don't believe its setup to succeed.

Having these roles owned by separate people;

☑ Makes responsibilities so much clearer.
☑ Which allows for a more equal mind-share/ownership of different parts of the project. 
☑ And It stops you feeling overwhelmed, overworked & stressed at all the different aspects you'd otherwise have to juggle yourself. 

---

__The next time I work on a side-project, it'll be after three of us think its a good idea and we can each fit into the roles above.__

__I'm pretty confident we'd have fun, complete it and make money on it.__

---

What do you think? 

Has anyone here completed substantial side projects on their own? How did you do it?
🔄 Using code to write code: Exporting issues with a Bookmarklet
Tags: github, jira, bookmarklet, tickets
Published: 2020-09-29 00:55:15

When I started back in March at MongoDB I wanted an easy way to create a list of what I was working on. 

There are two main pages I need to check on a daily basis:

* https://github.com/pulls/review-requested
* https://github.com/pulls

These two lists show me the main "docket" for the day, and the tickets I need to shepherd. 

What I found was that I had to often make lists of these things I'm working on. Between GitHub and Jira things can be a little scattered, there's the reviews I'm doing, reviews I need to request from my fellow colleagues, draft pull requests, and tickets that are assigned to me that don't yet have a PR associated. 

These lists ideally would both have a reference to GitHub and Jira. I wanted a way to copy all the links and put them in one place.

What I quickly thought of was creating a simple bookmarklet that would select all the tickets from the DOM. 

View the source at this gist: [reggi/github-link-bookmarklet.js](https://gist.github.com/reggi/b2dd35533ccdd80d99abab83ffcb9bec)

Because the links are in markdown it isn't super easy to paste into Slack or a Google doc. What I normally do is render the markdown and then copy the outputted list into slack, which is an unfortunate extra step.

I've been using a [chrome extension Bookmarkletifier](https://chrome.google.com/webstore/detail/bookmarkletifier/niljkabdebfjgebpddbejeoahhdfmphk) to make incremental changes and maintain the script, it's not great and can create malformed JavaScript, which doesn't matter in the editor because it all gets minified. I haven't found a better workflow for maintain or writing bookmarklets, I'm curious if anyone has any advice out there.

The script has a useful feature where it can parse the Jira ticket from the pull request and adding a specific link to the ticket. There are some hardcoded things in the script that appeal to my use case, but feel free to rewire it to suit your needs. 🤙🐍

There you have it! Problem solved, everything is a little easier to manage. I hope this inspires other developers not to be afraid to spend a little extra time to write a script that will help them in the long run. Happy coding. 🏄
Flexible Network Security Detection And Response With Grapl - Episode 281
Published: 2020-09-29 00:13:30

<p>Servers and services that have any exposure to the public internet are under a constant barrage of attacks. Network security engineers are tasked with discovering and addressing any potential breaches to their systems, which is a never-ending task as attackers continually evolve their tactics. In order to gain better visibility into complex exploits Colin O'Brien built the Grapl platform, using graph database technology to more easily discover relationships between activities within and across servers. In this episode he shares his motivations for creating a new system to discover potential security breaches, how its design simplifies the work of identifying complex attacks without relying on brittle rules, and how you can start using it to monitor your own systems today.</p><p><a href='https://www.pythonpodcast.com/grapl-network-security-episode-282/'>Listen Now!</a></p>
Cutting Through The Noise And Focusing On The Fundamentals Of Data Engineering With The Data Janitor - Episode 151
Published: 2020-09-29 00:12:33

<p>Data engineering is a constantly growing and evolving discipline. There are always new tools, systems, and design patterns to learn, which leads to a great deal of confusion for newcomers. Daniel Molnar has dedicated his time to helping data professionals get back to basics through presentations at conferences and meetups, and with his most recent endeavor of building the Pipeline Data Engineering Academy. In this episode he shares advice on how to cut through the noise, which principles are foundational to building a successful career as a data engineer, and his approach to educating the next generation of data practitioners. This was a useful conversation for anyone working with data who has found themselves spending too much time chasing the latest trends and wishes to develop a more focused approach to their work.</p><p><a href='https://www.dataengineeringpodcast.com/pipeline-data-engineering-academy-episode-151/'>Listen Now!</a></p>
Intro to Classes
Tags: javascript, beg
Published: 2020-09-29 00:01:01

**Intro**
New to ES6 is a type of function called classes. Each class has the ability to generate new versions of itself called instances. Each class instance can contain unique data. Let's take a closer look at classes and how to write them.

**Syntax**
Writing a class is similar to writing a normal function, expect we use the keyword class in place of the keyword function:

```
class Car {}
```

To create an instance of a class we use the constructor method:

```
class Car{
  constructor(brand,year){
    this.brand = brand;
    this.year = year;
  }
}
```
Using the new syntax we can create an instance of the Car class:

```
class Car{
  constructor(brand,year){
    this.brand = brand;
    this.year = year;
  }
}

let myCar = new Car("Ford", 1997) 
// Car { brand: 'Ford', year: 1997 }
```

If you need to access instance properties you can use dot notation or brackets:

```
class Car{
  constructor(brand,year){
    this.brand = brand;
    this.year = year;
  }
}

let myCar = new Car("Ford", 1997) 
// Car { brand: 'Ford', year: 1997 }

myCar.brand 
// 'Ford'
myCar.year 
// 1997

myCar["year"] 
// 1997
```

You can even access properties outside the instance in a class method:

```
class Car{
  constructor(brand,year){
    this.brand = brand;
    this.year = year;
  }
  
  myBrand(){
    return `My car personal car is a ${this.brand}`
  }
}

let myCar = new Car("Honda",2009)

myCar.myBrand() 
//'My car personal car is a Honda'

```

**Hoisting**
Unlike regular functions classes are not hoisted. You must declare a class before using it.

```
//You cannot use the class yet.
// let mycar = new Car("Ford",2020)
//This would raise an error.

class Car {
  constructor(brand,year) {
    this.carname = brand;
  }
}

//Now you can use the class:
let mycar = new Car("Ford",2020)
```

**Conclusion**
Now that you have the basics of classes and instances down. Practice writing some on your own. Just remember they will not be hoisted.
How to overwrite or fill buffers with data in Node.js?
Tags: node
Published: 2020-09-29 00:00:00

---
  title: How to overwrite or fill buffers with data in Node.js?
  published: true
  tags: Nodejs
  date: Tue Sep 29 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/fill-overwrite-buffers-nodejs
  cover_image: https://melvingeorge.me/_next/static/images/main-51ea8eb1f89890b45c37bc4d2d1c1e10.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/fill-overwrite-buffers-nodejs)
  
To fill or overwrite a buffer space with some content or data, we can use the `fill()` method in the `Buffer` instance in Node.js.

Let's say we have a Buffer with 10 bytes of memory allocated like this,

```javascript
// create buffer
const buff = Buffer.alloc(10);

console.log(buff); // <Buffer 00 00 00 00 00 00 00 00 00 00>
```

If you look into the contents of the `buff` object, you can see that the buffer is filled with `0`.

Now let's fill this with `2` instead of `0`, for that we can use the `fill()` method in the `buff` object like this,

```javascript
// create buffer
const buff = Buffer.alloc(10);

// fill the buffer with integer 2
buff.fill(2);

// Buffer filled with integer 2
console.log(buff); // <Buffer 02 02 02 02 02 02 02 02 02 02>
```

We can also define the starting point where we want to start filling the buffer and also the ending point where we want to stop filling the buffer.

The starting point is defined as the second argument to the `fill()` method and the endpoint is defined as the third argument to the `fill()` method.

```javascript
// create buffer
const buff = Buffer.alloc(10);

// fill the buffer with integer 2
// but start filling from the 2nd byte and
// stop filling at 4th byte
buff.fill(2, 2, 4);

console.log(buff); // <Buffer 00 00 02 02 00 00 00 00 00 00>
```

See the example live in [repl.it](https://repl.it/@melvin2016/fill-buffer-nodejs).

## Points to note

- The method accepts a `string`, `integer`, or a `Buffer` as the content to fill the buffer as the first argument.
- The method accepts the starting point or the offset as the second argument.
- The method accepts the ending point as the third argument.
- The method returns a reference to the `buffer` instance.

### Feel free to share if you found this useful 😃.

---
Unit Testing For Dummies
Tags: unittesting, qa, testing
Published: 2020-09-30 06:25:08

---
title: Unit Testing For Dummies
published: true
date: 2020-09-29 00:00:00 UTC
tags: UnitTesting,QA,Testing
canonical_url: https://www.loginradius.com/engineering/blog/unit-testing-for-dummies/
---

Learn how to run Unit Testing smoothly without getting into much of a botheration

   
[Read On](https://www.loginradius.com/engineering/blog/unit-testing-for-dummies/)
Exceptions and Exception Handling in C#
Tags: c, exception, exceptionhandling, net
Published: 2020-09-30 06:24:49

---
title: Exceptions and Exception Handling in C#
published: true
date: 2020-09-29 00:00:00 UTC
tags: C,Exception,ExceptionHandling,NET
canonical_url: https://www.loginradius.com/engineering/blog/exception_handling_in_csharp/
---

C# and the .NET CLR use exceptions to show that an error condition has arisen during program execution. C# programs are under constant threat of running into some sort of problem. As a program’s complexity grows, the probability that something odd would happen during its…

   
[Read On](https://www.loginradius.com/engineering/blog/exception_handling_in_csharp/)
Many-to-many self join in Rails
Tags: rails, ruby
Published: 2020-09-29 17:27:48

---
title: Many-to-many self join in Rails
published: true
date: 2020-09-29 00:00:00 UTC
tags: rails, ruby
canonical_url: https://www.kartikey.dev/2020/09/29/many-to-many-self-joins-in-rails.html
---

Let’s say we have “products” and we want to prepare “kits” of those products. Kits are nothing but the group of the products.

We can use many-to-many relationship here because products can be in many kits, and kits can be associated with many products.

Also, since the kits are just grouping the products, we can use self-joins. There are multiple ways we can implement self-joins.

### Using has\_and\_belongs\_to\_many

You can read more about [has\_and\_belongs\_to\_many](https://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association) on Rails docs.

#### Migration

```ruby
class CreateJoinTableProductKits < ActiveRecord::Migration[6.0]
  def change
    create_table :product_kits, id: false do |t|
      t.references :product, null: false, foreign_key: true, index: false
      t.references :kit, null: false, foreign_key: { to_table: :products }, index: false
      t.index [:product_id, :kit_id], unique: true
    end
  end
end

```

#### Model

```ruby
class Product < ApplicationRecord
  has_and_belongs_to_many :kits,
    join_table: :product_kits,
    class_name: 'Product',
    association_foreign_key: 'kit_id'
end

```

### Using has\_many through

This approach is better because later on in your project you can add more fields and validations in `ProductKit` model.As you know, our projects are always dynamic and most of the time(all the time) we end up modifying the flow. So, it isbetter to be prepared and use `has_many :through` from the beginning.

More on, [`has_many :through`](https://guides.rubyonrails.org/association_basics.html#the-has-many-through-association) on Rails docs.

#### Migration

```ruby
class CreateJoinTableProductKits < ActiveRecord::Migration[6.0]
  def change
    create_table :product_kits do |t|
      t.references :product, null: false, foreign_key: true, index: false
      t.references :kit, null: false, foreign_key: { to_table: :products }, index: false
      t.index [:product_id, :kit_id], unique: true

      t.timestamps
    end
  end
end

```

#### Model `app/models/product.rb`

```ruby
class Product < ApplicationRecord
  has_many :product_kits, dependent: :destroy
  has_many :kits, through: :product_kits
end

```

#### Model `app/models/product_kit.rb`

```ruby
class ProductKit < ApplicationRecord
  belongs_to :product
  belongs_to :kit, class_name: 'Product'
end

```
Refactoring UI book review
Tags: refactoring, ui, design, tailwindcss
Published: 2020-09-28 23:45:48

---
title: Refactoring UI book review
published: true
description: Refactoring UI, set of tips for devs who wants to level up their design game.
tags: refactoring, ui, design, tailwindcss
cover_image: https://static.vecteezy.com/system/resources/previews/000/094/691/original/abstract-pattern-background-vector.jpg
---

I found this interesting book for learning the tips and tricks from designers to devs. I always ended up working with bootstrap or similars for my designs despite they always look very alike which is not something I was 100% comfortable with.

Now that I read this book from the tailwindcss framework creators I feel like I can finally dare to experiment with more options. The following are some of the topics you will find:

* Building a color theme
* Layout and spacing
* Depth and shadows
* Text designing

I believe it can help a lot of devs like me which barely understand the colors theory, how to use spacing, picking the best font families for the different context and more.

So if you are looking for a practical guide with examples of what styling you should or should not apply in web design I highly recommend you to give it a try.

[Refactoring UI website](https://refactoringui.com/)
Development on  Remote Server
Tags: vscode
Published: 2020-09-28 23:26:23

## Problem Statement

Earlier last year, I switched my development setup to a cloud server that is hosted on vultr.com. (They're not sponsoring me or anything, I just decided to use them on a whim)

When I am using VIM, and not Visual Studio Code, any changes that are hosted with HTML are not automatically loaded on the server. It started to get really tedious to refresh my web browser to see the page updated.

Since my applications are hosted behind myProxy, hot module reload with Parcel doesn't work.

## Why

Since I have both a desktop and a laptop PC, it has become painful to sync my repo using Git. If I develop on a remote server, then I have the same exact environment on any computer.

## Solution

I have a workaround that works for development purposes. I realize that how SSL is interfering with the Hot Reload Module. I got around this by using `your_domain:PORT`. Since the certificate is only served over `port 443` this resolves the issue. Keep in mind this is only for development purposes. Any application that is serve on the internet should use `HTTPS`

## Alternative Solution

VS Code has a [port tunneling feature](https://code.visualstudio.com/docs/remote/ssh#_forwarding-a-port-creating-ssh-tunnel). This allows the developer to go to `localhost:port` and other people can still see the progress with the public URL.