teleren/devto huggingface dataset:
Margin x Padding
Published: 2021-11-19 02:38:22

Quando comecei a aprender CSS e aprendi as propriedades de espaçamento que são margin e padding, sempre me perguntava quando usar uma e quando usar outra, não era concreto na minha mente o momento certo para usar uma ou outra, então fui fazendo de qualquer jeito, até descobrir que existem diferenças entre elas e o momento certo para usa-las.

##Qual a diferença entre Margin e Padding?
- Margin: é o espaço em volta do componente, distancia que o elemento tem para outro elemento em volta dele.
> Exemplo do margin afastando o elemento:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yapnmpg0mtokuthzy65o.gif)

- Padding: é o espaço dentro do próprio componente, quanto de distancia o elemento tem pra dentro dele mesmo.
> Exemplo: Como se você colocasse um casaco que lhe desse mais volume, essa distancia do casaco até sua pele é o padding.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/soiohrik6sp67rp0n2b2.gif)
 
## Quando usar um ou outro?

- Se usa **Margin** quando: 
  1. Quando se quer dar espaço entre elementos que estão em volta dele.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k996dmxci22nqkmocaso.png)
  2. Para centralizar o componente, afinal com margin auto e width definido o componente vai ficar ao meio tanto horizontalmente quanto verticalmente.
 
- Se usa **Padding** quando: 
  1. Quando não se quer que os elementos não toquem a borda
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxzjkmlu9qpbparm0gpu.png)
  2. Quando se quer crescer o tamanho de um componente
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxg3yhkg7u4t8lbbetjz.png)

-------

Na minha visão esses são algumas diferenças entre usar margin e usar padding, também quando usar um ou outro, espero ter ajudado com esse conteúdo, comenta se você tem visões diferente da minha e se gostou desse pequeno post. 

Obrigado!

Stay hard every day!

Ass: [Italo Canturil](https://www.linkedin.com/in/italo-canturil/)
Symmetric and Asymmetric Encryption Basics
Tags: webdev, tutorial, beginners, cloud
Published: 2022-02-01 23:11:58

---
title: Symmetric and Asymmetric Encryption Basics
published: true
date: 2021-11-19 00:00:00 UTC
tags: webdev,tutorial,beginners,cloud
canonical_url: https://www.rupeshtiwari.com/symmetric-and-asymmetric-encryption-basics/
---

> Why do you care about encryption strategies? Well if you are planning to become system administrator or solution architect then you must know how you would secure your applications deployed on-premise or cloud.  Also remember this question is asked in most of the solution architect interviews.

## Why do you need to encrypt user data?

Suppose you have a banking website hosted on a server. A user logged in to your application and he is fetching his account details. If the server does not encrypt the data sent over the internet to the user machine then any attacker can sniff the traffic and steal the account information. Also possible some attacker can steal the cookie or session key and authenticate himself as you and start doing transactions on behalf of you called [session fixation](https://owasp.org/www-community/attacks/Session_fixation). There is also the possibility of cross site scripting (XSS) and cross site request forgery (XSRF) attacks which are in top [10 vulnerability attacks identified by Open Web Application Security Project (OWASP](https://owasp.org/www-project-top-ten/)) if you do not secure your communication between server application and client.

![](https://i.imgur.com/8jIjVJJ.png)

I hope no you are convinced that you must learn encryption mechanisms in order to protect your server.

## What is cryptography?

Cryptography is the study of secure communications techniques that allow only the sender and intended recipient of a message to view its contents. The term is derived from the Greek word kryptos, which means hidden. - [Cryptography Definitions](https://www.kaspersky.com/resource-center/definitions/what-is-cryptography)

## What is Symmetric Encryption?

In the symmetric encryption you use a single key to encrypt and decrypt user data. Both server (sender) and client (receiver) must have the same key in order for sending and receiving data successfully.

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

[TLS/SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security) uses symmetric cryptography using the session key after the initial handshake is done. The most frequently and widely used symmetric encryption algorithms are AES-128, AES-192 and AES-256.

## What is Asymmetric encryption?

In Asymmetric encryption the sender creates a pair of keys. One is called a public key, another one is a private key. The user data is encrypted by using a private key which can only be decrypted by using the corresponding public key.

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

TLS/SSL uses asymmetric cryptography to initiate the communication which is also known as TLS/SSL handshake. Most widely used asymmetric encryption algorithms are elgamal, RSA, Elliptic curve technique and PKCS.
Prototype Building
Tags: productivity, programming, javascript
Published: 2021-11-19 02:37:51

<p class="codepen" data-height="300" data-theme-id="dark" data-default-tab="js" data-slug-hash="RwZvvpz" data-editable="true" data-user="Kattegory" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
  <span>See the Pen <a href="https://codepen.io/Kattegory/pen/RwZvvpz">
  Generative UI - Orb Animation [pixi.js] + Frosty Elements ❄️</a> by Kat Armendariz (<a href="https://codepen.io/Kattegory">@Kattegory</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
Release 0.3 Code Reviews
Tags: opensource
Published: 2021-11-19 02:33:38

## Hi There,
For this task we were supposed to review our classmates code on the IPC repo.

## How I decided to do my Reviews
Besides looking for errors and mistakes through all the code, there was a special thing I was looking that I messed up on my PR.
I’m talking about the front-matter, the meta that goes on the top of the md file.
I noticed that was really easy to mess that up, and I was suspecting, other students also messed it up.

## My first Review
[PR 81]( https://github.com/Seneca-ICTOER/IPC144/pull/81).
In this case the Slug was messed up, it had upper cases and the letter of the folder “A”.
It was quickly fixed by the author.


## My Second Review
[PR 74]( https://github.com/Seneca-ICTOER/IPC144/pull/74).
Again, in this case the Slug was messed up, it had upper cases and the letter of the folder “B”.
It was also quickly fixed by the author.

## Finally,
I realized that code review is really useful. It is really hard for a single person to handle all bug and errors that a code can have.
Feels good to help people to improve their code and help them to have the code approved.
code every day with me
Tags: javascript, programming, 100daysofcode, android
Published: 2021-11-19 02:27:59

##--DAY 23--
Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
**Now let's solve problem today:**
Problem: Excel Sheet Column Title
Detail: [here](https://leetcode.com/problems/excel-sheet-column-number/)
My solution(javascript):
```javascript
var titleToNumber = function(str) {
    let colNum = '0ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    str = str.split('');
    let result = 0, n = str.length-1;
    for(let i=0;i<str.length;i++){
        result+=((26**n)*colNum.indexOf(str[i]));
        n--;
    }
    return result;
};
```
-->*If you have better solution or any question, please comment below. I will appreciate.*
Release 0.3 Inter PR
Tags: opensource, javascript
Published: 2021-11-19 02:23:05

## Hi There,
Finally, it’s time to deliver the Release 03.
For this release we were supposed to do a Bigger External PR, an Internal PR (which was to fix bugs related to the IPC page) and some code Review on our classmate’s PRs.

## What Happened to my External PR?
On day 09 of this month, I had to go under a surgery, which took me over 10 days to recover. This plus the other assignments I have made me have to choose to sacrifice something, that’s why I decided to skip my External PR.
But the good news is that I have recovered well! :D

## My Internal PR
For my Internal PR, I decided to work on [Issue-41]( https://github.com/Seneca-ICTOER/IPC144/issues/42), part of the [Issue-18](https://github.com/Seneca-ICTOER/IPC144/issues/18).

Basically, I choose to work on the Operators.md file, which is a small file compared to my other options, but still was good enough for me to learn about front matter, admonitions and testing like [Lighthouse]( https://developers.google.com/web/tools/lighthouse) and [Webhint]( https://webhint.io/).

I found some typos, I fixed the readability, checked for light and dark mode and othes.

## What Was Asked For Me To Review
Basically, the only thing that was asked for me to change was the front matter, I had skipped it because I was unsure and it was time to fix it.
I followed this [Issue-64]( https://github.com/Seneca-ICTOER/IPC144/issues/64) to do it.

## Finally,
Working on my IPC notes felt great, the website I used when I did IPC144 was awful and old.
It’s great to see improvements for the future.
Day 481: Find A Way
Tags: hiphop, code, coding, lifelongdev
Published: 2021-11-19 01:59:59

_liner notes_:
- Professional : Started back at work on Monday. I guess I was so used to vacation that I totally forgot about these daily posts. haha Been catching up with everything that's been going on at work. I started a new project and made some pretty good progress this week. I ran into an issue building a demo with a third party tool when setting up my local development. Turns out that there was a dependency in a tool that was updated and broke it. haha I found an issue that was reported like a few hours before. There was a temporary fix which involved editing the code in the library. Did that, and it worked. Did some more work and got a simple demo working!

- Personal : So I had like 2 and a half weeks off. In that time, I launched a new website: https://WhatYouDo.in, did the radio show on Saturdays, my Sunday https://untilit.works show, and did quite a bit of work on my van. With the help of my folks I put up framing. Put together some shelving and containers. Got my workstation / desk put up. Constructed my bed / couch. Also had a meeting at the radio station. We're going back into the studio this week!

![View of the mountain tops of Dolomites, Italy above the clouds at what looks like sunset](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gl2w3d889h05g0a0en0k.jpg)

So I was going through tracks for the radio show and realized I haven't done any blog posts since coming back to work. haha So many things are happening, but I'm getting stuff done. Feels good. Tomorrow the live-action version of "Cowboy Bebop" on Netflix. I'm cautiously excited about it. The trailers look good. I'm probably going to get up early so I can watch a couple of episodes before work. Got a lot of stuff to get done, but I'll find a way!

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 6II6lsykpVk %}
Permission to https://***.git denied to your_old_account
Published: 2021-11-19 01:59:12

```
remote: Permission to fishercoder1534/Leetcode.git denied to MY_OLD_GITHUB_ACCOUNT
fatal: unable to access 'https://github.com/fishercoder1534/Leetcode.git/': 
The requested URL returned error: 403`
```

If you ever face this problem on your mac and visual studio code terminal to push your code to git via https, do the following:

1. Run this command

    ```
    git config credential.helper
    ```

2. If you get `osxkeychain` for above, now run this

    ```
    git credential-osxkeychain erase
    host=github.com
    protocol=https
    ```

3. Clone remote repository again to your local folder. 

4. If github asks you for account connect, click ok. You are all good to go!
Hey World inspired WordPress theme
Tags: wordpress, tailwindcss, hey
Published: 2021-11-19 01:40:21

---
title: Hey World inspired WordPress theme
published: true
description: We live in a world that everything is an app. In my job, there’s a ton of app that does this and that. My job is web-related, so WordPress and friends will be my daily date.
tags: WordPress, TailwindCSS, Hey
cover_image: https://tony.sanjaya.info/wp-content/uploads/2021/05/Screen-Shot-2021-05-22-at-00.31.40.png
---
I have been a fan of Basecamp for a long time. I have been using it for almost 3 years when I worked in a digital agency. And following the founder [Jason Fried](https://world.hey.com/jason) and [DHH](https://world.hey.com/dhh) on Twitter for quite some time. Besides the controversy that they made recently, I still love their products, eg: Basecamp, Hey, books, even though I do not buy/subscribe to it all, but they inspired me in a way.

After they launch [Hey](https://www.hey.com/), it's an email service with a focus on privacy (I love the app), they launched [Hey World](https://www.hey.com/world/). It's a blogging platform that the content comes from email. No bullshit, just send an email and blast off, your content goes to the internet. As DHH said, we need back to web 1.0. 

My take on this is "simplified everything". We live in a world that everything is an app. In my job, there's a ton of app that does this and that. My job is web-related, so WordPress and friends will be my daily date. I have a personal site, the last update is more than a year, one post a year is already good. So the idea of Hey World is really answering my problem.

## So why not create my own Hey World? 

I have many blogging platforms WordPress, NuxtJS, NextJS, Ghost. But none of them are active. So I try back to my root which is WordPress. So I create a theme that looks like Hey World. I create it using [underscores_](https://underscores.me/) and [Tailwind CSS](https://tailwindcss.com/). I stripped unneeded features from underscores, just need the essential. Here is the theme in case you interested, [hey-world](https://github.com/sanjayatony/hey-world). Now my website already looks like Hey World, of course already adjusted to my need.

Now the key part, send an email to publish a post. WordPress by default already has this option, but somehow there is a simple alternative by [Jetpack](https://jetpack.com/support/post-by-email/), which is more than enough to achieve my goal.

So far, I am quite happy with the result.

*Original post: [https://tony.sanjaya.info/hey-world/](https://tony.sanjaya.info/hey-world/)*
Leveling Up Weekly: Ruby on Rails - Issue #4
Tags: ruby, rails, webdev, beginners
Published: 2021-11-19 01:35:47

Hey everyone, I just released the fourth issue of my weekly newsletter, "Leveling Up Weekly: Ruby on Rails" - a curated Rails and Ruby focused newsletter targeted for junior to mid-level Rails developers.

The subscriber list is growing, but I have not received much feedback on it, so if you have any comments or suggestions, I'd love to hear it!

https://www.getrevue.co/profile/levelingupweekly/issues/leveling-up-weekly-ruby-on-rails-issue-4-883712
Installing Pygame
Tags: python, pygame, pip, install
Published: 2021-11-19 01:34:27

---
title: Installing Pygame
published: true
description: How to install Pygame and common problems with running Pygame
tags: python, pygame, pip, install
cover_image: https://camo.githubusercontent.com/1971c0a4f776fb5351c765c37e59630c83cabd52/68747470733a2f2f7777772e707967616d652e6f72672f696d616765732f6c6f676f2e706e67
---
[Pygame](https://www.pygame.org) can be somewhat difficult to install for a beginner so here are scripts that can install Pygame more easily (download the right file for your operating system then double click on the file):
{% gist https://gist.github.com/vivian-dai/14b8c4645983d4f3ed5e2ea9c9c5a727 %}

It's preferable if the user has admin permissions.

## Other Common Problems
### Naming a File `pygame.py`
![naming file error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5bhbygu0lt3bc4tuzvy.png)
> `AttributeError: module 'pygame' has no attribute 'init'`

This kind of problem occurs when there is a file in the same folder as the file you're trying to run called `pygame.py`. When importing, Python will first check the files in the folder to see if there's a module written by the user before checking elsewhere—basically don't name files `pygame.py`

## Conclusion
Hopefully this made it easier to install Pygame, happy coding!
Dipping my feet in SwiftUI
Tags: swift
Published: 2021-11-19 01:33:15

I have always looked at native iOS development as tech wizardry, reserved only for the mighty gods who have climbed the ranks of software engineering to Mount Olympus.

Objective-C looked to me like the foreign language of an alien civilization. Reading about UIKit, Core Data and the steep learning curve associated with both turned me away from native iOS development.

<figure>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x5f2rtl40aoysd73pygj.jpg" alt="Scared young man" style="width:100%">
<figcaption align="center">Stumbling on some Objective-C code</figcaption>
</figure>

Naturally, I flirted with React Native, NativeScript, Ionic and similar technologies for a while. The ease of JavaScript and the vibrant community around it was a dream come true, enough to keep me from ever having to open XCode.

Fast forward to a few days ago, I decided to give SwiftUI a try. I have been hearing about it for a while as the future of iOS development but was somewhat skeptical.

I launched XCode, opened the official [SwiftUI Landmarks tutorial](https://developer.apple.com/tutorials/swiftui) and boy oh boy was I shocked! I was immediately in love. There was so much that reminded me of working with React.

If you are a React developer and always wanted to try native development, I would encourage you to check out SwiftUI. It's not perfect but you will be pleasantly surprised. 

There is also a similar framework for Android called [Jetpack Compose](https://developer.android.com/jetpack/compose) which I will look into next. I have high hopes that these will be the future of native development.

Long live declarative UI 🎉

{% vimeo 647534850 %}
{% vimeo 647536410 %}
{% vimeo 647537276 %}

{% github emmanuelchucks/landmarks no-readme %}
November 18th, 2021: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2021-11-19 01:29:17

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![A picture it a dog waving their paw with the caption “Learning, cool at school or at home”](https://media.giphy.com/media/1xpm1nTQiRL96Di3Q6/giphy.gif)
</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/devteam/what-was-your-win-this-week-3ad7 %}

<center>

![Drama from Entourage screaming “Victory!”](https://media.giphy.com/media/lnlAifQdenMxW/giphy.gif)
</center>
Is there a suitable equivalent to `Function.caller` in modern JS?
Tags: javascript, webdev, help, watercooler
Published: 2021-11-19 01:20:19

So, as MDN (Mozilla Developer Network) says, [`Function.caller`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller) is not only deprecated, but removed from the Relevant Web Standards.
But, this isn't good for me, as I want to know what function is calling a function I have.  
I have a set of private variables, and I only want "friend functions" to see those variables without having to return every function from another function. (Also because these private variables are user-defined, and thus can't be predicted, or written in advance.)

So, I was wondering, does modern JS provide anything similar to `Function.caller`?

<center><h1>Thanks!<br/>Cheers!</h1></center>
Google rank tracker with python script
Tags: python, seo, ranktracker, google
Published: 2021-11-19 00:15:53


This script finds the rank of your keywords and automatically imports it in your Google Sheet! All you have to do is enter the keywords in keywords.txt and the website url in website.txt then run the script, that's it! See the ranking of your words in Google Sheet

If you want use this script [click here](https://github.com/toghani/Google-keyword-rank-tracker) and follow my github tutorial


## Installation
1. Clone the repository in your local storage (or you can use google colab)
2. Import your keywords in keywords.txt (Each word in a line)
3. Add your website URL in website.txt
4. Enable the API and grab your credentials for [pygsheets](https://github.com/nithinmurali/pygsheets), (Use google sheet in python)
5. Edit 52 and 55 lines in keyword-tracker.py based on the previous step
6. Install robobrowser
```
pip install robobrowser
```
7. Install pygsheets
```
pip install pygsheets
```
8. Enjoy!

### Enable the API for use pygsheets
1.  Head over to the  [Google API Console](https://console.developers.google.com/).
2.  Create a new project by selecting My Project -> + button
3.  Search for 'Google Drive API', enable it.
4.  Head over to 'Credentials' (sidebar), click 'Create Credentials' -> 'Service Account Key'
5.  Select Compute Engine service default, JSON, hit create.
6.  Open up the JSON file, **share your spreadsheet with the "XXX-compute@developer.gserviceaccount.com" email listed.**
7.  Save the JSON file wherever you're hosting your project, you'll need to load it in through Python later.
The thing with agilists and deadlines
Tags: noestimates, estimation, agile, deadlines
Published: 2021-11-25 12:35:17

---
title: The thing with agilists and deadlines
published: true
date: 2021-11-19 00:00:00 UTC
tags: noestimates,estimation,agile,deadlines
canonical_url: https://jhall.io/archive/2021/11/19/the-thing-with-agilists-and-deadlines/
---

I’ve decided to step out on a bit of a limb, and try my hand at some cartooning. Bear with me, please, as I subject you to some of my “art”…

![The thing with agilists is...](https://jhall.io/images/cartoons/1_huf79b974b85d047d396cc983ee7f51ad0_87977_600x0_resize_q85_box_3.png)

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._