teleren/devto huggingface dataset:
How to clean up git branches in a sweep
Tags: git
Published: 2020-07-22 13:58:52

---
title: How to clean up git branches in a sweep
published: true
description: Delete many branches in console using a NPM tool
tags: #git
cover_image: https://i.imgur.com/gljXly0.png
---

You have been working a while and have created a lot branches. They are piling up. You forgot about them but they impede your productivity.
You want to push your branch but the autocomplete in terminal is stopping at the last character because it can't guess which branch you mean.

You have too much branches locally.

I have a simple trick to that allows you to delete many branches at once while selecting which one using the NPM project [ipt](https://www.npmjs.com/package/ipt)

First install it by doing 

```
npm i -g ipt
```
Now in the repo you want to delete branches do:

```
git branches|ipt -m|xargs -I{} git branch -d {}
``` 
or `-D {}` to force delete.

![console](https://i.imgur.com/j0a9lAs.png)

The above first list all the branches piping the list to ipt (with the select multiple option) then a list of the selected will be piped to xargs that will do a `git branch -d <branch>` which will delete each branch :tada:

Bonus: Using the git extension of ohmyzsh
```
gb|ipt -m|xargs -I{} git branch -d {}
```
sadly using aliases (gb) doesn't work with xargs.

Thats'all!
Slack Files EU Competition Complaint Against Microsoft
Tags: news, discuss, slack
Published: 2020-07-22 13:52:48

---
title: Slack Files EU Competition Complaint Against Microsoft
published: true
description: Slack files suit against Microsoft in the European Union, discuss this news here.
tags: news, discuss
//cover_image: https://direct_url_to_image.jpg
---

Per the Slack [announcement](https://slackhq.com/slack-files-eu-competition-complaint-against-microsoft):

> Microsoft has illegally tied its Teams product into its market-dominant Office productivity suite, force installing it for millions, blocking its removal, and hiding the true cost to enterprise customers.

Should be interesting to watch this unfold.  What are everyone's thoughts about this news?
The complete guide to CSS media queries
Tags: css, design, webdev
Published: 2020-07-22 13:41:35

Did you know there is a media query for [inverted colors](https://polypane.app/blog/the-complete-guide-to-css-media-queries/#inverted-colors)? Or one for [saving data](https://polypane.app/blog/the-complete-guide-to-css-media-queries/#prefers-reduced-data-no-support)?

Media queries are what make modern responsive design possible. 

With them you can set different styling based on things like a users screen size, device capabilities or user preferences. 

But how do they work, which ones are there and which ones should you use? 

I set out to write **the ultimate guide to media queries**, going over every little detail, like which media types there are, all the media queries you should use now, you will use in the future and the ones you should no longer use.

### Here's [the complete guide to CSS media queries](https://polypane.app/blog/the-complete-guide-to-css-media-queries/)

It's as much a reference as an opinionated description of how to best use them. It also has many clever tips, like this cheap dark mode that will get you a good looking site in just a few lines of code:

```css
@media (prefers-color-scheme: dark) {
  :root {
    background: #111;
    filter: invert(1) hue-rotate(180deg);
  }

  img,
  video {
    filter: invert(1) hue-rotate(180deg);
  }
}
```

If you wanna understand how it works, head on over to [the complete guide to CSS media queries](https://polypane.app/blog/the-complete-guide-to-css-media-queries/#implementing-a-dark-mode)
WordPress Security: Vulnerabilities And How To Improve Security
Tags: security, wordpress, testing
Published: 2020-07-22 13:33:03

All websites are not created equally. Any website can experience technical issues but with a WordPress website, you’re also leaving yourself exposed due to its vulnerable nature.

WordPress runs on open source code and has a team of dedicated engineers to identify and fix security issues that occur in the core source code. As soon as a security vulnerability is disclosed, a security patch is immediately pushed.

That’s why managing WordPress and keeping it updated to the latest version is incredibly essential to the overall security of your website.

## WordPress Security Vulnerabilities

If you maintain a WordPress-powered website or do consider using WordPress as your CMS, you should be concerned about the possible WordPress security issues. Here, I’ll outline several common WordPress security vulnerabilities:

* Unauthorized Logins

* Cross-Site Scripting

* SQL Injections

* File Inclusion Exploits

* Denial-of-Service Attacks

## What Makes A WordPress Website Vulnerable

Some of the main reasons that make a WordPress website vulnerable include:

* Weak passwords

* Not frequently updating plugins and themes

* Using plugins and themes from untrustworthy sources

* Using poor-quality or shared hosting

## How To Improve WordPress Website Security

You can keep your WordPress website secure and prevent data breach or loss by following certain security best practices. They are:

* Having a strong password policy so that users need to provide longer and more secure passwords

* Enabling two-factor authentication

* Frequently updating WordPress core, themes and plugins

* Implementing proper permissions for web server’s directory

* Scheduling vulnerability and malware scans on a regular basis

* Keeping a reliable and effective backup plan

* Activating brute force protection

*A more detailed blog is published at :* *https://beaglesecurity.com/blog/article/wordpress-security.html*
Is it okay to expose MongoDB ObjectIds?
Tags: security
Published: 2020-07-22 13:32:11

---
title: Is it okay to expose MongoDB ObjectIds?
published: true
description: Question about implications of exposing generated IDs
tags: security
---

I recently came across a situation where it would have been extremely simple and easy to expose the MongoDB ObjectId that is generated whenever an entry is created. I ultimately chose to generate a GUID and use that as a reference instead. Are there any obvious concerns with exposing an ObjectId to users of an application or API?
[ANN] Our fifth keynote speaker
Tags: europython, news
Published: 2020-07-22 13:04:59

We are very happy to announce our fifth keynote speaker: Jessica McKellar. She will be talking about "**Python in Prison**".

# Jessica McKellar
## Python in Prison: how open source can change a criminal justice system

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

The United States has the highest incarceration rate in the world, with over 2.2 million people behind bars in our prisons, jails, juvenile facilities, and detention centers.

The system is racist and ineffective, but how do we change something so big and so economically entrenched, especially as software engineers?

Let’s look at how Python classes in US prisons are transforming rehabilitation and re-entry, and talk about what we can do as individuals and as an open source community to dismantle an unjust system.

### About Jessica McKellar

Jessica McKellar is a founder and the CTO of Pilot, a bookkeeping firm powered by software. Previously, she was a founder and the VP of Engineering for a real-time collaboration startup acquired by Dropbox, where she then served as a Director of Engineering. Before that, she was a computer nerd at MIT who joined her friends at Ksplice, a company building a service for rebootless kernel updates on Linux that was acquired by Oracle.

Jessica is a former Director for the Python Software Foundation and PyCon North America's Diversity Outreach Chair. For her outreach efforts in the Python community, she was awarded the O'Reilly Open Source Award.

Open source meets criminal justice reform in Jessica’s work with The Last Mile, a job training and re-entry program that has implemented the first computer programming curriculum inside US prisons. She teaches Python at San Quentin State Prison in California, hires formerly incarcerated software engineers, and uses that bridge between the tech industry and prisons to get people activated and acting for decarceration.

##### You can find the full list of the keynote line up at https://ep2020.europython.eu/events/keynotes
Easily Create StockCharts for your Dashboards using CanvasJS
Tags: canvasjs, javascript, stockchart
Published: 2020-07-22 12:29:50

## ‘A picture is worth of thousand words; a chart is worth of thousand sets of data’

Data visualization has now risen to ubiquity in the realms of Business Intelligence and data journalism. All those infographics you see? Data visualization in action. Charts are usually used to analyze trends and patterns in data sets. Let's say you have been recording the sales figures in Excel for the past three years. Using charts, you can easily tell which year had the most sales and which year had the least. You can also draw charts to compare set targets against actual achievements.
![CanvasJS JavaScript StockCharts](https://dev-to-uploads.s3.amazonaws.com/i/s0fbyvnc7az81bduq42h.jpeg)

While charts are used for analysis, few advanced features are required for stock data analysis – generally called as StockChart. This article briefs about how to create StockChart & customize it to match it with website theme.
### Why to Choose CanvasJS StockCharts?
- Elegant Themes & Colors.
- Smooth Animations.
- Navigator, Slider.
- Range Selector.
- Multiple Charts (Panels / Panes) within a StockChart.
- Auto sync of tooltip & crosshair across multiple charts.
- Supports all major browsers including Chrome, Firefox, Safari, Opera, Edge, IE8+
- Runs smoothly across devices including iPhone, iPad, Desktop, Android Phones, etc.
- Easy customization options to match themes, colors & fonts of StockChart with Website.

### How to Create StockChart?
1. Download CanvasJS StockChart from [their website](https://canvasjs.com/download-html5-charting-graphing-library/?f=stockchart-beta).
2. Include canvasjs.stock.min.js in your dashboard.
3. Create StockChart, add dataPoints & render it.
```
var dataPoints = [];
var stockChartOptions = {
  charts: [{
    data: [{
      type: "spline",
      dataPoints: dataPoints
    }]
  }]
};
var stockChart = new CanvasJS.StockChart("stockChartContainer", stockChartOptions);

//Reading data from JSON
$.getJSON("https://api.npoint.io/5ac670dd66db71dffa1f", function(data) {  
  for(var i = 0; i < data.length; i++){
    dataPoints.push({x: new Date(data[i].date), y: Number(data[i].close)});
  }
  stockChart.render();
});
```

Checkout live example @ [StackBlitz](https://stackblitz.com/edit/canvasjs-javascript-stockchart).

### Customizing StockChart
CanvasJS provides options to change the colors of data, title, labels and all other elements along with customizing font properties like font-family, font-size, font-color, font-weight. These customization options help in making StockChart match with dashboard font and color properties. Refer to [their documentation](https://canvasjs.com/docs/stockcharts/basics-of-creating-html5-stockchart/) for complete list of customization options available.

You can further have multiple charts (charts – as termed by the library which developers generally call as panels or panes) and synchronizes tooltip & crosshair across them automatically. Checkout [this page](https://canvasjs.com/javascript-stockcharts/stockchart-price-volume/) for demo.
How we get Dumbed-down
Published: 2020-07-22 12:29:03

**Dumbed-Down, how it happens**

If we work for IT shops with 50-200 or more people, we find that teams specialize in certain parts of the operation.  In particular we see Network Admins, DevOps people, Security Teams, Project Management Teams and finally the Development Teams which should include QA Team members.

Unfortunately for us, this type of corporate structure can [easily dumb us down](https://en.wikipedia.org/wiki/Dumbing_down). For example, if we never had to deal with a Network issue, we have no experience there.  If we never worked in Devops we don't have a clue as to what a pipeline is about.

For this reason we need to be on guard for what we can put on our resume every 6 months.  If we are not adding anything that's relevant to the market we are setting ourselves up for the narrowing of our skills until one day they are not longer relevant. 

**How to avoid the dumb-down effect**

We should be able to add new things to our resume every 6 months that are in-line with current market skills requirements. 

**Back up plan**

If this happens to you then don't fear as there is always a [good backup plan](https://www.google.com/search?q=walmart+greeter).
Python: did you know (tip 1)
Tags: python, datascience
Published: 2020-07-22 12:19:24

Did yoy know
By default, "max" function returns the largest of its provided arguments. But if we provide an optional "key" argument, it returns the argument x that maximizes key(x) (aka the 'argmax').

For example if the requirement is to find the a number which gives the largest remainder when divided by 5 or which has larger x % 5, we do it using the "max" function.

def mod_5(x):
    """Return the remainder of x after dividing by 5"""
    return x % 5

max(100, 51, 14, key=mod_5)

Output:
14
Wednesday Links - Edition 2020-07-22
Tags: java, junit, spring, json
Published: 2020-07-22 12:13:14

Dynamic Proxies in Java Mini-Book ( 1 min read ) 📖
https://www.infoq.com/minibooks/java-dynamic-proxies

On Generating Identity Hash Codes ( 6 min read ) #️⃣
https://alidg.me/blog/2020/7/15/hash-code

JEP draft: Identity Warnings for Inline Class Candidates ( 3 min read ) 🆔
https://openjdk.java.net/jeps/8249100

Serializable Records ( 5 min read ) ⏺️
https://inside.java/2020/07/20/serializablerecords/

Five JUnit 5 features you might not know yet ( 6 min read ) 💭
https://rieckpil.de/five-junit-5-features-you-might-not-know-yet/

Validating and documenting JSON with JSON Schema ( 40 sec read ) ☑️
https://www.mscharhag.com/api-design/json-schema

Reactive Spring and Spring Tips ( 1 min read ) ☢️
https://springonetour.io/2020/reactive
Secret Repo in GIT Hub
Tags: github
Published: 2020-07-22 12:12:01

Found something very Interesting today about the GitHub.

In GitHub you can create a Repo with your username and this is the Repo content would be the homepage and You can write for example some details about yourself in the .md file and this would be highlighted on the Github home page.

Just Enter the name of your GitHub User.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0a8lcchg2lrhl989w2a0.PNG)

Update and write something in your Readme.md file in the Repo and You have the new GitHub Landing page which shows this Read.md file content.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nrqakgkartksklndeynl.PNG)

Try yourself and Enjoy :)
Création site ecommerce 
Published: 2020-07-22 12:00:45

- Choisissez la meilleure plateforme de creation des sites internet ecommerce et tout ce qui est boutiques en ligne par excellence
- Storeino est la plateforme marocaine de creation des sites e-commerce et boutique en ligne, sites commercials, marchands, sites professionnels... 

https://storeino.com
Daily Developer Jokes - Wednesday, Jul 22, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-07-22 12:00:08

---
title: "Daily Developer Jokes - Wednesday, Jul 22, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Jul%2022%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258a63bab5.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What did the array say after it was extended?

___A:___ Stop objectifying me.
 -->
Published a new video with the process of creating headphones for the game.
Tags: gamedev, indiedev, tutorial, game
Published: 2020-07-22 11:58:25

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

👉👉👉 https://youtu.be/6L_bkQcwk2E

Follow the dev:
https://store.steampowered.com/app/1213020/PAPER_TANKS/
https://twitter.com/PAPERTANKS2
NPM vs Yarn: which package manager do you use?
Tags: webdev, discuss, productivity
Published: 2020-07-22 11:56:02

---
title: NPM vs Yarn: which package manager do you use?
published: true
description: 
tags: webdev, discuss, productivity
//cover_image: https://direct_url_to_image.jpg
---
Two popular package managers in the ecosystem are NPM (Node package manager) and Yarn (package manager created by Facebook).

Which one do you use and why do you prefer it over the other?
Deadlock e Livelock
Tags: ptbr
Published: 2020-07-22 11:40:34

## Deadlock

É quando um (se esse processo utiliza threads) ou mais processos esperam a liberação de um recurso para prosseguir, mas esse recurso nunca é liberado, pois o processo/thread A depende de um recurso que deve ser liberado pelo processo/thread B, e o processo/thread B depende de um recurso que deve ser liberado pelo processo/thread A.

![Deadlock](https://dev-to-uploads.s3.amazonaws.com/i/ipuatrdwlhnbx5sxnhbu.png)

![Real Deadlock](https://dev-to-uploads.s3.amazonaws.com/i/t42biufqfwfnnru6rve2.jpg)

## Livelock
Quando o estado de dois processos mudam constantemente, mas ao mudar os estados ambos os processos continuam se bloqueando.

Um exemplo real de livelock ocorre quando duas pessoas se encontram em um corredor estreito, e cada uma tenta ser educada movendo-se para o lado para deixar o outro passar, mas elas acabam balançando de um lado para o outro sem progredir, porque ambas se movem repetidamente da mesma maneira ao mesmo tempo.

* https://en.wikipedia.org/wiki/Deadlock
* https://pt.stackoverflow.com/questions/421381/o-que-%C3%A9-livelock
AzureFunBytes Episode 7 - Linux Storage with @otterbook Reminder - 2PM EDT Thursday 7/23/2020
Tags: azure, beginners, linux
Published: 2020-07-22 11:17:20

New #AzureFunBytes - Azure Linux VM Storage!


Check out this week's stream on 7/23/2020 at 2PM EDT [@otterbook](https://twitter.com/otterbook) will help me solve three problems on twitch!

*  How can I move a disk from one VM to another?
*  How can I extend a disk size on a Linux Server?
*  What's a good strategy for storing massive amounts of unstructured data?

David and I will discuss his tenure in technology with me and even answer some questions.


![AzureFunBytes logo](https://res.cloudinary.com/practicaldev/image/fetch/s--pxlTjTrD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/699md0mmakw0cbutamyq.jpg)


---


AzureFunBytes! - Byte-sized content with a live Twitch show! 

Learn about Azure fundamentals with me!

Live stream is available on Twitch at 2 pm EDT Thursday. You can also find the recordings there as well.

https://twitch.tv/azurefunbytes
https://twitter.com/azurefunbytes

Join me, ask questions and learn about Azure!

Microsoft Learn: [Azure Fundamentals](https://cda.ms/1jV)
Microsoft Azure: [$200 Free Credit](https://azure.microsoft.com/free/?WT.mc_id=blog-devto-jagord)
AWS Certified Cloud Practitioner Practice (CLF-P01)
Tags: aws, certification
Published: 2020-07-22 11:04:41

I've just passed my AWS Certified Cloud Practitioner Practice (CLF-P01) exam and thought I'd share some findings.

## Free resources
* [freecodecamp course](https://www.freecodecamp.org/news/aws-certified-cloud-practitioner-training-2019-free-video-course/)
* [AWS own content](https://www.aws.training/)

## Paid resources
There was an offer such that [Stephane Maarek's Udemy Course](https://www.udemy.com/share/103a09AkIfc1dbRXg=/) was free and that's good too but you'll probably need to pay for it but try the free resources first and see how you feel.

There are practice exams for $20 (excl tax) from AWS but that's pretty much the cost of Stephane's course.

## The exam
* Due to Covid-19 and the convenience of it, i did my exam using Pearson Vue's online system which you register for by using [this](https://www.aws.training/). 
* It was $100 (excl tax) and you can choose from lots of time slots. 
* You get 100 minutes for the exam.
* You have to install something on your machine which is where you do the exam and your machine must have a webcam and microphone
* You can start the check-in process 30 minutes before the exam start and this is where you provide pictures of your room and government id (e.g. passport). After you have checked in, if there is more than 5 minutes before the exam, do not hit the next button (you'll know what i mean) as you will have effectively started the exam conditions.
* Eventually, a few minutes before your exam start time, an invigilator/proctor will use online chat, having access to your webcam to check a few things around your desk. You will need to clear all sorts of things such as stationary, drinks, food so they are all out of reach. 
* Yes you cannot eat or drink during the exam and cannot leave your chair. 
* They watch you during the entire exam. I was picked up (by a second invigilator) that I was looking away from the screen - but I was trying to think about an answer. I understand where they are coming from though.

Good Luck.