teleren/devto huggingface dataset:
Docker Hub : Millions of images will be removed. Open Source teams to mostly hit.
Tags: docker, devops, opensource, news
Published: 2020-08-31 21:13:09

**Docker has recently intimated about its latest policy changes for images in the  docker hub. But before we address policy reform, we should consider contribution of HUB in making docker, as  most widely used container technology**

1) The journey of Docker and Docker Hub is very different. By using other container technologies- OCI members: you can pull and push images to Docker Hub.
For example:
(a) Docker and Podman are two different technologies but you can use docker Hub with both. You can read more here:
{% link https://dev.to/manishfoodtechs/rootless-docker-kick-docker-hackers-and-make-docker-more-secure-new-concept-70g %}

(b) This means that the docker hub has several images hosted which do not actually pushed from the use of docker container technology but any other like Podman.

(2) Open Source projects used docker with one reason that images will be available on its hub. 

But they will also lose images due to a new policy update. 

(3) One reason why Docker was popular among young developers is that they have free image hosting.

**These are new policy changes by docker.** (as received on date of article)

The first policy update is regarding retention of inactive images. Inactive images are defined as images that have not been pulled or pushed in 6 months. Starting November 1, 2020:

Free accounts may retain inactive images for up to 6 months
Pro and Team subscriptions may retain inactive images indefinitely

The second policy update is regarding limits on the number of image pulls. A pull is defined as up to two GET requests to the registry URL path ‘/v2/*/manifests/*’. Again, starting November 1, 2020:

Anonymous users will have an upper limit of 100 image pulls in a six hour period
Accounts authenticated with a DockerID will have an upper limit of 200 image pulls in a six hour period
Pro and Team subscriptions do not have limits.


I hope you people like the above article and learned something.
######***IMP REQUEST:***
###### You are most welcome to join my team [ form for joining ](https://forms.gle/pSCALuEWHus3pg9F6).
###### *Also you are most welcome to join OPEN SOURCE INTELLIGENT SYSTEM (OSINT)if you can help in open source project regarding safeguarding humans from various diseases like CORONA outbreak*
######https://github.com/Manishfoodtechs/OSINTHRH/wiki
Crossposting
Tags: help, discuss
Published: 2020-08-31 21:11:05

I'm curious what everyone's thought is on this topic.  

I've heard in the past that cross posting content on different site is a horrible idea for SEO traffic.  I find that most of my content will likely get more visibility by just being on dev.to or similar websites that have a natural audience for the content I create.

What does everyone think? Is it still a bad idea to post on 2-3 different places? Any recommended tools / platform?

Personally I love the dev.to community but also looking at:

 - Medium
 - SteemIt (or Hive)

What are some cool techie platforms for nerdy blogs that you're all familiar with?
2 Free Business Plan Templates for Developers
Tags: startup
Published: 2020-08-31 21:07:21

Below are 2 business plan templates to help you if you are starting a new company/project.

Ecommerce Business Plan Template - https://www.growthink.com/businessplan/help-center/ecommerce-business-plan

Mobile App Business Plan Template - https://www.growthink.com/businessplan/help-center/mobile-app-business-plan

Hope this helps!
Day 92 : #100DaysofCode - Created a JS Tip Calculator in JS
Published: 2020-08-31 20:34:18

Check it out on my Github repo :) 

{% github SincerelyBrittany/tip-calculator-js %}

Below are a few things that I learned while building this calculator:

<h4> e.preventDefault() </h4>

I learned, the importance of ``e.preventDefault()`` when you are in development and using javascript.

While building my calculator, I would input a number and the page would immediately refresh. I could not figure out why until I reviewed some of the notes I took in the past about ``e.preventDefault()``

<a href="https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault"> The Event interface's preventDefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be. The event continues to propagate as usual, unless one of its event listeners calls stopPropagation() or stopImmediatePropagation(), either of which terminates propagation at once.</a>

How I interpret the above is that JS has default settings for event listeners and ``e.preventDefault()`` stops the default settings from from taken place unless it is called upon. I could be wrong, but all I know is that it stopped my page from constantly refreshing when I needed to handle my click event. 

<h4> Changing Inputted Value from String to Integer </h4>

I also learned an easy way to convert a string to an integer:

```
    let checkAmount = document.getElementById('check-amount').value;
```

Above ``document.getElementById('check-amount').value`` returns a string value that the user inputs. However, I was building a tip calculator meaning I had to make calculations and I can not do that with a string. So to convert the value, I learned that all I had to do was put a ``+`` in front of the value and it would convert it for me. 

```
    let checkAmount = +document.getElementById('check-amount').value;
```

<h4> isNaN function </h4>

Lastly, error catch! I learned how to use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN"> ``isNaN`` </a> function to stop check if a value is NaN or not. 

```
    if (isNaN(checkAmount)){
        displayResults("Error, please enter a number");
        return;
    }
```

Song of the day: I have always been obsessed with brasstracks! Give them a listen 💕

{% youtube vl5C8o7MEWo %}

Sincerely, 
Brittany
How I built a URL to image generator over the weekend
Tags: webdev, rails, ruby, design
Published: 2020-08-31 20:32:03

I've grown really tired of manually creating social images for every single blog post. They take way too long to create and online tools always end up looking too generic. How many stock photos can I scroll through before they all start to look the same?

So I built [Mugshot Bot](https://www.mugshotbot.com). An automated, zero effort social image generator. You pass it a URL and it generates a perfectly sized, unique, beautiful social image.

Here's what they look like! The color and background pattern are randomized from a hand-tuned selection. The title and subtitle come directly from the HTML.

![Example Mugshot Bot image](https://www.mugshotbot.com/m?url=https://masilotti.com/great-two-player-board-games/)

## Overall approach

My goal is to design in HTML and CSS and then convert it to a PNG. This worked pretty well with some `wkhtmlto*` magic but there were a few hoops I had to jump through. Here's what I did.

### Fetch the content

All of the content comes directly from the URL's HTML. So the first step is to fetch the website and parse the DOM. I'm using `HTTParty` and `Nokogiri` and then looking for specific markup.

```ruby
body = HTTParty.get(@url).body
html = Nokogiri.parse(body)
title = html.at_css("meta[property='og:title']")
  .attr("content")
description = html.at_css("meta[property='og:description']")
  .attr("content")
```

### Render and style the HTML

Now that we have the copy we can drop it into some HTML. In Rails we can render an arbitrary view and pass in some variables via `ApplicationController#render`.

```ruby
mugshot = Mugshot.new(title: title, description: description)
rendered_html = ApplicationController.render(
  "mugshots/show",
  assigns: { title: title, description: description },
  formats: [:html],
)
```

The rendered HTML uses the default layout so we have all of the CSS and fonts normally added in `<head>`.

## Convert to an image

Where the magic happens: `wkhtmlto*`. Or, as it is usually known, `wkhtmltopdf`. This library is bundled with a lesser known tool `wkhtmltoimage` that does exactly what we need.

If you have the library installed you can call directly into it with `Open3`. This works a bit better than backticks because you can handle stderr.

```ruby
result, error = Open3.capture3(
  "wkhtmltoimage jpeg - -",
  stdin_data: rendered_html
)
```

The two dashes (`- -`) at the end of the command tell the tool to render _from_ stdin and render _to_ stdout. `Open3` will write stdout to `result` and `stderr` to `error`.

## Render from the controller

`result` is the actual image, as data. We can render this directly from the controller. Ideally, this would be uploaded to S3 and/or put behind a CDN.

```ruby
def show
  # ...
  send_data(result, type: "image/jpeg", disposition: "inline")
end
```

## What a weekend!

Thanks for reading, I hope you enjoyed how I built a little side project over the weekend.

If you give [Mugshot Bot](https://www.mugshotbot.com) a try please let me know what you think in the comments! I'm open to feature requests, too.
Something nice is coming with reactjs (graphql impressed me)
Tags: react, node, graphql
Published: 2020-08-31 20:27:45

From tomorrow i will start making reactjs based client side for my recently built graphql backend.

please keep following for the code and explanation.
till then you can check the code for github for backend.

[backend graphql code](https://github.com/Meenachinmay/react-graphql)

[previous post related to this](https://dev.to/meenachinmay/here-is-what-you-need-as-a-backend-from-graphql-and-nodejs-with-mongodb-with-jwt-auth-432i)
Logging with Loki using Docker
Tags: devops, docker, linux, logging
Published: 2020-08-31 20:25:34

Logging with Loki is awesome! 

I’ve been using Grafana for metrics for quite some time, and having logs natively in Grafana was always the missing point.

And then grafana released Loki, which is like prometheus, but for logs. And that was just super, exactly what I was looking for. 

For my use case, I was looking for something that can be consumed by grafana as a presentation layer, central based so I can push all sorts of logs, and want a easy way to grep for logs and a bonus would be to have a cli tool.

You can view my [full detailed blogpost on this](https://blog.ruanbekker.com/blog/2020/08/13/getting-started-on-logging-with-loki-using-docker/) how I provision Grafana, Loki and Nginx with Docker and then we take a demo through the stack to view your docker logs inside Grafana.

Let me know what you think.
Google Summer of Code. How I did it, and how you can do it too!
Tags: git, github, gsoc, google
Published: 2020-08-31 19:41:00

I keep getting DMs on LinkedIn, Twitter, Instagram about how to start with Google Summer of Code(GSoC), when do I start contributing, how to select an organisation as so on. After answering so many of them I decided to write this blog answering almost everything that you need to know.
Even if you are a newbie and haven’t heard about GSoC, this is something that might interest you!

This blog consists of an intro to GSoC, my two years GSoC experience and step by step guide of how you can possibly get selected!
Plus there are some extra tips too.

I know there are a lot of articles/blogs on GSoC and you might be wondering what’s so special about this one? Well, this blog not only talks about how to approach as a student but also a perspective of how a mentor sees you as an applicant and what are their expectations.
I was selected for GSoC 2019 and I am currently a mentor for GSoC 2020. I had a lot of false perceptions about the selection when I was an intern but it all changed when I mentored for the year 2020.

Check out my Blog on Medium - https://medium.com/@abhinandan0659/google-summer-of-code-how-i-did-it-and-how-you-can-do-it-too-22e51201a1e0?source=friends_link&sk=8d198b3a537d3a4411b55ad3ce0ba94f
Here is what you need as a backend from 'graphql and nodejs with mongodb'(with JWT auth)
Tags: graphql, node, mongodb, react
Published: 2020-08-31 20:24:12

hey, everyone!!! お久しぶりです。😎
i am writing after a long time, from now you will see some japanese also in my blogs. 
well today i am giving you a very simple but strongly built backend with graphql, nodejs, express and mongodb.

i made a boilerplate so you can use it. the features i have added are following.

__1. Create, read, delete a post with body, likes and comments.__
__2. store and delete comments__
__3. like and unlike a post__
__4. there is complete validation for user input__
__5. like duplicate email validation, duplicate__
     __username validation__
__6. empty fields validation__
__7. a complete JWT authentication and authorization__
__8. a complete protected routes__
__9. likes and commetns counts too.__

please have a look at code i am providing github link.
clone it use it make it more useable and if you have any thing new please let me know.

i will add some more things more precise validation and update feature for __post and comments__.
[clone me from  github and please don't forget to leave star](https://github.com/Meenachinmay/react-graphql)

ご覧いただきありがとうございます。🙌
またね。see you again✌😎
Day 91 : #100DaysofCode - Made a POST and PATCH request using FETCH
Published: 2020-08-31 20:16:24

I did not feel like writing my blog post yesterday but I did code! I made a POST and Patch request using FETCH. How did I do it? Well, I followed the lab provided by my bootcamp. 

First I made a GET request to get all of the items in my database and append them to the page:

```
function getAllToys(){
  return fetch("http://localhost:3000/toys")
  .then(function(response) {
     return response.json();
   })
   .then(function(object) {
    //  console.log(object);
     const characters = object
     characters.forEach(character =>{ 
      const collection = document.querySelector('#toy-collection')  
      // console.log(character)
      let div = document.createElement('div');
      div.className = "card"
      div.innerHTML = `<h2>${character.name}</h2><br>
      <img src=${character.image} class="toy-avatar" /><br><p>Likes: ${character.likes}</p><button class="like-btn">Like <3</button><br>`
      // console.log(collection, "this is collection")
      collection.appendChild(div)
    //  div.append(object.name)
     }) 
    //  document.body.innerHTML = object.id
    like()
   })

```

I called the getAllToys() function when the DOMContentLoaded:

```
document.addEventListener("DOMContentLoaded", () => {
  getAllToys();
}
```

Then I wanted to be able to add to my database so I created form and added an event listener to the form that would use the input given in the form and use it in a function that I named ``submitData``. 

```
  const form = document.querySelector("form.add-toy-form");
  form.addEventListener("submit", (e) => {
    event.preventDefault()
    let input = document.querySelector('input.input-text')
    let image = document.querySelector('input.input-text-image')
    submitData(input.value, image.value)

  });
```

The ``submitData`` function takes two arguments, which is the name and image that the user inputted into the form. Then I created a variable named ``configObj`` for the post request that must be passed into the fetch request.  

```
function submitData(name, image){

  let formData = {
      name: name,
      image: image,
    };

  let configObj = {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            "Accept": "application/json"
          },
          body: JSON.stringify(formData)
        };
         
       return fetch("http://localhost:3000/toys", configObj)
       .then(function(response) {
          return response.json();
        })
        .then(function(object) {
          console.log(object);
          getAllToys(object)
        })
        .catch(function(error) {
          console.log(error.message);
        });

}
```

Then I made the post request and if there are any errors, I console.log the error message. 

For a better understanding on making POST request using fetch, feel free to checkout this youtube video:

{% youtube Kw5tC5nQMRY %}

As always, thanks for reading!

Sincerely, 
Brittany
Creating a Django Project... steps? Is this right? 
Tags: django, help, python, html
Published: 2020-08-31 20:12:58

1)create a App, (setup)
2)register it in Setting,(setup)
3) create a Module (APP)
4) add to Admin (APP)
5) create a “VIEW”(APP) 
6) create apps.py to define for config? (APP) 

Between the needed “setup” is there basically 3-4 steps for adding a App/Object to your site? 

I’m getting the hang of it now, 
Is that right? 

I made another class Test(): and it was really only 2 steps to have it show.

Is that right?
I was lost...でも、ただいまー
Tags: healthydebate
Published: 2020-08-31 20:11:51

To the everyone who followed me here and on github too...
i am really sorry for not posting anything since almost two weeks. i was sick and i was not doing well enough, was busy with my japanese language studies (still i am). but from now i will try to upload regularly. and i am sorry too for stopping my dev.to ui clone series. i will start that again from tomorrow.

good luck to everyone...!!!

SORRY!!!
Copying files to clipboard without dark magic
Tags: showdev, go, programming, linux
Published: 2020-08-31 20:11:25

I've been using Linux and, more importantly, the command line for about five years now (ever since I got into Computer Science school). It's great, really. I love the command line with all my heart: it's simple, direct and fast. But there's some things you just can't do as in a GUI.

## One negligible, annoying problem
Lately, I've been particularly busy doing networking stuff like copying (public) SSH keys from one machine and pasting them to the `authorized_keys` file of another.

If you're not very familiar with `SSH` or keys in general, don't worry, just picture a directory like this on my local machine:
```
.ssh
├── config
├── id_rsa
├── id_rsa.pub
└── known_hosts
```

And another one on a remote machine like this:
```
.ssh
├── authorized_keys
└── known_hosts
```

What I want to do is copy the contents of `id_rsa.pub` and append them to `authorized_keys` on the remote machine.

## The solutions you don't want but will end up going for

1. `cat id_rsa.pub`. Select the contents using a mouse (when you can). `Ctrl+Shift+C` (to copy). Go to the remote machine. `vim authorized_keys`. `Ctrl+Shift+V`. Paste.

2. `scp id_rsa.pub remote_host_ip:/home/your_user/.ssh/mykey.pub` (copy the `id_rsa.pub` file to the remote machine). Go to the remote machine. `cat mykey.pub >> authorized_keys` (append the contents of the recently-copied `mykey.pub` file to `authorized_keys`). `rm mykey.pub`.

3. You use `xclip`. The clipboard command-line interface for the X desktop environment. It does exactly what you want, only that's completely cryptic and, like `tar`, you'll never really remember that goddamn command and you'll have to [google it](https://unix.stackexchange.com/questions/22494/copy-file-to-xclip-and-paste-to-firefox) every. single. time. For the sake of completeness here's one of the ways of doing this: 

```
xclip -sel clip < ~/path/to/file.txt
```

What would you expect from `xclip` instead? Probably something like *this*:
```
xclip /path/ti/file.txt
```

Oh gee, I wonder if anyone ever make something like tha-

## The solution you really want
{% github gmelodie/xcreep no-readme %}

With `xcreep` you can simply 
```
xcreep /path/to/file.txt
``` 

And boom! It's on your clipboard. 


Stupid right? I thought so too, and I've been using it daily for the past three months now. It's by far the most useful piece of code I've ever written.

Don't want to install a Go script? There's also a [shell script](https://gist.github.com/gmelodie/0830c03eee0addb44073cc93dc02dd94) for it!
How to install IBM Plex on macOS
Tags: mac, ibmplex, fonts, intellij
Published: 2020-08-31 20:01:33

---
title: How to install IBM Plex on macOS
published: true
description: 
tags: mac, ibmplex, fonts, intellij
//cover_image: https://direct_url_to_image.jpg
---

Open terminal and run

```
brew tap homebrew/cask-fonts
brew install font-ibm-plex --cask
```

That's it! :)

## IntelliJ-based IDE

When you have font installed, go to 
```
Preferences/Settings -> Editor -> Font
```
Choose "font" and type "IBM Plex Mono".

![IntelliJ settings: Font section](https://dev-to-uploads.s3.amazonaws.com/i/t4b2femwyqhzsq7m9gx9.png)
Implement a type-safe version of Node's Promisify in 7 lines of TypeScript
Tags: typescript, node, javascript
Published: 2020-08-31 19:54:25

---
title: Implement a type-safe version of Node's Promisify in 7 lines of TypeScript
published: true
description: I wanted to quickly showcase how to leverage the power of types in TypeScript to get a typesafe version of Node's util.promisify.
tags: typescript, node, javascript
---

```typescript
type Callback<A> = (args: A) => void;

const promisify = <T, A>(fn: (args: T, cb: Callback<A>) => void): ((args: T) => Promise<A>) =>
  (args: T) => new Promise((resolve) => {
    fn(args, (callbackArgs) => {
      resolve(callbackArgs);
    });
  });
```

Check out [this video](https://www.loom.com/share/bc228e0dd9e548a38833fa53385db092) that demonstrates type inference in action!

I'm using type-variables `T` and `A` to generecally implement this function over the original function's arguments, and the callback function's arguments.

### Exercises:

- Did I need to define an inline anonymous function for the second argument of `fn`? How else could I have invoked `fn`?

- Note that my `Callback` type isn't a typical error-first callback like in a lot of node APIs (this is just because the functions I'm trying to promisify aren't error-first callbacks). So I'll leave it to you as an exercise to refactor my `promisify` function to `reject` when an error on an error-first callback is not null ;)
4 Bot Lists to promote your Discord bot
Published: 2020-08-31 19:49:50

Did you just finish building your very first Discord bot? Already own a few bots? getting your first 1,000 servers is tough. Luckily Discord Bot Lists exist to help spread the word.

###Here are 5 bot lists we recommend###

1) **Disforge**

Disforge is one of the easiest bot lists to get started with, bot approval times are low and the website automatically updates server count and other information without needing your bot to make API calls.

vist Disforge's [Discord Bot List](https://disforge.com/bots)

2) **Top.gg**

Top.gg (formerly Discordbots) is another good choice, while their approval times vary and could take up to 1 month they are probably one of the most well known bot lists.

[visit top.gg](https://top.gg)

3) **Bots on Discord**

Bots on Discord is one of our top picks, they have a pretty long approval time (currently 1-2 months) but have many unique features not found on other bot lists such as a review system.

[visit bots on discord](https://bots.ondiscord.xyz/)

4) **Discord Bot List**

Discordbotlist hosts monthly giveaways to Discords most popular bots and is another one of the most popular Discord bot lists we could find.

[visit discord bot list](https://discordbotlist.com)