teleren/devto huggingface dataset:
Our Responsibility for Sustainable Digital Services
Tags: webdev, perfmatters, climatecrisis, sustainability
Published: 2020-06-15 21:13:19

---
title: Our Responsibility for Sustainable Digital Services
published: true
description: The COVID-19 pandemic has led to an explosion of data traffic volumes on the digital highways of the World Wide Web. It is not just video conferencing that is causing this, but also online shopping and the use of various digital services and products. It is high time we take a closer look at the environmental footprint of digital services. This is not a new issue, but one that is becoming more relevant in the current situation.
tags: #webdev #perfmatters #climatecrisis #sustainability
---

{% medium https://medium.com/@mbleuer/our-responsibility-for-sustainable-digital-services-eb6b9bc532be %}
HOWTO: Compile Linux kernel (on Ubuntu, applies to any distro)
Tags: linux, kernel, notetoself
Published: 2020-06-15 20:57:30

![Happy CPUs when compiling the kernel](https://dev-to-uploads.s3.amazonaws.com/i/7np3ajioq9f7pq1fg3rn.png)
<figcaption>Happy CPUs when compiling the kernel</figcaption>

Ubuntu 20.04 comes with Linux kernel 5.4.0-37. I had to reboot every time my machine wake up from sleep to fix screen flickering issues. Latest stable kernel (5.7.2) fixed this issue for me.

## Notes,
- It's easy to start with a working config and test the kernel first
- If it's working, move on to remove things you don't need. This will result in a smaller kernel
- Kernel modules built against the running kernel have to be recompiled. Notably Nvidia drivers and VirtualBox

## Steps to compile the kernel,

1. Download latest stable from kernel.org

2. Unzip
`➜ tar xf linux-5.7.2.tar.xz && cd linux-5.7.2`

3. Copy existing config (make things easy) 
`➜ cp /boot/config-$(uname -r) .config`

4. Use terminal based configuration tool 
`➜ make menuconfig`
If you have relatively recent hardware, this step will take most of your time. Add/remove stuff based on your hardware

6. Compile the kernel with Clang (Remove CC for compiling with gcc - the default C compiler) 
`make CC=clang -j12`

7. Install the kernel 
`sudo make install`

8. Update grub 
`sudo update-grub`

9. Reboot 
`sudo reboot`
big-todo - make virtual TODO files
Tags: python
Published: 2020-06-15 20:57:27

I wrote a command-line utility to create a virtual TODO file by concatenating directory-level TODO files.

* Here's [the GitHub repo](https://github.com/jakekara/big-todo)
* Here's [the PyPi page](https://pypi.org/project/big-todo/)

Documentation can be found in the GitHub repo, so I won't reproduce it here.

The [code](https://github.com/jakekara/big-todo/blob/master/btodo/__init__.py) is just one 47-line .py file. It makes use of an interesting package called [glob](https://docs.python.org/3/library/glob.html), which handles recursively finding all of the TODO files with the following one-liner:

```glob(os.path.join(parent, f"**/{basename}"))```

---

*This was originally posted on [jakekara.com](https://jakekara.com/python/2020/05/20/big-todo.html)*
About ME
Tags: beginners
Published: 2020-06-15 20:54:28

Hello Everypne,

I’m Harendra, a truly passionate Full-stack Software Developer who loves .NET Technlogies, React and Vue. Before we met, I had been living in the land of Laravel, and jQuery. .NET Core introduced me to a complete new world of Ubuntu and CentOS and I like it.

I believe in self learning and these two approaches.
LEARN - SHARE - LEARN
FOLLOW - LEARN - FOLLOW
Elixir - be sorted, not sordid
Tags: elixir, sorting, testing
Published: 2020-06-15 20:47:50

[See code on GitHub](https://gist.github.com/ideaMarcos/096f415e8c42b4db72d4251aaede78bd)

I notice that when devs use libraries like [ExMachina](https://github.com/thoughtbot/ex_machina) to generate fake data for tests, they forget to test for case insensitivity. So they end up with unexpected results like all the uppercase letters appearing before all of the lowercase letters.

```elixir
iex(1)> Enum.sort(["b", "a", "c", "B", "A", "C"])
["A", "B", "C", "a", "b", "c"]
```

To help with testing, I've written a helper function to randomize the case of a string.

```elixir
  def random_case(string) when is_binary(string) do
```

It can be combined with the [sequence] function (https://hexdocs.pm/ex_machina/ExMachina.html#sequence/1) in a factory

```elixir
def article_factory do
  %Article{
    title: sequence("Article Title") |> ExMachinaHelper.random_case()
  }
end
```

There is some overhead in changing the case of strings so only choose the fields related to sorting.
Meeting the Octocat
Tags: deno, javascript, github
Published: 2020-06-15 20:36:41

Once upon a time there was a _Denosaur_...

Welcome _gentl-octocats_, today I wanted to create a [Github Action](https://github.com/features/actions) to use [IFTTT Webhooks](https://ifttt.com/maker_webhooks) and i know that all i need will be a simple curl in any Linux container, but, I'm a developer, and i like to try new thinks. And at the moment of the writing what is the hottest news in the Javascript environment?

You guess right! [Deno](https://deno.land/).

So let's start building a github action with a Deno runner.

# The image of the Denosaur
First of all we need an image with Deno, and after a simple research i have found [hayd/alpine-deno:1.1.0](https://github.com/hayd/deno-docker).

So let's start writing the Dockerfile

```dockerfile
FROM hayd/alpine-deno:1.1.0

WORKDIR /app

# Prefer not to run as root.
USER deno

# These steps will be re-run upon each file change in your working directory:
ADD . .
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache main.ts

CMD ["run", "--allow-net", "--allow-env", "/app/main.ts"]
```

# Using the Denosaur

The actions it's a simple ts file how will fetch a request to the webhook like this

```javascript
const input = (key: string) => Deno.env.get(`INPUT_${key}`);

const eventName = input('EVENT');
const key = input('KEY');
const value1 = input('VALUE1');
const value2 = input('VALUE2');
const value3 = input('VALUE3');

console.log(`calling webhook for ${eventName} with`, value1, value2, value3);

await fetch(`https://maker.ifttt.com/trigger/${eventName}/with/key/${key}`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ value1, value2, value3 }),
});
```

# The Octocat Action
End last but not least the github action definition

```yaml
# action.yml
name: 'IFTTT Webhook'
description: 'Call an IFTTT Webhook'
inputs:
  event:  # id of input
    description: 'IFTTT webhook event'
    required: true
  key:
     description: 'IFTTT webhook key'
     required: true
  value1:
     description: 'IFTTT webhook optional parameter'
     required: false
  value2:
     description: 'IFTTT webhook optional parameter'
     required: false
  value3:
     description: 'IFTTT webhook optional parameter'
     required: false
runs:
  using: 'docker'
  image: 'Dockerfile'
```

# End of the story
And at the end of the story, in only _5 minutes_ I have made [ifttt-webhook-action](https://github.com/alfredosalzillo/ifttt-webhook-action) using Deno.

{% github alfredosalzillo/ifttt-webhook-action %}
Complete AWS Cloud Practitioner Certification Bundle

Published: 2020-06-15 20:18:17

Courses Included In The Bundle

AWS Master Class: Databases In The Cloud With AWS RDS
AWS Certified Advanced Networking - Specialty 2018
Complete AWS Big Data and Analytics Certification
COMPLETE- AWS Security Specialty Certification
Learning Path: AWS Certified Developer – Associate Complete Course
Complete AWS Cloud Practitioner Certification
AWS SysOps Administration
AWS Solutions Architect Associate
AWS Certified DevOps Engineer
AWS Certified Solutions Architect - Professional 2019
AWS Essentials for Certification & on-job
Register now: https://www.simpliv.com/bundle/complete-aws-cloud-practitioner-certification-bundle
Having a Youtube Channel!
Tags: youtube, tutorial, programming, development
Published: 2020-06-15 20:14:39

* I have created a youtube channel called **Vuelancer** two month before.
* And I'm still not did any serious programming stuffs like making a complete tutorial on any tech.
* But, I'm planning to do it.

* Channel Link - https://www.youtube.com/channel/UC0hmXRqXYVO0mocVt5D3GkQ

* I'm creating deno projects and will start doing complete tutorial on deno in 1 month!

* If you like my work or expect me to work! Then do share your comments!

## Some of my videos
{% youtube _1tpxFcpCBI %}
{% youtube moa9lr7MfoA %}
How To Push To A Branch On Github From Vscode
Tags: github, vscode, git
Published: 2020-06-15 19:37:00

If you are reading this, you will probably have heard of GitHub or are even using it. GitHub is a repository hosting server for Git. Today I would like to show you how to push a code from your vscode editor to a branch of a repository you have created on GitHub.

For the purpose of this article I will be assuming

- you already have vscode and Gitbash installed on your PC 
- you have created a repository on GitHub
- you want to push the code to a branch other than the master branch

open the project you want to push on your vscode editor, click on the Terminal button at the top Left corner of the screen, click on New Terminal. A new terminal will open at the bottom of the screen. follow the steps below to push your code to a new branch.

- git init
- git branch "name" ( where name is the name of the new 
  branch)
- git branch (you should see the new branch listed )
- git checkout "name" (to select your new branch)
- git remote add "name" "url" (to get the url open your 
  repository on Github, click the clone or download button 
  and copy the url)
- git push --set-upstream "name" "name"
  If you encounter an error in the last step input (git 
  push "name") it would display an error and display the 
  right code for you below, copy the code and paste it 
  back and your code would be uploaded to your desired 
  branch.
Operators in JavaScript
Tags: javascript, tutorial, beginners
Published: 2020-06-15 20:06:30

## JavaScript Operators

### Topics covered in this video:

* Types of operators in JavaScript
* Arithmetic operators
* Assignment operators
* Comparison operators
* Relational operators
* Logical operators
* Conditional (ternary) operator
* typeof operator

{% youtube z-Cp6gdYK9A %}

📄 Check out the [Destructuring in JavaScript article](https://dev.to/_elmahdim/destructuring-in-javascript-87n)

▶ [Course Playlist](https://www.youtube.com/playlist?list=PLq2_2u8CDe3RSYnDqBlUNwHoJalovMK7j)

[Subscribe](https://www.youtube.com/channel/UCWaZqFpykcDUwC3q7JPDZ8g?sub_confirmation=1) for more videos, and stay tuned for [updates](https://www.youtube.com/playlist?list=PLq2_2u8CDe3RSYnDqBlUNwHoJalovMK7j)!
Why I Use SSH with Git
Tags: git, github, ssh, https
Published: 2020-06-15 19:59:05

---
title: Why I Use SSH with Git
published: true
description: Demonstrate setup for SSH, tell why SSH is my preferred connection over HTTPS.
tags: Git, GitHub, SSH, HTTPS
---

I have been using git actively since 2014.  When I first started, it was annoying to enter my password every time I cloned and pushed updates to repos. The answer, I was told, was to set up SSH keys. I was amazed! The process was so much faster after I set up SSH key pairs with my laptop, build server, and Github.  

Github recommends using an HTTPS connection over SSH, the primary reason being universal availability through firewalls.  HTTPS access is slightly less involved, requiring only a GitHub username and password. The downside to connecting via HTTPS is that you will have to enter your username and password when you perform git actions such as pull and push.  A workaround for this is to set up a cache for your credentials, but this only stores them for a specified time.

I recommend using SSH because I find it faster, more convenient, and more secure.  Faster, because there's no more entering your credentials and more convenient because once your keys are set up, you're good to go.  SSH is also more secure than HTTPS.  For example, if your account credentials are compromised, an attacker can gain access to your entire GitHub account.  If your SSH key is compromised, you have the ability to log in and change/delete your SSH key.

Setting up an SSH key is easy, as demonstrated below:

Open a terminal and type the following:

![Creating an SSH key](https://dev-to-uploads.s3.amazonaws.com/i/vsn7okg33sww8qgka5ox.png)

You will be asked to enter a file to save the key. Pressing enter will save your key pair in the default location.

Next, you will be asked to enter a passphrase. If you don't want to associate a password with the key, just pres enter to leave this blank.

Now that the key pair has been created, you have to start the SSH-Agent so your key can be added.

![Start SSH Agent](https://dev-to-uploads.s3.amazonaws.com/i/66rsbe78b5bt568zbx2h.png)

Now add your key to the SSH-Agent:

![Adding a key to the SSH Agent](https://dev-to-uploads.s3.amazonaws.com/i/5lvkrnvzpur0k0jpim7r.png)

The last step is to add the public key to your GitHub account. Go into your GitHub account settings, to "SSH and GPG Keys".  Click the green button to add a new key. Add a title and copy the public key from your .ssh folder (or wherever you store the key).

And that's it, SSH is setup for your account. Get started by selecting "use SSH" on the green "clone or download" button.
Unsubscribe from everyone 🎉
Tags: meta, javascript
Published: 2020-06-15 19:35:39

---
title: Unsubscribe from everyone 🎉
published: true
description: dev.to seems to automatically subscribe you to a bunch of users by default, here is a way to unsubscribe from everyone.
tags: meta, javascript
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/8unguqot3yomql433xx6.png
---

I found that I was subscribed to 50 users that I didn't remember following (No wonder I'm getting so many notifications!). I looked into the API and found that there wasn't a way to unsubscribe from everyone. No matter, we can do it from the followers list with a little javascript:

```js
document.querySelectorAll(".follow-action-button").forEach(el => el.click())
```

Run that in `Dashboard > following > uers` via the console to unfollow everyone. Now you should have a squeaky clean feed :sparkles: :+1:
Which Git Tool do you use in your work, Git GUI, Git Bash, Git CMD ?
Tags: discuss, git, productivity, webdev
Published: 2020-06-15 19:20:20

While working with `Git` there are many options like `Git GUI, Git Bash and Git CMD`.

I feel `Git GUI` like [SourceTree](https://www.sourcetreeapp.com/) and [GitHub Desktop](https://desktop.github.com/) are more easy to use than `Git Bash or Git CMD`.

Why you would prefer `Git Bash or Git CMD` over `Git GUI` ?

Which `Git` Tool do you use in your work to increase your productivity ?

Let's discuss :smile:
Changing attributes on a user in Rails without having to re-enter password
Tags: rails, codenewbie
Published: 2020-06-15 18:56:01

*(originally published on May 5, 2020)*

This is something that first came up for me during my Rails project for Flatiron, and I really wish I had figured it out then, but it feels fitting to have finally solved this mystery in my last weeks in the program. 

The issue is: you've set up a project with Rails. You include a user model, and add validations for the user's password. Then you want to make something about the user editable. A bio attribute, or something like that. You get all of the edit functionality set up, test out submitting it, and, error! A password hasn't been entered! 

This makes sense, because you didn't enter a password, and you don't want the user to have to enter a password to make changes to their profile when they're already logged in either! But because of the way the password validation is set up, Rails requires a password to be there to save the user. 

To fix this, include this line in your user model: 

```Ruby
  validates :password, length: { minimum: 5, wrong_length: "Password must be at least 5 characters." }, if: :password
```

The first bit is specific to my project, though having a minimum password length is probably a good idea anyway, but the last part is what does the job here: `if: :password`. This tiny bit of code means that if a password isn't included in the changed user object being submitted, then Rails won't worry about validating it. 

Finally, if you're dealing with strong params, include this in whatever controller is dealing with updating the user: 

```Ruby
if user_params[:password].blank?
  user_params.delete(:password)
end
```

This should work for projects with Rails as an API (my current project) as well as projects only using Rails (the project I may go back and add this functionality to!). 

I hope this helps anyone else struggling with this issue as I was!
Angular @Directives @Input() binding properly binding type understanding
Tags: angular, javascript, typescript, 100daysofcode
Published: 2020-06-15 18:27:19

In angular when you use directive`s @input() without [ ] bracket, by default it is considered as HTML string property, and When set with [ ] is considered as javascript binding and we get actual what type we want to. 

#angular #javascript #angulartip #typescript 

https://t.co/cEzWeRpgSR

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6w08m292m9pywns461mc.jpg)
What is Git and how it works
Tags: git, github, versioning, svn
Published: 2020-06-15 18:26:07

---
title: What is Git and how it works
published: true
description: Git is version controlling software that used by the programmers to keep code status. This is how Git works and how to use it.
tags: git, github, versioning, SVN
cover_image: https://www.cloudsavvyit.com/thumbcache/0/0/5b8ff1fbf94a3ecddbaa8db6b389c09a/p/uploads/2019/10/e713ed70-1.png
---
As programmers we use Git to save last successful state of a code. Git has simple way of keeping and versioning history in Git repository. Git keep data as combination of following objects.

Blob : This object used to store content of single file
Tree : Reference to another blog or sub-tree
Commit : Commit data (Auther, Commiter ect) and reference to tree object
Tag : Reference to Commit object.

Here, what is git and how it works.
[![How Git works](http://img.youtube.com/vi/AfZcSewF-qw/0.jpg)](https://www.youtube.com/watch?v=AfZcSewF-qw)
The first post
Tags: learning, writing, devjournal, summerofshipping
Published: 2020-06-15 18:21:08

2020\.

From nearly starting World War III in January, to being in the midst of global pandemic in March, to the nationwide protests against systemic racism in the US in June--this year is the closest thing to an apocalypse that I've ever seen. 

Somewhere in the midst of all of this is me. I've been fortunate enough to not have to deeply worry about these issues. As a college student back at home, I know I'll have a roof over my head as the pandemic rages on. And as an Indian-American, I haven't had to confront many of the same issues that some of my black peers have had to. I am very privileged, and I am so thankful for that every day. 

But in effect, while the world has been melting down, I have just been home, bored out of my mind. I was worried that I wouldn't be able to do anything really meaningful at home. That was until I stumbled upon [Phil Liao](https://twitter.com/pliao39) and the rest of the community at [Summer of Shipping (SOS)](https://summerofshipping.com/). 

SOS is a group of programmers of all skill levels all around the world. What brings us together is that we are all looking to make some use of all this free time we have now. Whether that's by learning a new language, working on a spare project, or helping others--everyone wants to do something. The weekly meetings and active discord server make it feel like a real, living community.   The mentors in the community have played a monumental role in helping me get my bearings and keeping me going. Just knowing that there is this community of likeminded people really made me want to do more this summer.

My plan for this blog is to document what I have done, and what I plan to do. Maybe I'll write about other things if they come to mind. I'm wrapping up one of my current projects, and I will be writing something about it on here too. I'm still trying to find my voice online, so I'm hoping I find it by writing more!
Corona Pandemic Data Analysis
Tags: python, devops, github
Published: 2020-06-15 18:16:16

<h1>Data Science project with <b>numpy, pandas, matplotlib, sklearner</b>.</h1>

<a href="https://github.com/GauravSingh9356/Data-Science-corona/blob/master/Corona.ipynb" target="_blank">link</a>
The Clean Coder: Three Takeaways
Tags: beginners, books, review, career
Published: 2020-06-15 18:11:25

The Clean Coder is the second book on the Clean Code trilogy. It should be a mandatory reading for any professional programmer. This book isn't about programming in itself. It's about the professional practice of programming. It covers from what is professionalism to testing strategies, pressure and time management.

## Professionalism

> _Your career is your responsibility, not your employer's_

Professionalism is all about taking responsibility.

* **Do not harm**: Do not release code, you aren't certain about. If QA or an user finds a bug, you should be surprised. Make sure to take steps to prevent it to happen in the future.
* **Know how it works**: Every line of code should be tested. Professional developers test their code.
* **Know your domain**: It's unprofessional to code your spec without any knowledge of the domain.
* **Practice**: It’s what you do when you aren’t getting paid so you will be paid well.
* **Be calm and decisive under pressure**: Enjoy your career, don’t do it under pressure. Avoid situations that cause stress. For example, commit to deadlines.
* **Meetings are necessary and costly**. It’s unprofessional to attend to so many meetings.
When the meetings get boring, be polite and ask if your presence is still needed.

## Say No/Say Yes

> _Say. Mean. Do_

Professionals have courage to say no to their managers. Also, as professional, you don’t have to say yes to everything. But you should find a creative way to make a yes possible.

* **There is no “trying”**. Say no and offer a trade-off. _“Try”_ is taken as yes and outcomes are expected accordingly
* **You can’t commit to things you don’t control**. But, you can commit to some actions. For example, if you need somebody else to finish a dependency, create an interface and meet with the responsible guy.
* **Raise the flag**. If you don’t tell someone you have a problem as soon as possible, you won’t have someone to help you on time.
* Saying yes to drop out professionalism is not the way to solve problems.

## Coding

> _It could be consider unprofessional not to use TDD_

* **If you are tired or distracted, do not code**. Coding requires concentration. And you will end up rewriting your work.
* **Be polite!** Remember you will be the next one interrupting someone else. Use a failing test to let you know where you were after an interruption.
* **Debugging time is as expensive as coding time.** Reduce your debugging time to almost 0. Use TDD, instead. 
* **When you are late, raise the flag and be honest.** It isn’t ok to say up to the end you’re fine and not to deliver your task.
* **Be honest about finishing your work.** The worst attitude is when you say you’re done when you actually aren’t.
* **Ask for help.** It’s unprofessional to remain stuck when there is help available.