teleren/devto huggingface dataset:
Day 160: New York
Tags: hiphop, code, coding, lifelongdev
Published: 2020-06-24 01:49:05

_liner notes_:
- Professional : Got to talk to my team and compare the features across the different SDKs. Really interesting to see how things are implemented to get features working regardless of where it's running. Had a couple of other meetings. Did some coding. Ended the day of helping host an online meetup. The company has started helping local meetups have their events online.

- Personal : Finished up with helping out the meetup. Had a really good time. Everyone seemed happy with the event. May do it again. My evening was pretty much helping out with the meetup. This is my second meetup this week. I attended the Orlando Devs meetup last night and my internet cut out because of a really bad storm with some of the worst lightning and thunder I've experienced!

![New York City skyline with all the buildings and skyscrapers](https://dev-to-uploads.s3.amazonaws.com/i/zyakryveifml0455ohy2.png)

It's funny that the image for today is New York, because that's where the meetup is based out of. Pretty tired after the meetup. Going to probably set up the database and the API endpoint that I need for the side project's information top populate my more info Web Component.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube Ax2NfFkwEzA %}
AZ-303 Study notes #1 Intro to Azure AD
Tags: cloud, azure, career, womenintech
Published: 2020-06-24 01:40:35

# Time to start studying 

I've decided to start studying for certifications again. I've been a cloud engineer for about 2 years now and finally know what path I want to take my career in. I am a big fan of IT certifications and am aiming to take 3 this year.

# Documenting my learning journey

To document my learning journey and help keep me accountable, I've decided to start a new series on my Youtube. Each video will have an introduction to the topic I am studying, some footage of me studying and going over the material and then a summary of what I learned that day.

# Let's start with [Microsoft Azure Architect Technologies AZ-303](https://docs.microsoft.com/en-us/learn/certifications/exams/az-303)

Here is the first episode, the topic covered is: Intro to Azure AD for the AZ-303: Microsoft Azure Architect Technologies 

{% youtube dMkuv7rYGYY %}

# Study notes

Azure Active Directory is sort of like a container that stores all the identity information for our organization. It is separate from your Azure Subscription. 

## Important components

### Tenant

The environment where we create our users and register applications and devices. 

### Domain

When a tenant is created, it will have one initial domain (domain.onmicrosoft.com) and zero or more custom domains (added using TXT or MX DNS records).

### Association / Trust Relationship

The link between an Azure AD tenant and one more more Azure Subscriptions. An AD tenant can be associated with multiple subscription, but a subscription can only and must be associated with one AD tenant at a time.

# Thanks for tuning in

Next video we are covering virtual networks and virtual machines.

I plan on creating more content around Azure; it's great to share what I've been learning.

If you have any feedback at all, please let me know in the comments below or reach out to me on socials.

Thanks for reading and possibly watching!
Day 23 - #100DaysofCode - Updated My Portfolio
Tags: css, html, 100daysofcode, womenintech
Published: 2020-06-24 01:19:00

I did it! I completed <a href="https://github.com/christinatruong/css-essential-training"> Christina Truong's  CSS Essential Training</a> and updated my portfolio. It is very basic and missing javascript, but nonetheless, it is something! I focused on learning some of the "newer" properties like grid, flexbox, and creating a responsive design. I will be providing a review on what I learned in a future post. 

Until then, <a href="https://sincerelybrittany.github.io/officialPersonalWebsite/" target="_blank"> view my updated vanilla HTML and CSS portfolio </a>.

Song of the day:

{% youtube 8dAPfhnR92U %}
Bootstrap 5 - all in 1 minute
Published: 2020-06-24 00:06:26

The world’s most popular open-source framework used by developers with HTML, CSS, and JavaScript is ready to roll out the new release - Bootstrap 5  anytime soon!
Here are the major changes expected with the new updated version.

No more Jquery
Yes, its 2020 and with so many more advanced substitutes like React, Vue,  etc, Jquery is removed.

Responsive font sizes
Bootstrap 5 will enable responsive font sizes by default. Now, it will be easier to resize the typography components according to the user’s viewport through Responsive Font Sizes or RFS engine.

SVG icon library
In bootstrap-3, we had Glyphicons, then they were removed with bootstrap-4, so we had to rely on third parties. Now, it has an inbuilt SVG library called brilliantly by Mark Otto for making it a bit easier.

Card decks removed
Bootstrap-4 had bulky code for cards creation to set equal width and height cards that aren’t attached to one another, Now, we have more of a responsive control with its new grid system.

Switching from Jekyll to Hugo
Bootstrap 5 is switching to Hugo, written in Go language for faster and flexible static site generator, though both have identical features, Go is making it lightning fast. ;)

Changed Gutter width unit of measurement 
Bootstrap 5 will have the gutter width be measured using rem instead of px. As Px does not change based on any other element thus not good for modern responsive web design. So rem is the new standard, 1 rem is equal to the font size of the HTML element.

Classes Update
Out of the 1500 something classes from Bootstrap-4, few are removed like form-inline, Card-deck, form-row, and few are added eg, row-cols-auto, g-*, gx-* (classes control the horizontal/row gutter width), gy-*.

No Support for IE10 or IE11
C'mon, we are in 2020.
How to inherit properties in JavaScript?
Tags: javascript
Published: 2020-06-24 00:00:00

---
  title: How to inherit properties in JavaScript?
  published: true
  tags: JavaScript
  date: Wed Jun 24 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/inherit-properties-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-9657991b301ef984a8dd46830408ea29.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/inherit-properties-javascript)
  
Consider a base class (constructor function) called `Vehicle` which we will use to inherit the properties from.

```javascript
// Vehicle base class
const Vehicle = function (type, year, numberOfTyres) {
  this.type = type;
  this.year = year;
  this.numberOfTyres = numberOfTyres;
};
```

Let's make another class called `Car` and inherit the properties from the `Vehicle` class using the `call()` method available in the `Vehicle` constructor function or class.

```javascript
// Vehicle base class
const Vehicle = function (type, year, numberOfTyres) {
  this.type = type;
  this.year = year;
  this.numberOfTyres = numberOfTyres;
};

// Car class
const Car = function (name, type, year, numberOfTyres) {
  // inheriting properties
  Vehicle.call(this, type, year, numberOfTyres);
  this.name = name;
};
```

The `call()` method available in the `Vehicle` class is used to inherit the properties and methods from the `Vehicle` class.

- The method accepts the context to call the function as the first argument in our case we provided the `this` keyword so that context of the `Vehicle` class is now the `Car` class.
- The remaining parameters in the `call()` method are supplied to `Vehicle` class to populate its appropriate field, in our case `type`, `year`, and `numberOfTyres` fields.

Now let's make an instance of `Car` using the `new` keyword and supplying required values to it.

```javascript
// Vehicle base class
const Vehicle = function (type, year, numberOfTyres) {
  this.type = type;
  this.year = year;
  this.numberOfTyres = numberOfTyres;
};

// Car
const Car = function (name, type, year, numberOfTyres) {
  // inheriting properties
  Vehicle.call(this, type, year, numberOfTyres);
  this.name = name;
};

// Make an instance of Car
const BMW = new Car("BMW", "car", 2020, 4);
```

If we look into the contents inside the `BMW` object we can now see all the properties which were defined in the `Vehicle` and `Car` classes

```javascript
console.log(BMW);

/*

Result:
-------

{
    name: "BMW"
    numberOfTyres: 4
    type: "car"
    year: 2020
}


/*
```

We will be discussing inheriting methods in the next post.

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

---
Compressing and Decompressing Messages (Java/NodeJs) while working with AWS Kinesis
Tags: aws
Published: 2020-06-23 23:56:50

We use AWS kinesis stream for event sourcing. AWS Kinesis has a limit of 1MB. With this restriction and combination of Java and NodeJS based microservices, we needed a way to compress and decompress the message across platforms. NodeJs and Java has inbuilt support for Compression and Decompression. Both platform use Gzip format.


![Alt Observation for JSON messages](https://dev-to-uploads.s3.amazonaws.com/i/u41920fdamkx8jjxvaqs.png)

Following are the examples in Java and NodeJs. It is possible to compress in Java, decompress in NodeJs and vice versa.

#Compress and decompress in Java 
```
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
import java.util.Base64;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
 
public class GzipUtil {
 
    private static final String payload = "Compressing messages and decompressing messages";
 
    public static void main(String[] args) throws Exception {
        String encodedStr = compress(payload);
        System.out.println("Compressed String: " + encodedStr);
        String decodedStr = decompress(encodedStr);
        System.out.println("Decompressed String: " + decodedStr);
    }
 
    public static String decompress(String str) throws Exception {
        GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(Base64.getDecoder().decode(str)));
        BufferedReader bf = new BufferedReader(new InputStreamReader(gis, "UTF-8"));
        String outStr = "";
        String line;
        while ((line=bf.readLine())!=null) {
            outStr += line;
        }
        System.out.println("Decompressed String length : " + outStr.length());
        return outStr;
    }
 
    public static String compress(String str) throws Exception {
        System.out.println("Original String Length : " + str.length());
        ByteArrayOutputStream obj=new ByteArrayOutputStream();
        GZIPOutputStream gzip = new GZIPOutputStream(obj);
        gzip.write(str.getBytes("UTF-8"));
        gzip.close();
        String base64Encoded = Base64.getEncoder().encodeToString(obj.toByteArray());
        System.out.println("Compressed String length : " + base64Encoded.length());
        return base64Encoded;
    }
}
```

Compress and Decompress in NodeJS
```
const zlib = require('zlib'); //inbuilt in NodeJs
const sizeof = require('object-sizeof'); //npm
 
const input = "Compressing messages and decompressing messages";
 
(async function () {
    // compress
    console.info(`String size: ${sizeof(input)}`);
    let buffer = await zlib.deflateSync(input);
    const compressedString = buffer.toString('base64');
    console.info(`compressed String size: ${sizeof(compressedString)}`);
    // decompress
    buffer = await zlib.unzipSync(Buffer.from(compressedString, 'base64'));
    console.info(`decoded string : ${buffer.toString()}`);
})()
```
#022 docker-compose manage app
Tags: docker, devops, tutorial
Published: 2020-06-23 23:37:33

# Introduction

this is part 22 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.

And I will cover lot of tools as we move on.
***
# useful commands
this is a contd... for last part , I will talk about some useful commands that you may use on daily basis with docker-compose.

first let's stop all containers with
```bash
docker container stop $(docker container ls -a -q)
```
![stoped](https://dev-to-uploads.s3.amazonaws.com/i/0qzjk60u0i3u1hmjvgjh.png)

now let's say we need to run only PostgreSQL without Django image , we can do this by
```bash
docker-compose -f local.yml up postgres
```
postgres here is the name of the service.
![post](https://dev-to-uploads.s3.amazonaws.com/i/1zyccfirad0hhki9shsj.png)
We can see that PostgreSQL run without Django because in our local.yml it doesn't depend on Django.
In other hand in local.yml we have Django depends on postgres.
![depends](https://dev-to-uploads.s3.amazonaws.com/i/s9xwivrqph19rr3c5vn0.png)
so when I try to run Django postgres will automatically start also.
```bash
docker-compose -f local.yml up django
```
![django](https://dev-to-uploads.s3.amazonaws.com/i/j7omc2nkxhnc5ypzerfr.png)
So in case in our development Database got stuck or whatever we can restart database only using
```bash
docker-compose -f local.yml restart postgres
```
and this will make it restart.
***
# Exec

In case you need to interact with docker container you can use
```bash
docker-compose exec sh
```
![exec](https://dev-to-uploads.s3.amazonaws.com/i/pdg4px38qaze2xyafmkx.png)

In my case in Django sometimes I need to used python shell to create Objects and feed them to Database.
I can access python shell in same way
```bash
docker-compose exec python
```
![python](https://dev-to-uploads.s3.amazonaws.com/i/cev5omg9liif38mzy1nz.png)
actually you can do what ever you want with exec like run a script inside the folder.
Let's take example you have a script that load fake data to database.
Algorithms: Common Years Problem
Tags: ruby, interview, algorithms, walkthrough
Published: 2020-06-23 22:09:54

I wanted to write about an interesting question I faced in a technical interview:
> Given an array of arrays containing birth years and death year of people find out the most common years amongst them.
```
 [[1901,1950],[1930,1960],[1973,2022]]
```

The steps I use to solve any algorithm problem:
1. Find out how I would do it manually.
2. Write them down as steps.
3. Translate into code.

##1. Find out how I would do it manually.
The manual way would be to go through each set and remember the range.for ex, the first set is from 1901 to 1950. At the back of our mind, we can remember those years as occurring once, then we go on to the next set. We remember the next set so we can already see the overlap. The first two have been alive together from 1930 to 1950. Then, we move on to the third and last set and we can see that it does not overlap with the other two.

Few things to note. Firstly, we need to connect occurrences to years. Secondly, the years with the most occurrences are the maximum occurences.

##2. Write them down as steps.
To solve this problem, we need to connect each year with the amount of occurences. Afterwards, we need to find the max occurence and find out all the years that have that.

I decided to use hash to connect`{1901 => 1}`.

##3. Translate into code.
This is code version of the steps:
```
def findCommonYear(arr)
    years = {}
    arr.each do |year_set|
        start_year = year_set[0]
        end_year = year_set[1]
        while start_year <= end_year do
            puts start_year
            if years[start_year]
                years[start_year] += 1
            else
                years[start_year] = 1
            end
            start_year += 1
        end
    end
    if years.values.max != 1 
        max_common_count = years.values.max
    else
        return 0
    end
    max_common_years = []
    years.each do |key,value|
        if value == max_common_count
            max_common_years << key
        end
    end
    return max_common_years
end

puts findCommonYear([[1910, 1950], [1900, 1951], [1945, 2000]])
```
Integrate Native module w/o Auto Linking in React Native
Tags: reactnative, ios, android
Published: 2020-06-23 21:48:52

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/v6jhmman20b5elm0w7aj.jpg)
[Photo by Andriyko Podilnyk on Unsplash](https://unsplash.com/photos/KfLJLJvkovo)

This week I had to help one of my engineers understand how to integrate a Native Module that is not enabled by Auto Linking and how it works for iOS and Android. It might happen to one of us who is not familiar with changes that occurred in the React Native ecosystem over the years.

The following are the reasons you might have to use manual linking Native modules for iOS, Android, or both.
- There is a 3rd party, and they don't yet support or configured Auto Linking
- The 3rd party you are using is creating issues with iOS/Android builds

For example, when adding `flipper-plugin-reactotron,` you need to add `react-native-flipper` as a dependency. In this case, the flipper dependency copies the scripts to debug and release targets. As you know already, Flipper only supports in debug scheme. Hence, we need this solution.

Here is how you can achieve it- 

1. Run auto-linking manually
`react-native link <module-name>`

2. Review and commit changes for iOS and Android
`git commit -am "Add 3rd party module - XYZ"`

3. Disable auto-linking for that particular module such that React Native stops warning or error in your console.
    - Create a file `react-native.config.js`, if not exist, in your project root dir. If not, add to the `dependencies` object.
{% gist https://gist.github.com/rnagella/318c43a2d75e845395a87f581a8e71ab %}

4. Commit the file changes
`git commit -am "Ignore React Native auto-linking for react-native-flipper"`
https://gist.github.com/rnagella/318c43a2d75e845395a87f581a8e71ab

5. In case, you need to update to next version. You need to unlink and link it again
  - `react-native unlink <module-name>`
  - `git commit -am "Unlink <module-name>"`
  - `yarn upgrade --latest`
  - Comment the dependency within `react-native-config.js`
  - `react-native link <module-name>`
  - `git commit -am "Update <module-name> to latest"`
Recreating the macOS Mail UI
Tags: html, css, showdev
Published: 2020-06-23 21:54:55

After seeing the design of the newly announced macOS, Big Sur, I decided to try to remake the user interface of the macOS Mail app. I used TailwindCSS and Heroicons by Steve Schoeger to help me along.

Check it out [here](https://big-sur-mail.vercel.app) (not mobile friendly) and look at the source [here](https://github.com/austincrim/quick-design-projects/tree/master/big-sur-mail).

Let me know what you think!
Designing SaaS Rest APIs for web clients
Tags: architecture
Published: 2020-06-23 21:54:14

For a typical browser IndexedDB storage gives you access to as much as half the free disk space. Once you convince yourself to use Rest, having that much storage makes your basic flow:

1. Have an API that returns all changed items for a client.

1. Have APIs that return the items for anything that changed.

1. Any create or update API will need to return the back end stored object so that the front end can update its IndexedDB cache.

1. In general do not expose individual item read APIs or APIs that filter, sort or search — do all of that on the web client.

In graphical terms 1 and 2 look like this:

![](https://cdn-images-1.medium.com/max/2000/1*9Xy2i3yHDO9WyEB4GMrcVA.png)

So far very simple but 3 is where we fall down the rabbit hole. If any single one of your APIs is eventually consistent then answering “Client up to date?” is hard.

[Uclusion](https://www.uclusion.com/?utm_source=devto&utm_medium=blog&utm_campaign=devapi) uses DynamoDB and asynchronous workflows built on DynamoDB streams so of course there is eventually consistent everywhere. Even with a SQL DB you could be reading from a slave or multi-master database where replication lag will be eventually consistent. If you rely on a read immediately following a write returning the data you just wrote then the front end client is dictating back end implementation.

If because of client space or compute limitations filter, sort and search capabilities must have APIs then run them outside your main transactional database. Otherwise long running queries against the same database requiring lightning fast create and updates is a use case mismatch. So these kinds of querying APIs require eventual consistency as traffic and volume of data scales.

With eventual consistency a call to refresh the client with the latest data can overwrite newer data that it already has from create and update operations. So a user might see his newly created object disappear for a while unless you are careful.

Traditional CRUD where a page loads from the back end dynamically or hoping to get by with an all synchronous API are strategies that user performance expectations and SaaS traffic loads have obsoleted. Our strategy for handling syncing eventually consistent objects:

1. All objects are versioned and these versions are used for signatures.

1. When the back end sends the object signatures it records an ID in a look up table for what was sent to the client.

1. If the client is successful in retrieving the object signatures it uses the signature ID in subsequent calls to inform the back end what object versions it has.
Everybody Starting an Online Biz
Tags: webdev, webperf, wordpress
Published: 2020-06-23 21:49:46

Everybody wants to [start a business](https://www.nationwideautomation.com/booknow), but can everybody do it? Know. You got that right. Most don't know how to even start, let alone get the word out. Made a website, great. Now what? 

Web developers are needed to bring these entrepreneurs' dreams into reality. Form an actual functioning high-performing website that does everything the business owner needs it to do, to bring in clients.

There are so many new types of businesses getting started up, from [home remodeling companies](https://paymyprice.com), to [home security](https://nationwidesurveillance.com), to [painting contractors](https://paintingschaumburg.com), [home renovation](https://homerenovationshows.com), [concrete contractors](https://cementcontractors.com), [home remodeling](https://homeremodelingchicago.com), [IT support](https://itsupportcell.com); where theres a need theres someone to open up a company to fill that need. There are many companies that provide custom products like [wood engraving](https://elevatedengravings.com) or [t-shirt designs](https://muscle-war.com), now is their time to shine. Ecommerce has seen a huge uptick, especially [workout supplements](https://www.gymsupps.com). Sites like [Bodybuilder SARMs for sale](https://bodybuildersarms.com)and others have seen drastic surges in organic traffic. [HVAC Near Me](https://www.hvacschaumburg.com), [Home inspectors](https://housedoctorsinc.com) or other similar search terms are used to find local companies on the major search engines. SEO is crucial to discover these high-volume search terms to help any business grow organically. Even [general contractors](https://contractormanagementservices.com) need help with their marketing. [Home Improvement](https://buildboard.com) apps are popping up all over the place to help contractors with their marketing.

[Digital marketing](https://www.nationwideautomation.com) is the second step. Once the website is up, its time to get it shared to the masses. Digital advertising can be daunting to the inexperienced, just as web development is. But rest assured there are plenty of experts out there.

Outsourcing these services works best, but it does take some working capital to afford these services. Finding a company that is both economical and knows what they're doing can be a challenge. Thats why its best to partner with other small businesses and ask them for partner referrals so you can get the best of the best, and someone you already work with has that relationship built.

We are in the new "gig economy" where gigs doesn't necessarily mean [musicians](https://www.vinnypaul.com), it can really be any type of freelance work.