teleren/devto huggingface dataset:
Ionic 4 Angular 9|8 Responsive Grid Tutorial with Examples
Tags: angular, angular98, ionic4, responsivegrid
Published: 2020-02-01 19:54:24

---
title: Ionic 4 Angular 9|8 Responsive Grid Tutorial with Examples
published: true
date: 2019-11-28 14:42:25 UTC
tags: Angular, Angular 9|8, Ionic 4, Responsive Grid 
canonical_url: https://www.positronx.io/ionic-angular-responsive-grid-tutorial-with-examples/
---

The post [Ionic 4 Angular 8 Responsive Grid Tutorial with Examples](https://www.positronx.io/ionic-angular-responsive-grid-tutorial-with-examples/) appeared first on [positronX.io](https://www.positronx.io).

**A comprehensive Ionic 4 / Angular 8 Responsive Grid tutorial with useful CSS Grid layout examples. In this tutorial, we will learn how to create a layout, and a responsive image gallery from scratch using Ionic 4 Grid system.**

Ionic offers a broad set of UI components, and these UI components help create and allow us to swiftly build a responsive layout, which works merely great on any screen size.

[Click here to read more](https://www.positronx.io/ionic-angular-responsive-grid-tutorial-with-examples/)
I’m a hobby web developer and blogger, Ask Me Anything!
Tags: ama, showdev
Published: 2019-11-28 14:27:49

*30th November 2018*, so about a year ago (depending on when you’re reading this), I started [my own blog](https://areknawo.com). I didn’t know where this path will lead me. I had no clue as to how and what I'll be doing.

So, by now, my blog was visited by more than **300K** people (varying from 20K to 60K per month). For some, it might be a lot, for others - not so much. But, personally, I'm very satisfied with these results! I had my ups and downs - controversy, successful posts, long breaks from writing, website crashes, etc. But, from my current point of view, I can only say it was worth the effort!

With this AMA, I want to celebrate *my blog’s first year* together 🥳 with great Dev.to community that has been there with me since the beginning. It’s been an awesome experience writing for you and all my other readers! I'm very much looking forward to what the future holds!

Thank you, and... I’m waiting for your questions!
Why you should never use the dict.get() method in Python
Tags: python, productivity
Published: 2019-11-28 14:16:30

*(Originally published on [prahladyeri.github.io](https://prahladyeri.github.io/blog/2019/11/why-you-shouldnt-use-dict-get-method.html))*

There is an increasing trend towards using the `dict.get()` method in Python, its very widely used in many tutorials and examples too. Condsider the below example for instance:

```python
>>> dd = {'a': 1}
>>> dd.get('a')
1
```

This simple dictionary dd has only one key ('a') and its corresponding value is 1. The proper way of accessing this key is to refer it as `dd['a']` but you need to be sure that the dictionary has that key otherwise it'll throw an error! Hence, as a shortcut way, programmers have started using `dd.get()` method instead. This method simply returns the key value if its present and `None` if there is no such key in the dictionary.

Seems good enough, right? Well, don't fall into that trap so soon! In the real world, you'll come across a situation sooner or later when you'll have to handle a dictionary key who's value is `None`! What will you do then? Consider this example:

```python
>>> dd = {'a': None}
>>> dd.get('a')
```
In this case, you'll never know whether a key was present in the dictionary or one was there and its value was `None`. Knowing the difference could be crucial in some situations and not doing so might cause subtle bugs in your program which will be very hard to trace later. The best habit to access a dictionary is this:

```python
>>> if 'a' in dd:
>>>     x = dd['a'] # do whatever
>>> else:
>>>     pass # handle this
```

Or you can even simply refer its key directly if you are sure that the key exists:

```python
>>> x = dd['a'] # do whatever
```

Similarly, there are two different ways to remove an item from dictionary but there is nothing wrong in using either of them (except of course that you need to be sure that the key is present and use an exception handler if you aren't):

```python
>>> dd.pop('a')
>>> del dd['a']
```
Complete Guide about Node Developers
Tags: node
Published: 2019-11-28 13:40:06

Node.js is rapidly and widely taking over as the go-to technology by the developers across the globe in building various Projects in Web Application framework, Social media apps, Real-time tracking apps, Video and text chat engines, Online games, Collaboration tools, and Backend static file server, etc. Evidently, Node.js is gaining prominence amongst big techno giants and they are actively on the lookout to hire Node.js developers to like never before because of the ease it offers in building fast and scalable network applications.

<img src="https://codersera.com/blog/wp-content/uploads/2019/11/nodejs22.png">


<b>What is Node.js</b>

Node.js was introduced by Ryan Dahl back in 2009, Dahl criticized the restricted possibilities of ‘Apache HTTP Server’ in handling a lot of concurrent connections and code creating a procedure (sequential programming), where code blocked the entire process or multiple execution stacks in case of the simultaneous connections.

<img src="https://codersera.com/blog/wp-content/uploads/2019/11/Hire-node.js-23.png">

It is a run-time environment that is built on Chrome’s V8 JavaScript engine where the user gets the flexibility to work on both the client and the server-side as well. Node.js is an open-source framework that runs on popular OS platforms like Linux, Mac OS X, and Windows.

Node is best suited for data-intensive, real-time applications that run across distributed devices as it is an asynchronous event-driven, non-blocking I/O model (lightweight and efficient for such intense applications).

 <b>Safety advantages:</b>

Good Performance
 Coupling in client and server
  Hosting service
 Cloud-enabled
 Lightweight Node.js services
 Supports quick native binding
  Minimum viable product (MVP) delivery
 Easy to use, open-source packages and modules
 Ease of execution & installation
 Supports multiple-platform

<a href="https://codersera.com/blog/hire-node-js-developers/">Why Node For Your Projects</a>
Changing Your Laravel Version 
Tags: webdev, laravel, devops, php
Published: 2019-11-28 13:08:00

Step 1: cd into your project directory  
step 2: locate and delete the <i>vendor</i> Folder
step 3: open <i>composer.json</i> file

step 4: locate <i> "laravel/framework": </i>"^6.2", 
        change to the version you want e.g 5.8
step 5: run <i>composer install</i> or <i>composer update</i>

The End
Serverless: traits, best practices & security risks
Tags: todayilearned, serverless, architecture, security
Published: 2019-11-28 13:00:12

*TL;DR style notes from articles I read today.*

### [The traits of serverless architecture](https://thght.works/2OedtV7)

- The initial learning curve is low and hence there is low barrier-to-entry. It lets you on-board quickly without needing to develop server management skills. 
- Being hostless, it reduces operational overhead on server maintenance. However, you need to learn different monitoring metrics, non-traditional security issues and the specific limitations of each service. 
- Serverless architecture is stateless and helps you scale horizontally. But it makes it hard to use stateful technology such as HTTP sessions or WebSockets.
- You need to learn distributed message delivery methods and the behavior of distributed transactions.
- High availability is offset by less consistency, and each serverless service has its own consistency model. 

*[Full post here](https://thght.works/2OedtV7), 11 mins read*

---

### [Serverless best practices](http://bit.ly/2OfMOYk)

- Make each function do only one thing. Avoid switch statements that make for large, complex functions that don’t scale well.
- Don’t let functions call other functions. 
- Learn to use messages and queues to keep functions asynchronous. 
- Use as few libraries as possible (ideally none), to avoid slowing down cold starts and to avoid adding security risks.
- One function per route (using HTTP). Avoid the single function proxy as it does not scale well and cannot isolate issues. 
- Treat data as flows and not ‘lakes’ at rest. Avoid querying from a lake; you need to rethink your data layer to avoid scaling issues and rigidity of data structures. 

*[Full post here](http://bit.ly/2OfMOYk), 7 mins read*

---

### [Serverless security risks](http://bit.ly/2OeMZDb)

- Event data injections are really hard to identify & block in serverless architecture. 
- Broken authentication is a big risk. There are hundreds of distinct functions, triggers & events that you must provide with the right access control and protection.
- High degree of settings customization offered in serverless can lead to insecure deployment configurations. Make functions stateless at the design stages to avoid exposing sensitive data.
- Over privileged functions are huge security risks. 
- Poor function monitoring and logging. Collect real-time logs from serverless functions and services, and push them to a remote SIEM system.
- Third-party dependencies on web services (through API calls), software packages and open-source libraries.  

*[Full post here](http://bit.ly/2OeMZDb), 4 mins read*

---

*[Get these TL;DR style notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
10 VSCode shortcuts to code faster ✌🏻
Tags: vscode, shortcuts
Published: 2019-11-28 11:52:59

---
title: 10 VSCode shortcuts to code faster ✌🏻
published: true
description: 
tags: #VSCode #shortcuts
cover_image: https://thepracticaldev.s3.amazonaws.com/i/bjxfwu5fkf43x6e9g35u.jpeg
---

1) This is my most favorite and most frequently used shortcut.

```
⌘-D/ctrl-D 
```

![gif](https://thepracticaldev.s3.amazonaws.com/i/fnt4b42frt4tiyxddpdx.gif)

First, select the text and then enter command-D to find the instances of similar text.

2) Let's say we are in the huge file and we want to quickly shift to config or function or type etc this command is most use full
```
⌘-shift-O/ctrl-shift-O
```
![screenshot](https://thepracticaldev.s3.amazonaws.com/i/rp5wm4iqmau4zdky7zx1.png)


3) When we want to quickly jump to a specific line number.

```
control-G/alt-G
```
![screenshot](https://thepracticaldev.s3.amazonaws.com/i/agvkrxjb4zwd41j4rmow.png)

4) Searching the text in the entire project.

```
⌘-shift-F/ctrl-shift-F
``` 

5)Have you tired of copying the block of code and pasting code above or below some code. Then this command is for you.

```
control-up-arrow or control-down-arrow 
alt-up-arrow or alt-down-arrow 
```
![gif](https://thepracticaldev.s3.amazonaws.com/i/x2xx372jgxy7vuzcg84l.gif)

6) Have you ever wondered how to delete a line quickly in vs code

```
⌘-x/ctrl-x
```
![gif](https://thepracticaldev.s3.amazonaws.com/i/988hfepl6thy8xh9ywkx.gif)

one more advantage it also copies that line for you.
note: if you want to delete a line without copying then use 

```
⌘-shift-k
```
7) Selecting word , this command is most powerful 🏎 when it is combined with the first example

```
shift-option-left-arrow/shift-option-right-arrow
shift-alt-left-arrow/shift-alt-right-arrow
```
![gif](https://thepracticaldev.s3.amazonaws.com/i/8975igfaopzv62q3ugfu.gif)

8) Have you ever come across situation where you have declared all constants as lowercase and you have to make them upper case. 

```
⌘-shift-P/ctrl-shift-P  ->To open command pallate 
search for Transform to Uppercase

```
![gif](https://thepracticaldev.s3.amazonaws.com/i/gd7u3uyib0dbnvptgx18.gif)

9) When you are working on different files and you quickly want to get back to the previous file 
```
⌘-P-P/ctrl-P-P
```
10) Search with the file name
```
⌘-P/ctrl-P
```
PHP script to calculate birthdays after reigstration day
Tags: phpcli, replit
Published: 2019-11-28 11:27:42

My first post in this community. Sorry for any error, just want to start sharing scripts from the Repl.It - it's mostly adviceable php sandbox. 

About the script itself - 

It's not too short but very straightforward and understandable


{% replit @artway/TurbulentShadyBash %}
Setting up my first OpenSource Python project
Tags: opensource, python, automation, logs
Published: 2019-11-28 11:23:30

In this series, I will explain what I did to set-up my first PyPi project. It’s a bit of a double whammy, it should help people sorting that out, and check with other developer what I did oddly.

This is also my first python project of my own. I have learned lots but I understand there is plenty of room for error and improvements (hopefully more of the later)

I will start by explaining the project itself, and the reason for it. You should not need to know it, but it should allow to understand the reasons behind it.

The project is [logger-to-kibana](https://github.com/IsmaelMartinez/logger-to-kibana) and encapsulates the main idea of trying to automate everything.

It will be too long for a single post so I decided to make it a series.

It also allows me time to continue improving the process and adding extra functionalities to [logger-to-kibana](https://github.com/IsmaelMartinez/logger-to-kibana) project.

I hope this helps and encourage people to set-up Open Source projects that solves those annoying repetitive tasks.

As always, I welcome constructive feedback. This is also my first dev post and most of the tools used are new to me. That is one of the reasons to play with them ;) 

Let me know what you think about it. Lets get started with the project itself.

{% link https://dev.to/ismaelmartinez/automating-kibana-visualisations-generation-56o4 %}

---

You can also pop along and help contribute into the project. ;)

{% github ismaelmartinez/logger-to-kibana %}
Postgres: How to display multiple values from a sub-query
Tags: postgres, sql
Published: 2019-11-28 11:05:40

---
title: Postgres: How to display multiple values from a sub-query
published: true
description: How to display an array of values as part of a query
tags: postgres, sql
---

I recently needed to generate a query where I needed to return the results from a joined table as part of a single result row for a Postgres SQL query.

So for context imagine I had a Person table, a Colour table and a FavouriteColours link table that links the primary key of the Person and the Colour so that each person can have a variable number of favourite colours from zero to all of them.

In my query I wanted to present a result set where each row was a person and all their favourite colours were listed in the result row, so I could export all the data.

The naive approach uses a sub-query within the projection result, like so:

```sql
SELECT colour.name
FROM colour
INNER JOIN favourite_colours
WHERE colour.id = favourite_colours.colour_id
AND favourite_colours.person_id = person.id
```

This failed however with an error message that roughly read "an expression from the sub-query returned multiple rows". Interestingly Postgres only raises this issue if multiple rows actually exist. If coincidentally all the people in the query one had one favourite colour then the query would run and then fail later when someone less decisive comes along.

Historically you might have dealt with this situation in a bit of hacky way by trying to turn the results of the sub-query into a string by joining them with a library function but fortunately modern PSQL has a better solution in the form of the [ARRAY type](https://www.postgresql.org/docs/current/arrays.html).

In addition to being a column type this can be applied to the result of a query to turn the results into a single array.

```sql
ARRAY (SELECT colour.name
FROM colour
INNER JOIN favourite_colours
WHERE colour.id = favourite_colours.colour_id
AND favourite_colours.person_id = person.id)
```

Now the query will return a single value that will display and be exported in the form: `{'Blue', 'Yellow'}`.

You can debug these sub-queries by just adding `SELECT` in front the ARRAY to see just that list which will contain all the favourite colours.
[WEBINAIRE] Introduction au développement de dApp sur la Blockchain Waves
Tags: wavesplatform, ride, blockchain, dapps
Published: 2019-11-28 11:03:29

Le 17 décembre 2019 à 17h, nous organisons un wébinaire en français qui présentera le développement d'applications décentralisées sur la blockchain #WAVES avec RIDE.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/83ohx2u8e5i0o52enhf3.png)

ENREGISTREZ-VOUS DES MAINTENANT :
https://www.meetup.com/Paris-Waves-Blockchain-Meetup-Group/events/266557857/

Suivez nous sur :
Telegram : https://t.me/wavesdappsFR
Twitter : https://twitter.com/WavesDevFr
Facebook : https://www.facebook.com/wavesfr
Dev.to : https://dev.to/gegesures

A bientôt

https://www.wavesplatform.com
Just published 2/8 tutorials on the fundamentals of JavaScript 🙈
Tags: discuss
Published: 2019-11-28 11:02:23

Hey Devs!

I'm currently writing 8 short tutorials on JavaScript fundamentals to help absolute beginners warm up to coding before jumping into web development with React. 

I'm starting to feel nervous about publishing the series and would love to get some feedback before I finish up on all 8 topics.


https://shooting-unicorns.com/learn-to-code

The topics completed so far are:
- Our first variable
- Conditional statements

My main concerns are:
- Confusing people
- Missing important parts
- Teaching incorrect things

Thanks for your time 🙏
Opencart MultiVendor Marketplace Extension | Black Friday 25% OFF
Tags: opencartmultivendor, opencartmultiseller, multivendorextension
Published: 2019-11-28 11:01:58

Purpletree Multi Vendor Marketplace for Opencart extension is a comprehensive solution to add Vendor functions into any Opencart Marketplace store. Features like Vendor Dashboard, Vendor Panel, Commission setup, Settlement management, Product Management by vendors, Shipping management by vendors make it a desirable extension for any store sourcing products from multiple vendors.
Payment Settlements
Admin earns a commission for products sold
Complete reports available for commission
Complete reports available for payout to sellers
Invoices for commission earned by admin
Invoices from Admin to sellers for commission earned
Invoices also have a record of payouts for sellers
Payout through PayPal
Payout through offline mode

Live Chat between Seller - Customer
Live chat from the seller product page
Live chat from the seller store page
Every seller can configure own chat account
Unlimited chats via tawk.to
Users directly chat with multiple sellers
Does not clash with Live Chat module on the main website
Increases conversion due to user interaction
Configuring chats is 100% free for sellers

Individual Store Page for every seller
Lists all seller products on a single page of opencart multi vendor store
Contact detail of seller
Admin can show/hide contact detail fields
SEO URL for seller page
The responsive design of Seller Page
Seller Branding with Logo and Banner

Multi-Vendor Cart System
Buyers can add products from multiple vendors in a single cart
Checkout and place order for multiple vendors in a single checkout
Shipping etc. handled for every seller transparently
User can browse multiples seller stores
Users can browse products either from normal category page or from Seller Store Page
Each vendor gets own part of the order and processes separately
Admin has a comprehensive view of all sellers' items for any given order

One Page Checkout Compatible
Compatible with one-page checkout extension for best opencart multi vendor store design
Works with many other One Page Checkout extensions as well
Compatibility is ensured across the releases
Makes the shop more usable

Bulk Product Upload by Sellers
Sellers can upload products using an excel sheet
Supports unlimited product upload
Upload all data related to the product like images, options, attributes
Products can also be updated using the bulk upload
Admin can bulk upload on behalf of sellers
Products are uploaded and associated with vendor account in a single go

Multi-Language Support
Comes with 17 languages in-built
All text from the extension appears in 17 languages
No need for any language pack
Easy to add any new language in the future

https://www.purpletreesoftware.com/multi-vendor-marketplace-opencart.html
Weekend Challenge - Takeaway
Tags: makers, rspec, ruby
Published: 2019-11-28 10:18:05

So last weekend we were tasked with making a takeaway app. It was going to implement receiving text messages. Unfortunately, I didn't get far enough through it to integrate texts. But it was still good although I think I'll give it another try maybe over the Christmas holidays. Mainly because I think adding texts will be challenging.

I didn't have any trouble other than running out of time and being sick. But I think I need to get used to using doubles and studs. I got to take a look at someone else's solution but unfortunately, they didn't get the text integrated either. However, their programme was pretty similar to mine. Which meant it was easier to understand.

This one is particularly short mainly because I didn't get a lot of done. But I might come back and update this blog if I do it over the Christmas break and I'll have more of an opinion on it.
Zero-Downtime Upgrader for OpenStack
Tags: cloudcomputing, openstack, sardina
Published: 2019-11-28 10:14:06

Sardina Systems is offering the first leading OpenStack technology feature: zero downtime cloud operations, including the OpenStack upgrade phase.
Discover more here https://medium.com/sardina-systems/zero-downtime-upgrader-for-openstack-be411b0180ff
How I made WordPress Faster with 1KB JavaScript
Tags: wordpress, javascript, performance, webperf
Published: 2019-11-28 10:13:24

Clickbait title right? 😉

Released 4 months ago, the script is currently used by 4k WordPress sites.

{% github gijo-varghese/flying-pages %}

```html
<script src="flying-pages.min.js"></script>
<script>
  flyingPages({
      delay: 0,
      ignoreKeywords: [],
      maxRPS: 3,
      hoverDelay: 50
  });
</script>
```

# How it works?

Flying Pages injects a tiny JavaScript code (1KB gzipped) that waits until the browser becomes idle, detect links in the viewport (also on mouse hover) and prefetch them so that browser doesn't have to wait while navigating through pages.

The prefetching is done using the prefetch tag:

```html
<link rel="prefetch" href="URL_TO_PAGE">
```

- **Prefetch pages in the viewport** – Detect links within the viewport (current viewing area) using ‘Intersection Observer’ and tells the browser to prefetch them using ‘prefetch’

- **Prefetch pages on mouse hover** – On hovering links, if it’s not prefetched yet using above ‘viewport’, then Flying Pages will prefetch them instantly (similar to Instant.page).

- **Limits the number of prefetches per second** – If your page has too many links, prefetching all at the same time will cause the server to crash or slow down the website to visitors. Flying Pages limits the number of prefetches per second (3 req/sec by default) using an in-built queue.

- **Stops prefetching if the server is busy** – In case the server starts to respond slowly or return errors, prefetching will be stopped to reduce the server load.

- **Understands user’s connection and preferences** – Checks if the user is on a slow connection like 2G or has enabled data-saver. Flying Pages won’t prefetch anything in this case.

![Demo](https://thepracticaldev.s3.amazonaws.com/i/aadngovy83ad4zim5l13.gif)

# WordPress Plugin

Prefetching links to logout, cart page etc can cause issues. So we need to exclude such links as well as few other options like:

- Set maximum requests per second
- Delay to start prefetching
- Mouse hover delay
- Disable for logged in admins

The [Flying Pages WordPress plugin](https://wordpress.org/plugins/flying-pages/) comes with a settings panel to configure all these:

![WordPress Plugin Settins](https://thepracticaldev.s3.amazonaws.com/i/m4zljtecqes1hrsu6wzw.png)

# Demo?

Check out my blog [WP Speed Matters](https://wpspeedmatters.com)