teleren/devto huggingface dataset:
Another simplest serverless function 🤷‍♀️ ‍— but seriously 💖
Tags: serverless, ibmcloudfunctions, ibm
Published: 2019-06-13 01:06:40

---
title: Another simplest serverless function 🤷‍♀️ ‍— but seriously 💖
published: true
tags: serverless,ibmcloudfunctions,ibm
canonical_url: 
---

I have come across a couple of posts with the title **_simplest serverless functions_** and my initial thoughts are …

1. It is not that simple if you have to write up a config file to post a **_hello world_** function 🤦‍♂ !
2. How easy is it to now extend this function to something more usable ?

So here we go again … this example is based on **_Apache OpenWhisk_** , **_an open source distributed serverless computing platform_**. However, a serverless system on your desktop/laptop is no different than spinning up a nodejs express app or a flask app. **_You are missing out on scale, performance and distributed nature of OpenWhisk_**. In order to make it even simpler, we will use IBM Cloud Functions, a managed version of Apache OpenWhisk.

#### Check this out …

{% youtube jpUr2DRQvPU %}

In the next few posts, we will learn to extend this function to do something more usable. But wasn’t that easy !

![](https://cdn-images-1.medium.com/max/480/1*OJvehEDxKyjCMzvxsdiaMg.gif)

See you next time ! In the meantime, read up on some [serverless code patterns](https://ibm.biz/BdzPiS).

[Max Katz](https://medium.com/u/bf01a11701fe), thanks for this post idea !
Inline Styling with JSX
Tags: beginners, react, jsx, css
Published: 2019-06-13 00:26:25

---
title: Inline Styling with JSX
published: true
description: How to properly format inline styling with JSX and React
tags: beginners, React, JSX, CSS
---

If you are new to React, you have likely already encountered JSX, a syntax extension for Javascript used by the framework. It very closely resembles HTML, allowing for an easy transition if you’re already using HTML, CSS, and Javascript to create web applications. Just like HTML, JSX allows for inline styling. I’m not here to make an argument for or against inline styling versus external or internal style sheets, but if you do need to use inline style for a JSX element, there are some things to keep in mind to make sure your components render as expected.

Here is an example of a JSX expression being rendered by a simple function component:

```javascript
function HelloHeader () {
    return <h1>Hello World!</h1>
}
```

The JSX expression is after the return keyword, including the h1 tags. If you think this looks identical to HTML -- you'd be right! There are some differences between HTML and JSX, but for the most part if you're comfortable with HTML, you'll be in good hands.

Let's say you'd like to style this component, and for reasons unexplained here you want to use inline styling. Below is the syntax to style this h1 with font size of 16px and a color of red.

```javascript
function HelloHeader() {
    return <h1 style={{color: "red", fontSize: "16px"}}>Hello World!</h1>
}
```
A few things you've probably noticed:

* The value of the style attribute is wrapped in a set of curly braces {}. This is how you pass a Javascript expression in JSX. 
* There is a second set of curly braces inside, indicating the object containing the CSS properties and values.
* The CSS property font-size is typed as fontSize. Hyphens don't play nice with JSX, so any CSS property with a hyphen must be converted to camelCase to work.
* The property values are wrapped in quotes. While this isn't necessarily required in a CSS stylesheet, we do need to pass the values as strings in most cases. If you are passing a numeric value, such as for width or margin, it will default to pixels, so if you DON'T want that, you'll need to pass a string like "40%".

As long as you keep those things in mind, you shouldn't have any issues styling your components in JSX! 

If you do decide to use an external style sheet instead, webpack within React allows you to import your stylesheet directly in your .js file where your components are defined!

Like this:

```javascript

import "../styles/style.css";

```

Please let me know if you have any questions or corrections, and thanks for reading!
Typed properties in PHP
Tags: php, types, php74
Published: 2019-06-14 07:17:05

---
title: Typed properties in PHP
published: true
tags: php, types, "php 7.4"
canonical_url: https://stitcher.io/blog/typed-properties-in-php-74
---

Typed class properties were added in <abbr>PHP 7.4</abbr> and provide a major improvement to <abbr>PHP</abbr>'s type system.These changes are fully opt-in and backwards compatible.

In this post we'll look at the feature in-depth, but first let's start by summarising the most important points:

- Typed properties are available as of <abbr>PHP 7.4</abbr>
- They are only available in classes and require an access modifier: `public`, `protected` or `private`; or `var`
- All types are allowed, except `void` and `callable`

This is what they look like in action:

```
class Foo
{
    public int $a;

    public ?string $b = 1;

    private Foo $prop;

    protected static string $static = 'default';
}
```

If you're unsure about the added benefit of types, I'd recommend you reading [this post](/blog/tests-and-types) first.

Continue reading about the ins and outs of typed properties on [https://stitcher.io/blog/typed-properties-in-php-74#uninitialized](https://stitcher.io/blog/typed-properties-in-php-74#uninitialized)
How to Read the Content of an External File With Ansible
Tags: ansible, devops, beginners
Published: 2019-08-05 10:11:39

---
title: How to Read the Content of an External File With Ansible
published: true
tags: ansible, devops, beginners
canonical_url: https://mayeu.me/post/how-to-read-the-content-of-an-external-file-with-ansible/
---

Do you want to load up JSON data from a file directly into your Ansible playbook, tasks or roles? Did you start by trying to read it via a `shell` or command `module` and wondered if there was a better way? Well, there is, in the form or `lookup` plugins. Read on to see how to use it.

Ansible comes with a whole bunch of [Lookup plugins](https://docs.ansible.com/ansible/latest/plugins/lookup.html#plugin-list) that allow loading stuff from the outside your play. The one we are interested in today is the`file` [one](https://docs.ansible.com/ansible/latest/plugins/lookup/file.html). So, how do I load the content of my file with this?

Simply enough:


```yaml
vars:
  file_contents: "{{lookup('file', 'path/to/file.json')}}"
```

And bam, you have the content in the `file_contents` variable!

As you see, we are calling the `lookup()` function, to which we are passing the plugin we want to use has the first argument (in that case `file`), and then the path to our file. And just with that we loaded our file content!

**Note that the file must be on your Ansible controller** (i.e.: the computer where you are running the `ansible` command).

You can directly use this in any module without the need for an intermediate variable:


```yaml
- name: Read the content of a file instead of copying it directly
  copy:
    content: "{{lookup('file', 'path/to/file.json')}}"
    dest: /etc/config/file.json
```

And voilà 🙂

*This post was originally published on my website: [mayeu.me](https://mayeu.me/post/how-to-read-the-content-of-an-external-file-with-ansible/).*
Simple react state manager by Proxy API
Tags: react, javascript
Published: 2019-06-12 22:23:39

[Simple react state manager](https://github.com/Tetragius/raxy)

Simple react state manager. You can work with state as with a regular object. Can be used with redux-devtools-extension and history.

{% codepen https://codepen.io/tetragius/pen/xoOeqj %}

[More information](https://dev.to/tetragius/my-warm-state-management-library-for-react-based-on-proxy-api-23nd)
What's your software niche?
Tags: discuss, softwaredevelopment, career
Published: 2019-06-12 22:10:09

---
title: What's your software niche?
published: true
description: I've seen the cliche of "find a niche you can compete in." What niche are you in?
tags: discuss, software development, career
---

Here's the background: I've been reading a lot of advice articles who all suggest one thing, whether you want to freelance, start a business, or find a job, and that is to find a niche. The idea is that there's a lot of competition, and you'll struggle competing on price if you make yourself too "general."

I've reflected on my career, however, as being just that. I've struggled with specializing, because what happens most often is I'll specialize, an employer will have a unique requirement that I _can_ do, I do it well, and, at least theoretically, whatever time I could've spent specializing in one area I lost doing different things. In all honesty, this is because my roles usually were tied to marketing. For example, working at marketing agencies or marketing/communications departments but in a strictly development capacity. Even what I do now, despite being a company that provides _payment_ services, I'm working on projects related to marketing. So, of course, when I think about what my niche is, I figure it must be tied to marketing.

But this isn't so much about me looking for help figuring out my niche. Actually, what I want to know is *what you see your niche as*. If you were to look for work (be it a job or a project engagement if you're freelancing/self-employed, or if you had a product startup), what would you focus on?
Toggling Comments for Custom CodeMirror Modes
Tags: javascript
Published: 2019-06-12 22:03:54

Adding the ability to toggle line/block comments for Custom-defined CodeMirror Modes isn't well documented.

For my use case, I defined a SimpleMode. I wanted to allow users to toggle line/block comments either through clicking a GUI button or using a keyboard shortcut. Here's how I did it.

---

Below are the changes I made that differ from the documentation.

### Your Mode File

Describe what a comment looks like.

```diff
CodeMirror.defineSimpleMode('mode-name', {
  arguments: [],
  meta: {
+     lineComment: '#'
   },
  start: [
+    {
+      regex: /#.*/,
+      token: 'comment',
+    },
  ]
}
```

### Import the CodeMirror Comment Addon

This file can be found in `node_modules/codemirror/addons/comment`

### Instantiating the CodeMirror Instance

Define a keyboard shortcut to trigger the comment toggle in the CodeMirror options object.

```ts
{
  extraKeys: {
    'Ctrl-/': editor.execCommand('toggleComment')
  }
}
```
Poll: What Does "Serverless" Mean?
Tags: discuss, serverless, cloud, coding
Published: 2019-06-12 22:00:44

---
title: Poll: What Does "Serverless" Mean?
published: true
description: Discussion about the buzzword "serverless."
tags: #discuss #serverless #cloud #coding
---

I posted this to Twitter:

{% twitter 1138925456764198912 %}

If the poll is still active when you read this, feel free to vote and share with your network. 

I'm very curious. There are a lot of cloud services described as **serverless** but not a single, unanimously accepted industry definition. A few common ideas include:

* *Micro-billing (pay-per-use)* - no charge if you're not actively using it 
* *Event-driven/code* - small code footprint that is triggered by events
* *Auto-scale* - automatically scales up or down on demand
* *No configuration/setup* - no need to set up a VM or configure a cluster

Some examples include [Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-overview?WT.mc_id=dev_to-blog-jeliknes), [AWS Lambda](https://aws.amazon.com/lambda/), [Google Cloud Functions](https://cloud.google.com/functions/docs/), [OpenFaaS](https://www.openfaas.com/), and [Apache OpenWhisk](https://openwhisk.apache.org/).

I'm curious, based on your knowledge, what do these services have in common that makes them special? What should qualify a service as "serverless" as opposed to the "fully managed" options we've had available for some time?

(There is no right or wrong answer here, trying to understand the general views on this).
Create amazing borders with CSS Pseudo Elements
Tags: css, tutorial, beginners, webdev
Published: 2019-06-12 21:52:37

Until the Houdini Paint API hits all browsers, you may feel stuck with very boring borders for your elements. Using simple CSS and ::before and ::after, you can bring some interesting ideas to all browsers.

In this tutorial, I'll show you how to make a truncated, full-gradient, skewed border for any headline or text.

What sorts of borders or stylistic elements would you make with Pseudo Elements?

## New Course: Pseudo Power: Using the powerful CSS ::before and ::after pseudo elements

![Pseudo Power Image](https://d31ezp3r8jwmks.cloudfront.net/variants/aftsVnPtM1cNc1m5M3bBrEm9/d2e337a4f6900f8d0798c596eb0607a8e0c2fbddb6a7ab7afcd60009c119d4c7)

In this course, I'll be explaining exactly what pseudo elements are, as well as diving into many use cases for them. I'm still planning content, but just as with all my courses, there will be plenty of examples and code that can get you up and running right away. Here are a few examples of uses we'll be working through:

* Overlays
* Fancy borders
* Neat text link hovers
* Multiple decorative elements
* CSS-only tooltips 

[Sign up to stay up to date, as well as get a coupon code for when the course launches](https://store.codecontemporary.com/pseudo-power-using-the-powerful-css-before-and-after-pseudo-elements)!
My UX Writing process
Tags: writing
Published: 2019-06-12 21:43:52

---
title: My UX Writing process
published: true
description: 
tags: #writing
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4xa99akp7l2lgcwh76aj.png
---

In this week's video, I talk about my UX writing process and share my favorite resources:

{% youtube qO9Dx0WlBW8 %}

Key takeaways:

- Don't jump right into wordsmithing – Step back and look at the user experience holistically 
- Pay attention to verbs 
- Make every word count 
- Use as many words as required to help the users make informed decisions
Taking open-bank-mark to The Dutch Clojure Meetup
Tags: clojure, microservices, testing, docker
Published: 2019-06-12 21:35:01

I just presented [open-bank-mark](https://github.com/openweb-nl/open-bank-mark) at the [The Dutch Clojure Meetup](https://www.meetup.com/The-Dutch-Clojure-Meetup/). Focussing more on the Clojure libraries used than I did at the Kafka meetup.

In preparation I tested with setting `linger.ms` to 0 and 100 ms. Witch is one of the variables in Kafka that's really affecting your latency and throughput.

It was nice of [Open Web](https://www.openweb.nl/) to sponsor. Because it's a small meetup with only about 10 people today, there was lots of room for questions, and also sometimes for other people to answer when I didn't know. The raw data can be found [here](https://github.com/gklijs/open-bank-mark/tree/100-vs-0-linger-ms). 

{% slideshare xhP6AChuc0RGTu %}
Programming and Dating
Tags: carrer, life, softskills, dating
Published: 2019-06-12 20:37:22

---
title:Programming and Dating
published: true
description: 
tags: #carrer #life #softskills #dating
---


Hey everyone, I’m currently trying to find out how one could make the lives of developers a lot easier ;) 

Which is why I have one very simple question:

As an engineer, what are the 2 biggest issues you’re dealing with when it comes to dating?


Thanks so much in advance - looking forward to reading your answers!
When NOT to use a tool/paradigm/workflow
Tags: discuss
Published: 2019-06-12 20:36:53

Using the right tool/paradigm/solution/library/workflow for a job is widely regarded as a good idea.

It's the opposite of cargo-culting, which means blindly using a tool because others do, without necessarily knowing their reasons.

< / obvious >
< point >

Everyone who is selling tools will usually praise theirs as silver bullet for a wide range of use-cases.

What is missing is the information, when **not** to use it, or cases where that tool is not a good choice.

Lately I have come to appreciate tool-authors, vendors, experts and teachers who clearly state that…

…our book may not be for you.
…you should use a simpler approach.
…this library introduces too much overhead for your project-size.

It's an act which might prevent some purchases or downloads, but…

…it immediately builds trust.
…it provides usable information.
…it can prevent frustration in the long run.

Positive examples I came across more or less recently:

- ["You Might Not Need Redux"](https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367) by the author of Redux

- ["When and Why to Use Docker"](https://www.linode.com/docs/applications/containers/when-and-why-to-use-docker/#when-not-to-use-docker)

I'm curious about more examples of "do not use our product if…"!
API Documentation Tools
Tags: discuss, graphql, writing, productivity
Published: 2019-06-12 19:29:08

I'm going to be writing documentation for an API. It spans across multiple subdomains and is a split between REST and GraphQL based. 

Do any of you have recommendations for a tool I could use to format, organize, and write this? Or is it best to just use markdown, and if so is there a good collection of guidelines door formatting?
Career Insights of the Week on Dev.to
Tags: career, productivity, advice, video
Published: 2019-06-12 18:58:11

---
title: Career Insights of the Week on Dev.to
published: true
description: A highlight of the best discussions about dev careers from the past week on Dev.to
tags: career,productivity,advice,video
---

As I was reviewing the last week's career discussions, two threads from Ben Halpern stood out for the great comments that they generated.

In this video I highlight some of the my favorite picks from these two threads:

{% link https://dev.to/ben/what-s-the-best-career-advice-you-can-give-in-ten-words-or-less-53op %}

{% link https://dev.to/ben/what-habit-do-many-senior-engineers-have-that-juniors-should-try-to-avoid-adopting-2dd9 %}

Click the "follow" button so you don't miss my next updates.
How to teach a non-tech person to test an app
Tags: help, discuss
Published: 2019-06-12 18:48:25

---
title: How to teach a non-tech person to test an app
published: true
description: 
tags: help, discuss
---

My company hires a few interns every summer.  Sometimes they are hired for a specific department related to their major.  Other times they rotate departments and help where needed. One of the interns was recently assigned to my department to help me "beta test" a web app we're releasing soon. This is awesome but I have no idea how to teach a college student with limited tech experience how to "test" a web app.

How would you teach someone to test your web app?

What kind of pointers or instructions would you give them?

What kind of bug report would you ask for when the person testing isn't a dev?

So far I've asked her to:
* Go through the app like you were a normal user.
* Click everything!
* Try to use different browsers at different sizes including your mobile phone.
* Let me know if something doesn't do what you expect.
* Let me know if something doesn't look right.

Anything I've missed?
I Generated a License Generator Plugin for Git
Tags: git, plugin, addon
Published: 2019-06-12 18:46:06

Hi. I generated a license generator plugin for Git. All contributions are welcome

You can find it on GitHub: [https://github.com/foss-dev/git-license-generator](https://github.com/foss-dev/git-license-generator)

## Installation

There are two ways to install this plugin

### Manual Installation

```bash
git clone https://github.com/foss-dev/git-license-generator

cd git-license-generator

sudo mv git-licenses/* /usr/local/bin/
sudo mv git-generate-license /usr/local/bin/
```

### Direct Installation

Just copy and paste this one-line command:

```bash
$ bash -c  "$(wget -qO- https://git.io/fj2J9)" 
```

Or, if you are a Mac user:

```bash
$ bash -c  "$(curl -sLo- https://git.io/fj2J9)"
```

## Usage

Select license

```bash
git generate-license -s
```
Angular 9|8 Radio Buttons Tutorial with Examples
Tags: softwaredevelopment, angular, angular98, angular98radiobuttons
Published: 2020-01-31 19:53:36

---
title: Angular 9|8 Radio Buttons Tutorial with Examples
published: true
tags: Software Development,Angular ,Angular 9|8, Angular 9|8 Radio Buttons
canonical_url: https://www.positronx.io/angular-8-radio-buttons-tutorial-with-examples/
---

The post [Angular 8 Radio Buttons Tutorial with Examples](https://www.positronx.io/angular-8-radio-buttons-tutorial-with-examples/) appeared first on [positronX.io](https://www.positronx.io).

**Angular 8 Radio Buttons tutorial** with examples is going to be discussed in this tutorial. We will learn to set and get values in Angular 8 Radio buttons using Reactive forms and Template-driven form. Before we begin working on Radio buttons we should set up a basic Angular app.

### Setup Angular 8 App

To work with Angular Material 8 you must have Node JS, NPM & Angular CLI set up in your system.



[Click here to read more](https://www.positronx.io/angular-8-radio-buttons-tutorial-with-examples/)
Technology is bad for children
Tags: codigofacilito, education, elearning
Published: 2019-06-12 18:10:04

<p style="text-align: justify;">How the use of technology affects your child. 
Technology today is very useful and it is becoming part of our daily lives, we all use technology, including children. They can use it to learn different things, for example, with a simple video on YouTube your child can learn to play instruments, mathematics, art, etc. Also they can use applications to learn; however, as everything in life, it has advantages and disadvantages. Unfortunately, children who have access to technology can be in danger. Due to the lack of adult monitoring, children can become addicted to technology, fall prey to pedophiles and become victims of fraud by cybercriminals.</p>

<p style="text-align: justify;"> Children can become addicted to technology when they have access to a smartphone because they start using different applications that can cause addiction, for example, video games. Addiction to video games develops a pathological, mental and physical state in which a child needs to win the game he is playing in order to achieve a sense of Well-being. This results in a terrible obsession for children with their gadgets, as losing is not an option.</p> 

<p style="text-align: justify;">Pedophiles are predators, and as such they are a big danger in technology. In 2019 the famous Tik Tok application, where people are able to upload videos, allowed access to minors. The application was reported because pedophiles commented on the children’s videos using obscene language. </p> 

<p style="text-align: justify;">Sharing information is a difficult task for adults because they can be victims of fraud when giving confidential information to third parties, such as phone numbers, credit card information, etc. So, if it is difficult for adults, for a child it is worse; they can be tricked into clicking on malicious banners and pop-up ads. These ads show things that children are interested in. They are then lured into a page where they share credit card data to obtain their whims.</p>  

<p style="text-align: justify;">In conclusión, children can benefit extensively through the use of technology, but it is necessary for an adult to monitor them. Otherway, as mentioned, they can easily become addicted to technology, be victims of pedophiles and also participate in fraud because of not knowing better.</p> 


At [CódigoFacilito](https://codigofacilito.com/ "CódigoFacilito") we teach spanish speaking students how to start with programming, web development, mobile development and other skills they need to succeed, and although we produce lots of free content, we also have a $9USD/month membership (or $90 yearly) for Premium content, if you'd like to sponsor a membership for someone that can't afford it, please let us know at uriel@codigofacilito.com.