teleren/devto huggingface dataset:
🎉 The state of CSS in 2019 🎉
Tags: css, opensource, design, sotwsurvey
Published: 2019-07-10 13:07:59

[Sacha Greif](https://twitter.com/sachagreif) and [Raphaël Benitte](https://twitter.com/benitteraphael) created a survey to collect, on a worldwide base, direct experiences of people working with CSS.

The goal was to create a detailed report able to document the state of CSS under different perspectives. I have to admit, the result is really impressive!!

![congrats](https://media.giphy.com/media/g9582DNuQppxC/giphy.gif)

I strongly advise to read the [whole report](https://2019.stateofcss.com/) online.

The document shows the participants demographics, salaries or years of experience. It reports which are the most used tools or layout units,  people opinions about their experience with the CSS learning curve or best practices (eg. avoid meaningless class names like ".foo").
For sure everyone can get valuable insights from it and being able to confront with other colleagues around the globe.


Below just a few images from the report to stimulate your curiosity...
&nbsp;
## Demography
![partecipation](https://2019.stateofcss.com/images/captures/demographics_participation-by-country.png)
&nbsp;
## Units
![units](https://2019.stateofcss.com/images/captures/units-and-selectors_units.png)
&nbsp;
##Opinions
![opinions](https://2019.stateofcss.com/images/captures/opinions_selector-nesting.png)

![programming](https://2019.stateofcss.com/images/captures/opinions_programming-language.png)
&nbsp;
Read the report and learn what is the current state of CSS for 2019!!

&nbsp;

You can follow me on:
&nbsp;
<a href="https://twitter.com/paco_ita">![follow-me-twitter](https://thepracticaldev.s3.amazonaws.com/i/fgw3ppch67r8ued10oef.png)</a>
Text overlay with Python
Tags: python, image
Published: 2019-07-10 12:45:28

---
title: Text overlay with Python
published: true
description: python, image
tags: python, image
cover_image: https://cdn.pixabay.com/photo/2019/05/30/14/19/cat-4239970__340.jpg
---
you can to overlay text on images. This is pretty easy. One way is with OpenCv (cv2), The computer vision module. But it's quite a large module, perhaps it's better to use PIL or something for this task.

So say you go with OpenCV. The difficult part is to install the OpenCv module. Some guides recommend to compile the whole module. 

### Install on Ubuntu 

On Ubuntu there's an unofficial module you can install from the repository, problem with that one is that it doesn't work with Python 3.6. 

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


Either way once installed you can run the code.


    #!/usr/bin/python3
    # coding=utf-8
    import cv2
    import numpy
    from PIL import Image, ImageDraw, ImageFont
    
    def cv2ImgAddText(img, text, left, top, textColor=(0, 255, 0), textSize=20):
        if (isinstance(img, numpy.ndarray)): 
            img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
            draw = ImageDraw.Draw(img) 
            fontStyle = ImageFont.truetype( "FreeSans.ttf", textSize, encoding="utf-8") 
            draw.text((left, top), text, textColor, font=fontStyle)
            return cv2.cvtColor(numpy.asarray(img), cv2.COLOR_RGB2BGR)
    
    if __name__ == '__main__':
        src = cv2.imread('img1.jpg')
        cv2.imshow('src',src)
        cv2.waitKey(0)
        
        img = cv2ImgAddText(src, "Python programmers taking a walk", 10, 35, (255, 255 , 255), 20)
        cv2.imshow('show', img)
        if cv2.waitKey(0) & 0xFF == ord('q'):
            cv2.destroyAllWindows()
            
    
The image img1.jpg can be any input image. I picked this one:

![](https://thepracticaldev.s3.amazonaws.com/i/n6ushl4uwzh61yop07u7.jpg)

The text color overlay is white (255,255,255). These numbers are 0 to 255 for color channels.

        img = cv2ImgAddText(src, "Python programmers taking a walk", 10, 35, (255, 255 , 255), 20)

Then:

![](https://thepracticaldev.s3.amazonaws.com/i/677ws5fk9chj4xvjving.png)

Related links:
* <a href="https://opencv.org/">OpenCV official module</a>
* <a href="https://pythonspot.com/image-data-and-operations/">Computer vision articles</a>
* <a href="https://www.pyimagesearch.com/">Vision blog</a>
* <a href="https://pythonbasics.org/">Python tutorial</a>
Zachtronics games free for schools
Tags: games, education, news
Published: 2019-07-10 12:17:18

There was [another post](https://dev.to/_codingblocks/coding-lessonsfrom-factorio-415n) talking about how similar the game __Factorio__ is to programming.  In the comments I mentioned Zachtronics games like __Space Chem__ are similar.

[In recent news](https://www.rockpapershotgun.com/2019/07/04/zachtronics-free-for-schools/), Zachtronics is offering several games to schools for _free_ ([original announcement](http://www.zachtronics.com/zachademics/))!  Definitely worth a look if you qualify.  If you don't qualify, consider supporting a developer that makes such a thoughtful contribution to education- and maybe having fun at the same time!

### Disclaimer:
I neither speak for nor am associated with Zachtronics in any way, shape, or form.  Unless you count being a fan of Space Chem.
Ionic Social Login using Firebase
Tags: ionic, sociallogin, firebase, webdev
Published: 2019-07-10 11:07:37

Ionic Social Login using Firebase

We’ll break the process into below steps.

1. Add firebase to your ionic App.
2. Set up and android app in firebase console.
3. Enable firebase dynamic links.
4. Enable google sign-In in the firebase console.
5. Install the required plugins in your cordova project.

If you want to know how we made it and how to connect Social accounts with Firebase then must checkout code with images **[right here](https://github.com/Mindinventory/IONIC-Social-Login-With-Firebase)**
Why Should You Use Cloudflare Like I Do
Tags: webhosting, security
Published: 2019-07-10 11:10:12

---
title: Why Should You Use Cloudflare Like I Do
published: true
tags: Web Hosting,security
canonical_url: https://kevinhq.com/why-should-you-use-cloudflare-like-i-do/
---

I know and I do use Cloudflare service for client’s projects, for years. Yet, I am not really convinced to use them on my own blog because of several reasons. Among those reasons, the one that’s most important is I don’t want to switch the nameserver to theirs. Several days ago, I do try it… 

[Read More »Why Should You Use Cloudflare Like I Do](https://kevinhq.com/why-should-you-use-cloudflare-like-i-do/)
Reuse business logic between React and React Native
Tags: react, reactnative, redux
Published: 2019-07-10 10:28:38

---
title: Reuse business logic between React and React Native
published: true
tags: react, react native, redux
cover_image: https://raw.githubusercontent.com/spoman007/reactXstarter/master/media/Screenshot.png
---

React ecosystem encourages the Learn Once Write Everywhere style. Once we know the core concepts of react, we can write both web and mobile applications with ease. Even though there are small differences like types of components etc, the core of applications remains same.

React being a library, we generally need help from some state management package to develop large applications. Redux is the more preferred one. Using redux helps us define the flow, business logic and application state.

When we were developing projects for our customers, we realised that even though the view layer of web and mobile application is different, we were writing lot of duplicate code as well.
For example, both our web and mobile applications had a login screen. Now the UI layer of this is different in react and react native. But once we get past that, we need to dispatch same action, make same service call, use same reducer and many more.
So we decided to take this business logic and put it in a separate npm package. We called this npm package Core. Both mobile and web applications can load this as a dependency or link to this package via symlink.

This helped us reduce the duplication of code. We were able to reuse almost 60% of code between React and React Native application. This also helped us in better predictability and consistent error reproduction. If something worked or failed it would happen in both web and mobile applications.

So ultimately we were able to deliver a product with faster turnaround and with less budget.

I created a working repository with sample todo app built in.
Here is the link
https://github.com/spoman007/reactXstarter

What is this Repository?
1. Demo of how the code can be reused between React and React Native Application
2. Extracts the business logic to a seperate npm package
3. Uses Redux to write application business logic: Actions and Reducers are extracted to a seperate npm package.
What is your biggest cause of bugs?
Tags: discuss
Published: 2019-07-10 10:19:24

---
title: What is your biggest cause of bugs?
published: true
tags: discuss
---

Recently I've found a lot of bugs have been caused by *my* lack of attention to detail.

For example, I was passing in the wrong thing to mixpanel's `alias` call which caused a month's worth of analytics data to be missing all of the events before a user signs up

Do you think you are causing the bugs in your work? Why?
Should developer blogs be peer reviewed?
Tags: discuss
Published: 2019-07-10 10:19:13

Sharing your ideas, discoveries, opinions with the wider developer community via a personal blog or a site like DEV is a lot of fun and has never been easier.

With great power comes great responsibility though and for every one up-to-date, well researched, post there are many others that are less helpful which at best is some out-of-date information and at worst can include a piece of code or be advocating an approach that might leave your code with a serious vulnerability if you were to act on it or copy/paste the wrong thing.

In researching something yesterday I had to read through three articles which included incorrect solutions to a problem before I found one that contained the right solution, wasting a lot of time in the process. That is with 15 years of experience and knowing what the right solution would look like - for beginners this presents a real problem. This is compounded by there being, on the posts with incorrect solutions, just as many  comments from people saying "Thanks, this is exactly what I was looking for" as there were on the correct solution.

This isn't just small blogs too, even on MSDN there used to be (and probably still are) many posts which included samples containing SQL injection vulnerabilities that are bound to have been copy/pasted into codebases across the globe. The new [docs.microsoft.com](https://docs.microsoft.com) now allows you to suggest edits and feedback on each page which is a huge improvement.

Are other people feeling this same pain? What could we do to solve this and improve the quality of information we're sharing?

I'm thinking along the lines of some voluntary code of practice which would cover things like:

 * Making sure posts include a date and the version number of the frameworks or libraries they're talking about
 * Some commitment by the author to keep the post up-to-date as things change - if the post becomes obsolete there could be a standard way of flagging this at the top
 * Old posts can still appear in Google search results years later so  keeping comments open to allow people to flag things
 * Following the example of other professions and having a peer review of a post before publishing, just like a code review of a pull request

Stack Overflow does a pretty good job of covering these things already. It has version specific tags for many frameworks, allows you to make peer reviewed edits of other people's questions and answers if you want to suggest an improvement and it allows questions to be flagged a duplicate.

The obvious drawback to this is that it makes things more formal and less fun which is partly why Stack Overflow is seen as unfriendly compared to DEV and others.

What do you think?
How you or you company have implemented CICD.
Tags: cicd, devops, suggestion, help
Published: 2019-07-10 10:01:05

---
title: How you or you company have implemented CICD.
published: true
description: CICD culture
tags: CICD, DevOps, Suggestion, Help
---

I work in a startup of 5. All of them having the development experience either front-end or backend. No devOps Expert.
We are thinking of implementing the CICD process. I have read the
theories about it. And want to know the practicality of it how it helped or didn't worked at all for you.

I am really interested in knowing how you or your company have implemented it or do you even follow this and what is the role of manual testing it.
JSDayIE 2019 tickets now on sale!
Tags: javascript, conference
Published: 2019-07-10 09:55:24

---
title: JSDayIE 2019 tickets now on sale!
published: true
description: The first JavaScript conference in Ireland!
tags: JavaScript, conference
---

I'm very happy to announce that after many months of work the JSDayIE tickets are now on sale!

![](https://thepracticaldev.s3.amazonaws.com/i/vf902e9n4mg3zipr1pta.png)

About a year ago I started to work on JSDayIE, the first JavaScript conference in Ireland.

Ireland has a huge developer community, in fact, Dublin has [a very high developer ratio](https://www.siliconrepublic.com/people/developers-programmers-jobs-in-dublin) and it is the home of the EU HQ of many global software companies such as Microsoft, Google, Twitter or Airbnb. 

However, for some strange reason, Ireland doesn't have a conference dedicated to the web development community (A few years ago Ireland was home of the Web Summit but it moved to Lisbon). So I decided to make it happen and I announced JSDayIE.

We have already announced some of our speakers and other details at [www.jsday.org](https://www.jsday.org). Please visit our site to learn more about the event.

The tickets start at 95 EUR + VAT and the conference takes place on **Friday, September 20th, 2019**. If you don't live in Ireland JSDayIE could be a great excuse to visit Dublin and discover Ireland.

I've been part of the Dev.to community for over two years now and I would like to thank other members for making this site so enjoyable and welcoming by **giving all Dev.to members a [15% discount code](https://ti.to/wolk-software-limited/jsdayie-2019/discount/Dev)**.

I look forward to welcoming many members of the Dev community to this event!
What's the most important factor for you when finding a new job?
Tags: job, career, hiring, discuss
Published: 2019-07-10 09:52:09

As a Software Developer there are 3 core factors to a job (that I can think of).

1) what product will I be working on? Is it something high profile in the public eye / groundbreaking, something to help animals / human welfare, or something no one gets to see, or moreso a retail website just shifting products / hotels / holidays? 

2) assuming it's the right prog. Language, what other technologies will I be using and how? Will I be building novel & new solutions using AI, ML, serverless etc or just working bau to 'make it better' 

3) what are the general working conditions ie work location / remote, pay, team, culture, boss, promotion, training etc

When choosing your next job, in which order would you prioritise these three factors and how much importance do you place on each ie factor three is critical, assuming factor one is on the money I don't care about factor two...? 

Does product even matter, or if the cause is good who cares about the techs? But of a balancing act between all three but then again if you don't like the product is it all bets off, but what are your boundaries of acceptability in that case???
How has programming helped you with a hobby?
Tags: discuss
Published: 2019-07-10 09:45:28

---
title: How has programming helped you with a hobby?
published: true
tags: discuss
---

I learn (human) languages for funsies, and I found that having some web savvy comes in handy. One example: I can use my browser's dev tools to slow down videos in a foreign language.

Have your dev chops helped with one of your hobbies? How so?
Containerized tool chain to simplify IoT device development
Tags: vscode, raspberrypi, docker, azure
Published: 2019-07-10 09:30:12

The public preview of containerized device tool chain enabled in Azure IoT Device Workbench extension in VS Code is released today!

The whole purpose is to simplify the device cross-compiling toolchain acquisition effort for device developers working on embedded Linux devices (e.g. Debian, Ubuntu, Yocto Linux…) with Azure IoT by encapsulating the compilers, device SDK and essential libraries in containers. All you need is to install or upgrade the IoT Device Workbench (v.0.3.1) and Docker runtime. And a target device like Raspberry Pi. Then everything works just like today you are using a local environment.

Find more details and start right now from https://aka.ms/devblogs/iotdev/container/dt
HTML/CSS Share
Tags: codepen
Published: 2019-07-10 09:26:27

<div class="fb-page" data-href="https://www.facebook.com/nenagh.afc/" data-tabs="timeline" data-width="500" data-height="2500" data-small-header="false" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="false"><blockquote cite="https://www.facebook.com/nenagh.afc/" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/nenagh.afc/">Nenagh Afc</a></blockquote></div>


<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.3&appId=174672232545043&autoLogAppEvents=1"></script>
Dependency Injection in Ruby 🌈
Tags: ruby, rails, codequality, refactorit
Published: 2019-07-10 09:19:31

I once wrote an article on Medium about dependency injection - [Dependency Injection is not Scary!](https://medium.com/@choonggg/dependency-injection-is-not-scary-refactoring-rails-the-clean-way-5ce5b305fd22). Recently joined dev.to, I thought I'd bring my thoughts here as well.

> Okay Eli, I know how to dependency inject now thanks to the medium article. BUT WHEN DO USE IT?

Bear with me here, I'll get to that soon. Currently building an inbox feature, I needed a form object for creating the conversation AND responding/editing the conversation.

What I could have done was create a form object, wipe my hands clean and be done with it. **Or I could also make this form reusable in other controllers.** 🤓

```ruby
module Inbox
  class ConversationForm < BaseForm
    attr_reader :conversation, :message, :sender

    def initialize(conversation, params = {})
      @conversation = conversation
      @sender = build_sender
      @message = conversation.messages.build(user: @sender)
    end

    ...
  end
end
```

But making use of dependency injection, I was able to reuse the form for another controller.

```ruby
module Inbox
  class ConversationForm < BaseForm
    attr_reader :conversation, :message, :sender

    def self.build(params={})
      conversation = Conversation.new
      sender = build_sender
      new(conversation, sender, params)
    end

    def initialize(conversation, sender, params = {})
      @conversation = conversation
      @sender = sender
      @message = converation.messages.build(sender: sender)
    end

    ...
  end
end
```

I would use `Inbox::ConversationForm.build` when I want to create a new conversation. In another controller/action, I would predefine the conversation and inject it into the form.

```ruby
# ConversationsController
# Creating a Conversation
def new
  @form = Inbox::ConversationForm.build
end

# My::ConversationsController
def new
  @form = Inbox::ConversationForm.new(fetch_conversation, Current.user)
end

# BOTH
def create/update
  if @form.save
    render :new
  else
    redirect_to some_path
  end
end

private

def fetch_conversation
  Inbox::Conversation.find(params[:conversation_id])
end
```

Once again, go forth and Dependency Inject!
Designing with Nim types
Tags: nim
Published: 2019-07-10 08:50:58

---
title: Designing with Nim types
published: true
description: 
tags: #nim
---

Nim translation of Scott Wlaschin's [Designing with types](https://fsharpforfunandprofit.com/posts/designing-with-types-intro/) series.

https://github.com/eterps/designing-with-nim-types
my c stack program
Tags: replit, c
Published: 2019-07-10 08:42:20

open for output
https://repl.it/@gireeshdg/ConstantPracticalAnimatronics



#include <stdio.h>
#include <stdlib.h>

struct node
{
    int info;
    struct node *ptr;
}*top,*top1,*temp;

int topelement();
void push(int data);
void pop();
void empty();
void display();
void destroy();
void stack_count();
void create();

int count = 0;

void main()
{
    int no, ch, e;

    printf("\n 1 - Push");
    printf("\n 2 - Pop");
    printf("\n 3 - Top");
    printf("\n 4 - Empty");
    printf("\n 5 - Exit");
    printf("\n 6 - Dipslay");
    printf("\n 7 - Stack Count");
    printf("\n 8 - Destroy stack");
    create();
    while (1)
    {
        printf("\n Enter choice : ");
        scanf("%d", &ch);

        switch (ch)
        {
        case 1:
            printf("Enter data : ");
            scanf("%d", &no);
            push(no);
            break;
        case 2:
            pop();
            break;
        case 3:
            if (top == NULL)
                printf("No elements in stack");
            else
            {
                e = topelement();
                printf("\n Top element : %d", e);
            }
            break;
        case 4:
            empty();
            break;
        case 5:
            exit(0);
        case 6:
            display();
            break;
        case 7:
            stack_count();
            break;
        case 8:
            destroy();
            break;
        default :
            printf(" Wrong choice, Please enter correct choice  ");
            break;
        }
    }
}
void create()
{
    top = NULL;
}
void stack_count()
{
    printf("\n No. of elements in stack : %d", count);
}
void push(int data)
{
    if (top == NULL)
    {
        top =(struct node *)malloc(1*sizeof(struct node));
        top->ptr = NULL;
        top->info = data;
    }
    else
    {
        temp =(struct node *)malloc(1*sizeof(struct node));
        temp->ptr = top;
        temp->info = data;
        top = temp;
    }
    count++;
}
void display()
{
    top1 = top;
    if (top1 == NULL)
    {
        printf("Stack is empty");
        return;
    }
    while (top1 != NULL)
    {
        printf("%d ", top1->info);
        top1 = top1->ptr;
    }
 }
void pop()
{
    top1 = top;
    if (top1 == NULL)
    {
        printf("\n Error : Trying to pop from empty stack");
        return;
    }
    else
        top1 = top1->ptr;
    printf("\n Popped value : %d", top->info);
    free(top);
    top = top1;
    count--;
}
int topelement()
{
    return(top->info);
}
void empty()
{
    if (top == NULL)
        printf("\n Stack is empty");
    else
        printf("\n Stack is not empty with %d elements", count);
}
void destroy()
{
    top1 = top;
    while (top1 != NULL)
    {
        top1 = top->ptr;
        free(top);
        top = top1;
        top1 = top1->ptr;
    }
    free(top1);
    top = NULL;
    printf("\n All stack elements destroyed");
    count = 0;
}