teleren/devto huggingface dataset:
Intro to IBM Cloud Functions
Tags: openwhisk, ibmcloud, python, serverless
Published: 2020-06-04 11:30:44

IBM Cloud Functions are a "serverless" technology based on Apache Openwhisk hosted by IBM. They allow you to write code and deploy it without having to worry about hosting, operating systems.

Above is the first part of a series of live coding sessions on Twitch I've done exploring IBM Cloud functions and showing some simple examples.

Also available on Cinnamon at: https://www.cinnamon.video/watch?v=329436575563777372

## Session recap

To start with you need an account on IBM Cloud. [You can get a free account by signing up here](https://ibm.biz/Bdqvqh).

You can either manage the Cloud functions through the IBM Cloud web portal, or you can use the command line interface (CLI). To install the CLI and Cloud Functions plugin, details are here: https://cloud.ibm.com/functions/learn/cli

There are four main constructs in Cloud Functions:

- Actions
- Sequences
- Triggers
-Rules

In this session, we mainly covered actions, which is where the code lives. IBM Cloud Functions is based on [Apache Openwhisk](https://openwhisk.apache.org/) and offers a number of different runtimes: JS/NodeJS, Swift, Java, Python, Ruby, Go, PHP, .NET, Any language (Docker).

![Openwhisk runtimes](https://dev-to-uploads.s3.amazonaws.com/i/y2v854sw3rusffrkfhcu.png)

## Some simple examples of creating, updating, invoking and deleting an action in IBM Cloud Functions

A simple hello world function:
```python
def main(args):
    name = args.get("name", "unknown")
    return {"message": f"Hello {name}!"}
```

Create an action:
```sh
% ic fn action create hello hello.py
ok: created action hello
```

List actions:

```sh
% ic fn action list                             
actions
/Matthew.Hamilton1@ibm.com_dev/hello                                   private python:3.7
```

Invoke a function:
```sh
% ic fn action invoke hello -r
{
    "message": "Hello unknown!"
}
```

Update a function:
```sh
% ic fn action update hello hello.py
ok: updated action hello
```

Delete a function:
```sh
% ic fn action delete hello         
ok: deleted action hello
```

As usual all the code and examples here can be found in my Github repository for the show:

{% github IBMDeveloperUK/ML-For-Everyone %}

I hope you enjoyed the video, if you want to catch them live, I stream each week at 2pm UK time on the IBM Developer Twitch channel:

https://developer.ibm.com/livestream/
AMP
Published: 2020-06-04 11:25:33

Wooh...The another opensource framework of Google.
AMP is an open source HTML framework developed by the AMP Open Source Project. It was originally created by Google as a competitor to Facebook Instant Articles and Apple News.
AMP is optimised for mobile web browsing and intended to help webpages load faster (light weight Super fast).


Google Search recently announced a new Search ranking signal centered around page experience. We’re excited by the potential for Google’s page experience signal to guide and empower developers to build a better web. Because AMP was developed to help enable development of user-first sites,  we believe AMP is a cost-effective and simple solution for publishers to create a great page experience. In today’s post, we want to step through what the announced changes to Google Search mean for the AMP community as well as the web ecosystem.

Google’s continued investment in AMP
Google will continue to invest in AMP, and strongly believes in the AMP Project’s goal to make it easy to create web pages that provide a great user experience. When available, Google Search will continue to direct users to the AMP versions of web pages in the mobile Top Stories feature. This behavior keeps in place hallmarks of the AMP experience, such as privacy-preserving pre-rendering that can happen when content is served from an AMP cache. This also means that the page experience signal for a given search result will be evaluated based on the performance of the AMP page when available.

The AMP Project will continue to focus on creating strong page experiences. AMP’s always up-to-date “evergreen” release schedule means AMP users will get future performance benefits as we make them, without investing additional engineering resources..

How to AMP Works.
The following optimizations combined are the reason AMP pages are so fast they appear to load instantly.

01) Execute all AMP JavaScript asynchronously
02) Size all resources statically
03) Don’t let extension mechanisms block rendering 
04) Keep all third-party JavaScript out of the critical path
05) All CSS must be inline and size-bound
06) Font triggering must be efficient
07) Minimize style recalculations
08) Only run GPU-accelerated animations
09) Prioritize resource loading
10) Load pages in an instant


Details By: https://amp.dev/
Mind Jam Hackathon for students interested in Entrepreneurship
Tags: hackathon, webdev, machinelearning, blockchain
Published: 2020-06-04 11:23:46

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

Cómo estás developers? We hope you are doing well in these times.
However, you continue to work and build, don't you? That is the entrepreneurial spirit we are looking forward to seeing in you.

Being a developer isn't just the technical work, there is much more to it. You need to be able to pitch your product, convince the investors why they must give a damn. The DSC club is aiming to help you elevate your future businesses or startups by organizing an open to all hackathon, Mind Jam. Get your creative ideas out in the open, build and pitch your products. This is an opportunity for your ideas to be implemented in the real world.

Mind Jam will commence from June 5th and last till June 10th. It is a 5-day online event and the applications have already begun. Just register at mind jam on devfolio and come up with a unique and mind-blown idea by June 5th.

Making it easy for you, click on the link and register now: https://mindjam.devfolio.co

The additional details related to the timeline of the event, and prizes worth hacking for are put up on the link as well.


Further more, join our channel on telegram:
https://t.me/mindjam
Crea un projecto en Django en 5 pasos
Tags: django, python, virtualenv
Published: 2020-06-04 11:18:31

# Crear un nuevo proyecto con Django

> Crear entornos virtuales para gestionar proyectos con Python

## Paso 1

Instalar pip para la resolución de dependencias.

`$ sudo easy_install pi`

## Paso 2

Instalar virtualenv para los entornos virtuales de Python

```bash
$ pip install virtualenv
$ pip3 install virtualenv
```

## Paso 3

Iniciar el entorno del entorno virtual para instalar las dependencias del archivo requirements.txt

```bash
$ cd {PROJECT_NAME}
$ virtualenv -p python3 .venv
```
## Paso 4

Activar el entorno de desarrollo 

`$ source .venv/bin/activate`

## Paso 5

Activar el entorno de desarrollo 

```bash
$ pip install django
$ django-admin startproject {project_name}
```

## Notas adicionales

Revisar las dependencias instalas en el proyecto

`$ pip freeze`

Instalar las dependencias del proyecto listadas en el archivo requirements.txt

`$ pip install -r requirements.txt`
Deepfakes, the next step in cybercrime. Why you should worry and how to protect yourself?
Published: 2020-06-04 11:12:37

Deepfake AI is used for stealing money, damaging reputation, or ruining someone’s career. Find out what deepfakes are and how to protect from them.
https://y-sbm.com/blog/deepfake-is-the-future-of-cybercrime
Real life comparison of Symfony router and Mezon router. Part 2
Tags: symfony, php, laravel, yii2
Published: 2020-06-04 11:04:12

# Intro

Hi all! Since the [last article](https://dev.to/alexdodonov/real-life-comparison-of-symfony-router-and-mezon-router-1hb5) I have got some feedback. And the time has come to improve benchmark according to this feedback.

# Improvements

The author of the CompiledUrlMatcher Nikolas Grekas pointed on mistake in this case:

```php
for ($i = 0; $i < \Mezon\Benchmark\Base::$iterationsAmount; $i ++) {
    $staticRoutes = \Mezon\Benchmark\RouteGenerator::generateSymfonyStaticRoutes(1000);

    $dumper = new CompiledUrlMatcherDumper($staticRoutes);

    $requestContext = new RequestContext();
    $requestContext->fromRequest(Request::createFromGlobals());

    $staticMatcher = new CompiledUrlMatcher($dumper->getCompiledRoutes(), $requestContext);
    $staticMatcher->match('/static/' . rand(0, ROUTES_AMOUNT - 1))['controller']();
}
```

He have told that $dumper->getCompiledRoutes() should not be called in array. Very reasonable. So I have changed the benchmark and now it looks like this:

```php
// before the benchmark we shall compile routes and store them into cache
$staticRoutes = \Mezon\Benchmark\RouteGenerator::generateSymfonyStaticRoutes(1000);
$dumperStatic = new CompiledUrlMatcherDumper($staticRoutes);
file_put_contents(
    __DIR__ . '/../../../cache/static-cache.php',
    '<?php return ' . var_export($dumperStatic->getCompiledRoutes(), true) . ';');
```

And then we shall use this cache in the case:

```php
for ($i = 0; $i < \Mezon\Benchmark\Base::$iterationsAmount; $i ++) {
    $requestContext = new RequestContext();
    $requestContext->fromRequest(Request::createFromGlobals());

    $compiledRoutes = require __DIR__ . '/../../../cache/static-cache.php';

    $staticMatcher = new CompiledUrlMatcher($compiledRoutes, $requestContext);
    $staticMatcher->match('/static/' . rand(0, \Mezon\Benchmark\Base::$iterationsAmount - 1))['controller']();
}
```

# And what are the results? )

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

1. Mezon router is almost in all cases faster then Symfony's default UrlMatcher;
2. But if you agree to dig into Symfony's CompiledUrlMatcher - it will be the best choice.

# Learn more

More information can be found here:

[Twitter](https://twitter.com/mezonphp)
[Mezon Framework](https://github.com/alexdodonov/mezon)

# What is mezon/router?

mezon/router now is:

- php framework for routing with **100% code coverage**
- **10.0 points** on scrutinizer-ci.com
- router is a part of the [Mezon Project](https://github.com/alexdodonov/mezon)

Repo on github.com: https://github.com/alexdodonov/mezon-router

# It will be great if you will contribute something to this project. Documentation, sharing the project in your social media, bug fixing, refactoring, or even **[submitting issue with question or feature request](https://github.com/alexdodonov/mezon-router/issues)**. Thanks anyway )
What is the cost of creating a mobile app in 2020 and how to cut it
Published: 2020-06-04 10:58:02

How much does it cost do build a mobile app? What factors affect the end price? How can you reduce it, while saving product quality? Learn the answers!
https://y-sbm.com/blog/what-is-the-cost-of-creating-a-mobile-app-in-2020
My EZ Regex Cookbook
Published: 2020-05-21 00:52:44

# What is Regex?
Regex is short for a "Regular Expression", which is a sequence of characters that define a search pattern for text. Usually, these are used to perform search or replace operations on strings, or for input validation. You can use Regex in practically every language to perform operations on strings.

Regex can be confusing as hell to write, but here are some of the most common Regex expressions for you to use in your software.

![Pattern](https://i.imgur.com/ZuYomIZ.png)

### 1. Match HTML Tags

Get HTML tags and their corresponding closing tag

```regexp
<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)
```

![Pattern](https://i.imgur.com/4KTSbp2.png)

### 2. Valid Email

```regexp
\b[\w.!#$%&’*+\/=?^`{|}~-]+@[\w-]+(?:\.[\w-]+)*\b
```

![Pattern](https://i.imgur.com/9NRxaTW.png)
![Pattern](https://i.imgur.com/lyQJnaj.png)
### Username
Minimum 3 characters, max of 16, made of letters, numbers, or dashes
```regexp
/^[a-z0-9_-]{3,16}$/
```

![Pattern](https://i.imgur.com/OuTDtvt.png)
![Pattern](https://i.imgur.com/c4T0AIq.png)

### Strong Password
Minimum of 6 characters, at least one uppercase letter, one lowercase letter, a number, and a special character
```regexp
(?=^.{6,}$)((?=.*\w)(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[|!"$%&\/\(\)\?\^\'\\\+\-\*]))^.*
```

![Pattern](https://i.imgur.com/LorUCTp.png)

### IPv4 Address
Matches any valid IPv4 address inside text

```regexp
\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b
```
Tetris in Typescript - Speed Coding
Tags: showdev, game, typescript, javascript
Published: 2020-06-04 10:55:10

Hey! Yesterday I have written a Tetris game in Typescript in 5 hours. The entire process I recorded, so you can watch it in a timelaps video :)

{% youtube tZmbPq3OMOE %}

Also, below is the source code of the game to analyze or modification.

GitHub (Please star 🌟 repo to make it better visible for others ;p)
{% github pilotpirxie/tetris-ts %}
Top 15 Apps Like Instagram for IOS and Android you need to know about
Published: 2020-06-04 10:53:45

Though Instagram continues to be the leading photo-sharing app, it has strong competitors. Check out 15 Instagram-like apps to see their success formula.
https://y-sbm.com/blog/top-15-apps-like-instagram-for-ios-and-android-you-need-to-know-about
Data science course in Bangalore
Published: 2020-06-02 09:39:56

If you are into statistics and python, you may take the appropriate courses to turn into an information scientist. While the large knowledge analytics discipline is consistently evolving, you have to have skills throughout multiple disciplines to be employable. With the rise in Large Data & the prominence for knowledge pushed decision making corporations are investing closely in Data Science. There are myriad of Job opportunities out there for Data Science practitioners.

A new world of job alternatives awaits you in Knowledge Science & this is the fitting time to step-into the job market of Information Science. Data Science Coaching In Hyderabad at the Orien IT coaching institute is providing the best & extremely endowed coaching in Information Science with the superb educating techniques to make the aspirants grow to be professionally effectively-skilled Knowledge Science experts.

You may then entry it by means of the net Learning Management System. We make use of superior coaching amendments and the success methods that help the scholars in the direction of retaining most information of the ideas that are explained within the coaching. After completing the Knowledge Science course, you'll turn out to be proficient in Enterprise Intelligence, data analysis, cleaning, mining, discovery, and transformation and in deploying Machine Studying algorithms and deriving business insights. <a href="https://g.page/ExcelRSolutionsBanaglore?share">Data science certification</a>   


A Knowledge Scientist is someone who extracts the info , cleans it, manipulates it, visualizes it , and explains it to a non technical audience, such that actionable information can be used by the business. Upgrade your self by attending this knowledge science course in Hyderabad It is taught by an skilled instructor who can be an actual time data scientist.Anyone can be a part of this coaching , no matter your background.

So, put together yourself for the new world of rising career opportunities in the platform of Azure Information Science by enrolling for OST institutes superior Azure DP-one hundred Data Science Certification Coaching. A Data Science skilled is able to provide an actual perspective of the continuing enterprise activities, the result or results of innovation, and an overview of underlying mistakes which can be being repeated yr after year.

We are located at : 
Location : 
ExcelR - Data Science, Data Analytics Course Training in Bangalore
49, 1st Cross, 27th Main BTM Layout stage 1 Behind Tata Motors Bengaluru, Karnataka 560068
Phone: 1800-212-2120/ 070224 51093
Hours: Sunday - Saturday 7AM - 11PM
Creating Multi-cloud Terraform environment with the help of remote state backends and AWS S3
Tags: terraform, cloud, aws, route53
Published: 2020-06-04 10:45:37

---
title: Creating Multi-cloud Terraform environment with the help of remote state backends and AWS S3
published: true
description: Learning Terraform: Part IV
tags: terraform, cloud, aws, route53
cover_image: https://assets.mkdev.me/posts/covers/000/000/012/original/mkdev_article.png
---
In the fourth part of the Terraform Lightning Course we are going to add one more cloud on top and connect two different Terraform environments together with the help of remote state management.

{% youtube A0Kjde5R7JY %}

***

**Terraform Lightning Course**

* Part I: [Infrastructure as Code](https://dev.to/mkdev/infrastructure-as-code-and-how-terraform-fits-into-it-40bl)
* Part II: [Terraform Fundamentals](https://dev.to/mkdev/terraform-fundamentals-state-management-and-dependency-graph-creating-the-first-server-1756)
* Part III: [Configuring Terraform Templates](https://dev.to/mkdev/configuring-terraform-templates-variables-and-data-resources-5b99)
* Part IV: [Multi-cloud Terraform Environment](https://dev.to/mkdev_me/creating-multi-cloud-terraform-environment-with-the-help-of-remote-state-backends-and-aws-s3-1l0)
* Part V: [Refactor Terraform code with Modules](https://dev.to/mkdev_me/refactor-terraform-code-with-modules-1o21)
* Part VI: [Learning Provisioners](https://dev.to/mkdev_me/creating-kubernetes-clusters-with-terraform-learning-provisioners-2o6o)

*You can always hire [our mentors](https://mkdev.me/en/specializations) and learn directly from them!*
I log, you log, we log for the love of logs
Tags: devops, docker
Published: 2020-06-04 10:41:49

The number of Docker containers deployed in our production boxes have steadily grown over the past 3 years. Last count - 284 containers running. I love logging but I'm shy to say we only just implemented centralised logging for these Docker containers yesterday. 

We are a profitable bootstrapped startup, and we don't have VC's money bags 💰 and unicorns 🦄 to chase. At TAGGUN, our top priority is to serve our customers by building [receipt and invoice OCR scanning API](https://www.taggun.io/) that doesn't suck. So, the power of scarcity has deemed centralised logging as a YAGNI until a few days ago. 

I wished I had a cheatsheet to implement centralised logging for Docker containers. So, I'm sharing it here with you to save you time and money.

## How is it done?

* Jump to the Docker host
* Create or Modify the daemon.json found at /etc/docker
* You may need to `sudo -i` first to access this area as the root user.
* Restart the docker daemon (this will take this box down for about 15-20 seconds) `sudo systemctl restart docker`
* Verify the docker logger `docker info --format '{{.LoggingDriver}}'`
* `docker ps` (This is to validate that docker has restarted without issues)

## What configuration for daemon.json?

```
{
    "log-driver": "syslog",
    "log-opts": {
        "labels": "docker-<machine_name>",
        "tag": "docker-<machine_name>[{{.ImageName}}/{{.Name}}]",
        "mode": "non-blocking"
    }
}
```

### Breakdown
* log-driver is built in logging driver for docker; syslog is the one we're using because many server monitoring agents can easily read them from Syslogs.
* labels don't get logged to syslog it seems; left in because of docker best practices.
* tag does get logged to syslog. This is how you can let your log viewers knows what the application name, and processes are.
* mode is set to non-blocking which means a memory buffer is used for logging to syslog. if the log backpressure exceeds a certain point, logs will simply be dropped from this buffer, rather than blocking.

### My recommended logging as a service platforms
* [Site24x7](https://www.site24x7.com/)
* [Loggly](https://www.loggly.com)
* [Sematext](https://sematext.com/)
* ~~Elastic Cloud~~ (I love Elasticsearch and ELK stack. But my managed cluster is down too frequently)

[Cover photo by Andrew Ridley on Unsplash]
How to get month list in your locale
Tags: javascript, typescript, localization, webdev
Published: 2020-06-04 10:01:21

---
title: How to get month list in your locale
published: true
description: Simple helper
tags: javascript, typescript, localization, webdev
cover_image: https://sigmatricks.com/wp-content/uploads/2019/05/Months.jpg
---

Hi there! I am glad to show simple TypeScript function, that maybe will save your time. In many cases you need to implement selector of months. In some cases it should be in different locales. See it below:
```ts
function getMonthList(
  locales?: string | string[],
  format: "long" | "short" = "long"
): string[] {
  const year = new Date().getFullYear(); // 2020
  const monthList = [...Array(12).keys()]; // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  const formatter = new Intl.DateTimeFormat(locales, {
    month: format
  });

  const getMonthName = (monthIndex: number) =>
    formatter.format(new Date(year, monthIndex));

  return monthList.map(getMonthName);
}
```

That's it. Just provide your locale as param.
For example, 🇬🇧 `getMonthList('en')` will return:

```js
January
February
March
April
May
June
July
August
September
October
November
December
```

Try it by yourself on [codesandbox](https://codesandbox.io/s/wild-meadow-nslq1?file=/src/index.ts:139-563).

For short version of names just provide second param as `short`.
For example, 🇬🇧 `getMonthList('en', 'short')` will return:

```js
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
```

Follow me in [Twitter](https://twitter.com/smartass3000)

**Update**
By your requests I have extracted function in [package](https://github.com/pret-a-porter/month-list)