teleren/devto huggingface dataset:
How to use addFirebase of the Firebase Management API
Tags: firebase, gcp
Published: 2020-07-30 17:42:28

---
title: How to use addFirebase of the Firebase Management API
published: true
description: I want to call addFirebase. I have problem what get an error that The caller does not have permission when use a service account what it has owner role.
tags: Firebase,GCP
//cover_image: https://direct_url_to_image.jpg
---

I want to call addFirebase of Firebase Management API. This api can add firebase for a project of GCP. I try [here](https://firebase.google.com/docs/projects/api/workflow_set-up-and-manage-project)

But, I get only an error:

```
{
  error: {
    code: 403,
    message: 'The caller does not have permission',
    status: 'PERMISSION_DENIED'
  }
}
```
my service account have owner role. 
If the Owner can't call, who on earth can call? I don't have an idea.

I watch people who have same issue in stackoverflow. But,
There was no answer I was looking for.

So, I write now here!!!!!

Please tell me there!

## Documents
https://firebase.google.com/docs/projects/api/reference/rest
https://firebase.google.com/docs/projects/api/workflow_set-up-and-manage-project
https://stackoverflow.com/questions/55757947/403-the-caller-does-not-have-permission-for-firebase-management-api-addfirebase
https://stackoverflow.com/questions/54773388/firebase-management-api-projects-addfirebase-permission-denied
https://stackoverflow.com/questions/58955308/403-when-using-firebase-api-to-create-a-project-as-an-owner-user-not-a-service
Agile Thoughts
Tags: agile, scrum, xp, softwaredevelopment
Published: 2020-07-30 17:23:26

---
title: Agile Thoughts
published: true
description: If you're like me, you hate spending time testing the same thing over and over again using a mouse and keyboard. And about those bugs, who needs to go back and fix things that used to work? Wouldn't it be better to only release new features without worrying about regressions? This IS possible if you STOP building software in the same way that keeps resulting in this trouble. Let me tell you some of the "thoughts" you need to hear, so you can learn how to consistently release software with zero defects, and how to guide yourself, your team, and your organization through changes necessary to do Continuous Delivery. A continuous delivery of *only* the good stuff. 
tags: Agile, scrum, XP, softwaredevelopment 
//cover_image: https://direct_url_to_image.jpg
---
Como deletar todos os branchs locais
Tags: git
Published: 2020-07-30 17:06:29

É normal chegarmos a momentos em que queremos limpar os branchs locais na nossa máquina, pois eles estão apenas ocupando espaço.
Para isso, a maneira mais simples é a seguinte:
```
git branch -d "nome do branch" 
```
Mas nem sempre essa é uma tarefa simples porque podem existir muitos branchs locais.
Para isso existem maneiras de excluir todos os branchs mantendo apenas o master:
Primeiro deve-se fazer checkout na master:
```
git checkout master 
```
Depois disso, se utilizar Linux usar o seguinte comando:
```
git branch | grep -v "master" | xargs git branch -D
```
Caso utilize Windows, pode-se fazer pelo PowerShell (basta digitar PowerShell na busca e aparecerá o programa):
```
git checkout master; git branch -D  @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})
```
Mid Meet Py - Ep.17 - Interview with Martin Borus
Tags: python, watercooler, europython, talkshow
Published: 2020-07-30 17:02:42

---
title: Mid Meet Py - Ep.17 - Interview with Martin Borus
published: true
description: We meet in the middle of the day in the middle of the week to chat about Python. This week we have Martin Borus - volunteer in EuroPython with us.
tags: Python, watercooler, EuroPython , talkshow
---
PyChat:

  [We need you! Data Science workshop at PyCon Africa needs mentors](https://twitter.com/cheukting_ho/status/1288036498764333056)

  [PyData Global CfP deadline is 2nd August !!!](https://global.pydata.org//pages/cfp.html)

  [Pytest 6 is out now](https://twitter.com/nicoddemus/status/1288203623353266177)

  [Hacktoberfest Website is already out ?!](https://hacktoberfest.digitalocean.com/)

  [PyBerlin tonight](https://www.meetup.com/PyBerlin/events/271482013/)

  [PyData Cambridge - 20th Meetup happening tonight!](https://www.meetup.com/PyData-Cambridge-Meetup/events/271836696/)

Mid Meet - Hall of Fame:

  Matin Borus - Pythonista, Volunteer of EuroPython
  Follow Martin on [Twitter](https://twitter.com/mborus)

PyPI highlights:

  [PhotoCollage](https://github.com/adrienverge/PhotoCollage) [made this](https://pypi.org/project/photocollage/)
  [Authlib](https://github.com/lepture/authlib)

[Listen to MidMeetPy podcast](https://anchor.fm/midmeetpy)
Python Slots to the Rescue
Tags: python, objectoriented, memory, classes
Published: 2020-07-30 16:09:37

Not too long ago I discovered that Python implements the slots pattern. They allow you limit the attributes that a class can have after instantiating it. 

The code below works, but it may give raise to un-intended behavior:

```python
class Camera:
    exposure = '1ms'
    
cam = Camera()
cam.exposure_time = '10ms'
```

Since Python allows creating attributes of classes at runtime, the user of our ``Camera`` class may, inadvertely, use a wrong name and never realize of the mistake. There are many ways of avoiding this problem, but today I'll discuss about ``slots``. We can change our class:

```python
class Camera:
    __slots__ = ['exposure', ]
    exposure = '1ms'
```

If we repeat what we did earlier, we will now get an error:

```python
>>> cam = Camera()
>>> cam.exposure_time = '10ms'
...
AttributeError: 'Camera' object has no attribute 'exposure_time'
```

Which, I believe is a very descriptive error. 

Using ``slots`` has also the advantage of reducing the memory footprint of our objects. If we are going to create millions of camera objects at the same time (thinking about a server handling requests, for example), it may be smart to optimize the attribute declaration. 

Did you know about slots? Have you ever had to use them in your code?
I started a digital garden and so should you
Tags: writing
Published: 2020-07-30 16:00:00

A month ago I decided to start a digital garden, which is, in a way, an evolution to plain note-taking. The core idea is that you write down your thoughts and create links between the notes. Each note is then a seed that can sprout and create new insight, new knowledge. Generally speaking I liked the idea, but what really made me take the plunge was that it was the approach I was looking for to lower my barrier at pushing content online. 

Over the years I have started, growth, and abandoned many blogs. A problem I always had (and didn't realize) was that blogs force a certain structure and quality for each article. Therefore, if I wanted to write about Python I created a blog for that. If I want to write about my vacation trips, I had a blog for that. But every time I wanted to put something online, I had to spend countless hours polishing the content. 

Then it enters into scene the idea of **Learning in Public**. If you and your readers agree that what they are looking at is work in progress, that mistakes, unfinished thoughts are allowed, then the self-imposed barrier for quality drops. 

For many developers I think this can be of great help. Instead of pushing themselves to write tutorials, and very extensive articles, a digital garden allows for code snippets, or half-baked ideas. Perhaps you don't cover all cases, or all applications, but it can still be a stepping stone for something bigger once connected to other thoughts. 

Even though I could have always taken notes, knowing that I am making them public gives me joy. That feeling helps me dedicate few minutes every morning, before starting my daily work duties to write down the ideas I have in my mind, the things I've read, the podcasts I've listened to. 

It is too early to tell if it will have any lasting impact on my learning process or my overall content generation flow. For sure I had fun [building it](https://github.com/aquilesC/static_website_builder) and I still have fun pushing content to it as often as I can. 

If you want to see it in action, head to [aquiles.me](https://www.aquiles.me)
Guia: Blog Engines para .NET
Tags: dotnet
Published: 2020-07-30 15:55:21

Nesse post, que será constantemente atualizado, vou enumerar engines de blog que eu encontrar na internet.

Quando já temos um site construído em ASP.NET, optar por uma engine de blogs nativa, ao invés de um Wordpress da vida, nos permite `reutilizar` a mesma estrutura de autenticação, mesmo banco de dados, mesmo `pipeline` de build e por aí vai.


## Qual o papel de um blog engine?  
1. Autenticação de usuários com níveis diferentes: editor, revisor, administrador etc
2. Permitir redação de posts
3. Lidar com a renderização
4. Incorporar preocupações com SEO

## Lista de Engines

> **Não** estão em ordem de melhor pra pior. Está em ordem de inserção somente.

### 1. DASBlog
Mesma engine utilizada no [Blog do Scott Hanselman](https://www.hanselman.com/blog/), que foi atualizada para .net CORE em 2019:

{% twitter 1096837328532721670 %}

Me chamou atenção a forma como eles usam Razor Pages para definição de templates. Muito bem integrado com a plataforma ASP.NET.

[ DASBlog - Link para download ](https://github.com/poppastring/dasblog-core)

### 2. PineBlog

Features:
* Markdown post editor
* File management
* Light-weight using Razor Pages
* SEO optimized
* Open Graph protocol
* Clean Architecture (youtube: Clean Architecture with ASP.NET Core)
* Entity Framework Core, SQL database
* Azure Blob Storage, for file storage
..only a blogging engine, nothing else..

[ PineBlog - Link para download ](https://github.com/ofpinewood/pineblog)
Simple Github Profile README
Tags: github, git, readme, productivity
Published: 2020-07-30 15:44:20

I was surfing around Youtube, a video caught my eye "Next Level GitHub Profile README (NEW) | How To Create An Amazing Profile ReadMe With GitHub Actions". Well, I watched that video did some research and after some tweaks, I created my [profile](http://github.com/coderj001). If you want to create a simple profile like me here are some links.
- [Youtube Link 1](https://youtu.be/ECuqb5Tv9qI)
- [Youtune Link 2](https://youtu.be/DOiGs2NiDbU)
- [GitHub Link 3](https://github.com/gautamkrishnar/blog-post-workflow)

To add your own touch, 

- If you don't know markdown syntax. Here is [link](https://www.markdownguide.org/cheat-sheet/) of the cheat sheet.

- Here is the [link](https://iconscout.com/icons) for cool svg icon.

- Here is the [link](https://www.webfx.com/tools/emoji-cheat-sheet/) of the emoji cheat sheet.

Hope this will help you. 
Usually, I don't write blog but I took new year resolution to start dev related blogs so this may be my first official blog. I'm still working on my content writing skill but I hope it will improve with time.
Hostman - Create & Deploy a React App in under 4 minutes (from scratch)
Tags: javascript, react, devops
Published: 2020-07-30 15:38:18

## Hostman

I stumbled across Hostman on Reddit and was quickly amazed with how fast it was to get going. I can honestly say that this was the first time I've deployed to to a Cloud Hosting app, before even having a password set up on that Cloud Hosting app. 

In the video below, I'll walk you through deploying a React App on Hostman in just a few minutes. From start to finish. We initialize the React App, make a GitHub repo and deploy all from scratch. 

Happy hacking!

{% youtube oLKzvxF1Qv4 %}
Accessibility will make you a better developer
Tags: a11y, html, ux, webdev
Published: 2020-07-30 15:27:07

In a perfect world web front ends would be built with accessibility front of mind but for a million reasons this is not always the case. In recent months I've worked across a couple of large projects retrofitting accessibility and I've learned a few things along the way. I wanted to share a few simple pointers that hopefully could lift our accessible side and generally make us better developers at the same time.

**Stop using classes for states**
A super common pattern, let's say you have a set of tabs on a page and you want to indicate when a tab is active, most likely you would programmatically add a class, say `is-active` and then use CSS to highlight the button in some way. This seems fine but assistive technologies don't read this, instead, use `aria-selected="true"` (or whatever aria attr is relevant) on the element. You can select these easily in your CSS or JS using [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and your page semantics are just better. As a rule of thumb, whenever you are adding a class for styling, consider if the class is telling the user anything, if it is there is a chance you can find an attribute that will tell a better story.

**Use the correct HTML element**
It seems obvious but sometimes it can be tempting to use less opinionated markup such as divs & spans instead of a button or whatever. There are many other examples of this where, as front end devs we strive for pixel-perfect replication of the designs and we stray from semantics. This is probably the most common accessibility issue and fixing it can be challenging, sometimes converting the elements to the "proper" tags can break things if JS or styling relies on a specific tag type. In these cases bloated unnecessary aria and tabindexes have to be sprinkled liberally over the page, it's messy and avoidable!

**Put stuff in the right order**
I most often see this when an element is absolutely positioned, for most purposes it doesn't matter if your little "X" to close a modal is at the start or end of the markup. When adding absolutely positioned tags just take a sec to think about where logically this should sit in the tab order.

**A little testing**
I know we have a lot to test for when building a feature or fixing a bug and I hate to add to your to do list so I'll keep it short. I would recommend using a screen reader to verify your feature, chromevox chrome extension if free and easy to set up to do a quick check, run an accessibility scanner such as axe (another chrome extension) to point out any technical errors and finally a common-sense check. It's a matter of minutes to check these things and you can head off 90% of issues before they happen.

Of course, there are plenty of other things that can be done but these were the main issues I've encountered. The more I work with A11y the more I want to encourage people to take it more seriously. I hope you find some use in this, I truly believe that following accessible standards will make you a better all-round developer
#100DaysOfCode | Day 6, 7
Tags: 100daysofcode, challenge, python, codenewbie
Published: 2020-07-30 15:21:31

▄█ █▀█ █▀█ █▀▄ ▄▀█ █▄█ █▀ █▀█ █▀▀ █▀▀ █▀█ █▀▄ █▀▀
░█ █▄█ █▄█ █▄▀ █▀█ ░█░ ▄█ █▄█ █▀░ █▄▄ █▄█ █▄▀ ██▄
Heyyyyy Everyone :)
I wanna share my feeling about Day6 and 7 of __#100DaysOfCode Challenge__.

From 2 days ago I was working on a challenge which is called __"Isogram"__!
That was one of the easiest problem that I've ever faced!
But not at first, hahah!
I don't know what was wrong with me, I was working on it and writing the dirties and most complicated codes!
Finally My friend [Amir](https://dev.to/amirdarx) helped me and gave me a light to solve that challenge !
He is so genious, that you can not believe, hahaha.
Thank you bro for helping me and motivating me in this great journey .
I'm gonna post __Isogram__ problem in my next post and show you two ways to solve that problem.
Hope you enjoy my posts and solutions!

Keep Moving Forward __ツ__

Code with __💛__

__🅑🅐🅝🅙🅘__
Block NSFW images using AI
Tags: machinelearning, webdev, opensource, productivity
Published: 2020-07-30 15:07:04

[**NSFW Filter**](https://www.github.com/navendu-pottekkat/nsfw-filter) is an open-source extension to block NSFW content from your browser.

You can download it from here: https://www.github.com/navendu-pottekkat/nsfw-filter

It uses state-of-the-art Machine Learning models to detect NSFW content to keep you safe.

Protect yourself at work and protect your kids at home from NSFW content with this awesome extension.

Contributions of any kind are welcome!
No Javascript Table with Pagination
Tags: css, html, design, showdev
Published: 2020-07-30 14:59:07

Pagination made entirely by CSS. There is no single Javascript code here.

I used the radio button hack, and HTML and CSS loop to implement the pagination.

To summarize the hack, I written the codes below:

Here is the HTML code

```HTML
<!--This is the radio button for hacking. They should not be visible-->
<input type="radio" name="btn_radio" id="trigger1" checked />
<!--This is the table which we show and hide. It must be direct sibling of the radio button-->
<table>
  <tr>
    <td>TABLE 1</td>
  </tr>
</table>
<input type="radio" name="btn_radio" id="trigger2" />
<table>
  <tr>
    <td>TABLE 2</td>
  </tr>
</table>
<label for="trigger1">Page 1</label>
<label for="trigger2">Page 2</label>
```

Here is the CSS code:

```CSS
input[type="radio"] {
  display: none;
}
table {
  display: none;
}
/* Plus sign is a selector for direct sibling element */
input[type="radio"]:checked + table {
  display: block;
}
```

Easy right? Just use your favorite HTML preprocessor, then you'll be able to populate the table, and the pagination links.

I also took advantage on ```position: sticky;``` CSS attribute, to have better view for layout.

If you compile the Pug source code into HTML,  you will see the repetitive, pagination Elements, and "Showing x to y of z items".

The buttons above aren't working. Though, I still could add modal dialog for "Add New Data" function. It is out of the scope of my current pen, so I didn't add it.

But if I am going to add, I have 2 methods to do so:

- First, is the ```target``` CSS pseudo-class. I just have to put an ID to a modal/dialog div ```<div id="my_modal"></div>``` in HTML. Then, I am going to set ```#my_modal { display: none; }``` to the modal dialog. Then, I am going to use the target pseudo-class like this ```#my_modal:target { display: block; }``` to show the dialog. To trigger it, I need a ```<a href="#my_modal">link</a>``` to trigger the effect.

- Second is the checkbox hack. It is just similar with this Pagination hack.

Here is the preview of the Pagination.

{% codepen https://codepen.io/takaneichinose/pen/QWyXjNP %}
Disable password checks on Laravel
Tags: laravel, auth, password, testing
Published: 2020-07-30 13:49:08

---
title: Disable password checks on Laravel
published: true
description: On local and testing environment, it might be a good idea to turn off password checking to facilitate reviews. Here's how!
tags: ['laravel','auth','password','testing']
//cover_image: https://direct_url_to_image.jpg
---

## Step 1 update your .env file

Add the following to `.env`
```
LOGIN_PASSWORD_CHECK=false
```

## Step 2 update your login controller

Change `App/Http/Controllers/Auth/LoginController::attemptLogin` to 
```PHP
protected function attemptLogin(Request $request)
{
    if (env('LOGIN_PASSWORD_CHECK', true) == false) {
        $this->guard()->login(
            User::whereEmail($request->input('email'))->firstOrFail()
        );
        return true;
    }

    return $this->guard()->attempt(
        $this->credentials($request),
        $request->filled('remember')
    );
}
```

## Step 3 done.

That's it. Now you can login with any password, it will accept it and log into the account designated by the email your provided in the login form.

---

**Bonus** if you're using Heroku, add this to your `app.json` to disable password check on review apps:

```JSON
{
    "env": {
        "APP_ENV": "review",
        "LOGIN_PASSWORD_CHECK": "false"
    }
}
```

---

Tell me what you thin in the comments and don't forget to leave a like!
Creating a button menu using HTML, CSS and JavaScript
Tags: javascript, webdev, beginners, tutorial
Published: 2020-07-30 14:30:46

You will be creating a button menu that has a hover state and also allows you to select a button when you click on it. The final project can be seen in this [Codepen](https://codepen.io/andrewbaisden/pen/BajgPKP).

## Step 1

Setup a project on your local computer and then open it in your code editor. In the root folder create files for `index.html` `styles.css` and `index.js`

## Step 2

Copy and paste the code into their corresponding files

`index.html`

```html
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Button Menu</title>
		<link rel="stylesheet" href="styles.css" />
	</head>
	<body>
		<main>
			<div class="menu">
				<button class="btn-menu selected">One</button>
				<button class="btn-menu">Two</button>
				<button class="btn-menu">Three</button>
				<button class="btn-menu">Four</button>
				<button class="btn-menu">Five</button>
			</div>
		</main>

		<script src="index.js"></script>
	</body>
</html>
```

`styles.css`

```css
@import url('https://fonts.googleapis.com/css2?family=Asap+Condensed:wght@400;700&display=swap');

:root {
    --main-bg: #EEEEEE;
    --menu-bg: #17C0EB;
    --menu-font-color: #FFFFFF;
    --menu-border: #25d3ff;
    --menu-bg-selected: #333333;
    --menu-bg-hover: #52dcff;
    --menu-bg-selected-chevron: #3cac1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

body {
    font-size: 1.6rem;
    font-family: 'Asap Condensed', sans-serif;
    background: var(--main-bg);
}

main {
    margin: 5rem auto;
}

.menu {
    margin: 0 auto;
    display: flex;
    flex-flow: column wrap;
    width: 80rem;
    max-width: 100%;
    border-radius: 2rem;
    background: var(--menu-bg);
}

.btn-menu {
    position: relative;
    cursor: pointer;
    background: var(--menu-bg);
    border: none;
    padding: 2rem;
    color: var(--menu-font-color);
    font-weight: 700;
    border-top: 0.1rem solid var(--menu-border);
    border-bottom: 0.1rem solid var(--menu-border);
    transition: background 1s;
}

.btn-menu:hover {
    background: var(--menu-bg-hover);
}

.btn-menu:focus {
    outline: none;
    box-shadow: none;
}

.selected {
    background: var(--menu-bg-selected);
}

.selected::before {
    position: absolute;
    left: 0;
    top: 0;
    content: "";
    background: var(--menu-bg-selected-chevron);
    height: 5.6rem;
    width: 0.5rem;
}
```

`index.js`

```javascript
const btnMenu = Array.from(document.querySelectorAll('.btn-menu'));

btnMenu.forEach((btns) => {
	btns.addEventListener('click', () => {
		btnMenu.forEach((btns) => {
			btns.classList.remove('selected');
		});
		btns.classList.add('selected');
	});
});
```

## Step 3

Open the `index.html` file in a web browser or if you are using Visual Studio Code you can use the Live Server extension to make it run on a server.