teleren/devto huggingface dataset:
Setting Permissions in S3
Tags: aws, cloud, devops, beginners
Published: 2021-07-14 02:50:15

We studied about the basics of S3 in the last tutorial. In this article we will see how to set permissions for a bucket in S3. To setup permissions in S3 we can use 2 options 
1. Bucket Policies
1. ACL(Access control Lists)

## Bucket policies
As we saw in last tutorial anyone cannot access our S3 objects there is permission denied page when we try to access it over the internet. To provide public access to the objects in the bucket we need to set a bucket policy which explicitly allows some objects to be visible over the internet. Let us checkout a demo policy so that we can see how we can setup a bucket policy.

```json
{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"PublicRead",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject","s3:GetObjectVersion"],
      "Resource":["arn:aws:s3:::DOC-EXAMPLE-BUCKET/*"]
    }
  ]
}
```
Bucket policies are JSON based policies. Lets study what each key means.

**Version** - The policy Version defines the version of the policy language

**Statement** - This defines the all the things that are defined using the policy language defined in version.

**Sid** - The Sid or statement-ID is an identifier that you provide for the policy statement.

**Effect** - It has two values Allow/Deny it tells us whether this statement allows certain things or Deny access to anyone.

**Prinicipal** - Principal specifies the user, account, service, or other entity that is allowed or denied access to a resource in AWS S3 bucket.

**Action** - This defined what actions we are limiting t=in the policy statement.

**Resource** - Defines the bucket and objects on which this policy works.

You can add multiple statements in a policy and this will define who can access our S3 bucket.

## ACL(Access control Lists)

ACL defines which AWS accounts or groups are granted access and the type of access granted to these accounts. When a request is received against a resource, Amazon S3 checks the corresponding ACL to verify that the requester has the necessary access permissions. ACL are rarely used and a bit complex so let us leave them for now as everything that an ACL can do can be done via bucket policy or IAM permissions but if you want to know more about them I've attached a link to the [documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html).

In the next tutorial we will setup some S3 policies and see how it affects the buckets.
Sparky's Tool Tips: NimbleText
Tags: tooling, codegeneration, windows, productivity
Published: 2021-07-14 02:46:49

> *NimbleText is a Windows application, but if you're not on Windows or don't want to install something on your machine, [there's an online version](https://nimbletext.com/Live) (albeit with fewer features).*

I've been using NimbleText for about 15 years. (Actually, I started with Leon Bambrick's web site "[The World's Simplest Code Generator](https://secretgeek.net/programmers_mate)", which eventually morphed into NimbleText.

The idea behind NimbleText is simple. You give it a delimited list of data and a substitution pattern, and it outputs resulting rows. Here's an animation from the NimbleText web site showing it being used to generate SQL statements:

![Animated gif showing how NimbleText works](https://nimbletext.com/images/NTAnimSQL.gif)

###Functions
That's enough for most of the text manipulation I need to do, but there are also several column manipulation functions that can be inserted via its "Functions" menu:

- toUpperCase
- toLowerCase
- toTitleCase
- toPascalCase
- toCamelCase
- toSentenceCase
- toWords
- reverse
- replace
- htmlEncode
- htmlDecode
- urlEncode
- urlDecode
- xmlEncode
- xmlDecode
- split
- charAt
- indexOf
- lastIndexOf
- slice
- substr
- left
- right
- lpad
- rpad
- dateFormat

> Here's how much I rely on NimbleText - I just reflexively *used* the tool to help write this post *about* the tool. I used it to combine dashes and function names to create the Markdown for that bulleted list of functions!😲

You can save/load data and patterns to/from local files.

###Pricing
It's free!

You can purchase a license for $19.95 USD that unlocks some additional features like:
- "where" filters
- sorting
- snippet management

I used NimbleText and other similarly priced tools for years for free before realizing that it's a pretty small price to pay for something so valuable. Don't be like me - If there's a tool that makes your life easier, throw the developers a few bucks.
***
While writing this post, I came across some things I didn't know (or had forgotten) that NimbleText can do. I'm looking forward to trying them out.

Give NimbleText a try, I think you'll like it!
Project Universe multiplayer game dev update!
Tags: gamedev, opensource, unity3d, mmo
Published: 2021-07-14 02:26:40

Project Universe game dev update!

In multiplayer we can now see each other, walk around, & see where everyone's guns/tools are pointing!

Creepy mannequins models aside... we're all excited!

SP & MP are coming together nicely!

Thanks community volunteer devs!

![Creepy mannequin player pointing rocket launcher at camera](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmbfg8v3f1my7z3lul8o.png)
This fatal bug is in nearly all binary search algorithms
Tags: algorithms, javascript, bug
Published: 2021-07-14 02:02:29

There is a bug in this JavaScript snippet. Can you find it?

```js
function binarySearch(array, key) {
    let low = 0;
    let high = array.length - 1;

    while (low <= high) {
        const middle = Math.floor((low + high) / 2);
        const middleValue = array[middle];

        if (middleValue < key) low = middle + 1;
        else if (middleValue > key) high = middle - 1;
        else return middle;
    }

    return -1;
}
```

No? Don't worry, you're not alone. [This exact bug sat unnoticed in the Java Developer Kit for over two decades](https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html).

You read that right, two decades! And you've most likely written this bug at some point as well.

So here is the bug:

```js
(low + high) / 2
```

Though it may look harmless, it isn't. While this works mathematically, in programming, this can break because of **integer overflow**.

Specifically, this way of taking the average fails when the sum of high and low are above the maximum allowable integer value. In the case of Java, that's 2^31 - 1. That's because we use a finite number of bits to represent a number. And if our number is larger than the space we've allotted, weird things can happen.

If our array in Java has more than 2^30 elements (roughly a billion), then the standard binary search algorithm breaks.

So instead of using `(low + high) / 2`, we need to use this:

```js
low + ((high - low) / 2)
```

## But wait, your example is in JavaScript?

We may not directly be working with memory in JavaScript, but our binary search algorithm is still buggy for the same reason. But instead of reaching the bug at a billions elements, [we reach it at 2^52](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). That's about 9 quadrillion. So it's unlikely you'll ever run into this bug.

You learn something new every day.
Is this even possible???
Published: 2021-07-14 01:37:37

I am currently stuck on a pretty significant issue, so much so that it seems even Google does not have an answer for it. Here is my situation. I have a program that takes an html file as input and converts the tags into AMP-valid format. For some reason, after conversion, it bunches up all the code onto a single line,(See picture, attached), 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7mo61e1olkvscacxfmzq.png)
so I have to go in, scroll to each tag, and press [enter] in order to move the tag onto a new line. My question is this, how the heck do I write a mini-script that can run after the conversion to do this one simple function? For the life of me, I can not figure it out. Someone please help!
Functional Programming in Python - Book Review
Tags: python, functional, books
Published: 2021-07-14 00:41:00

# The Book:  
[Functional Programming In Python](https://leanpub.com/functionalprogramminginpython) By Martin McBride
## Short Summary:
"Functional Programming in Python" is a short book on writing code and solving problems using Python in a Functional Programming(FP) idiom. The first chapter goes over the three main paradigms - procedure programming, object-oriented programming, and FP. After the first chapter, we get into FP Fundamentals and how to express them in Python. The longer middle chapters go deep into iterators and iterables. The book ends with several chapters that dive into FP ideas that don't necessarily apply to Python.
## What I liked:
There were several things I liked about how the author wrote the book. First, I like how the chapters are formatted. It is nice to know that the last chapters aren't necessary for Python but interesting nonetheless. I also enjoyed how the author explained the concepts. I feel as if I can implement these ideas reasonably soon. It was a good weekend book that didn't need a lot of focus to understand.
## What I disliked:
I didn't dislike much about the book. If there was one thing that I would comment on, it was on the chapters about iterator functions. I'm not sure what the thought process is to give so much space to explain the different functions, and it didn't make a clear connection to FP. Perhaps my comprehension is lacking, but I had a hard time connecting the two.
## Review round-up:
I would suggest any intermediate Python developer interested in exploring FP concepts in Python read this book. It's not a beginner book, nor do I think anyone with solid FP knowledge would gain much out of reading it. 
## Rating:
7/10 Python Snakes
How to create a new branch in Git?
Tags: git
Published: 2021-07-14 00:00:00

---
  title: How to create a new branch in Git?
  published: true
  tags: Git
  date: Wed Jul 14 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/create-a-new-git-branch
  cover_image: https://melvingeorge.me/_next/static/images/main-ca0ac7f0e7c63d2d31aae21d55c75185.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/create-a-new-git-branch)
  
To create a new branch in Git, you can use the `git checkout` command followed by the flag `-b` and then type the name of the branch you need to make.

For example, to make a branch called `my-new-branch` you can use the `git checkout` command like this,

```bash
# Creates a new git branch
git checkout -b my-new-branch
```

This will create a branch called `my-new-branch` and will automatically check you into it (aka, set the current working branch to `my-new-branch`).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
How long should your résumé be?
Tags: resume, cv, jobs, jobsearch
Published: 2021-07-15 09:15:20

---
title: How long should your résumé be?
published: true
date: 2021-07-14 00:00:00 UTC
tags: resume,cv,jobs,jobsearch
canonical_url: https://jhall.io/archive/2021/07/14/how-long-should-your-r%C3%A9sum%C3%A9-be/
---

On one of the slack channels I frequent, we recently had an interesting discussion about the most effective form of a résumé or CV for technical roles. In particular, how long should it be?

Here are my thoughts, copied from the conversation. Of course, it goes without saying that every recruiter or hiring manager has their own taste and expectations, so your mileage may vary.

> My résumé is 2 pages. But it’s probably too long. What I think is much more important, though, is that the most important things must be on the top half of the first page. As a hiring manager, the first things I want to see on a résumé: 1. What kind of role do you expect (broadly speaking). I.e. frontend, backend, UX design, SRE, etc. 2. Is it possible you have the experience I’m looking for for my particular role?
> 
> What I think this means is that you should make it obvious (although not necissarily explicit) what kind of role you’re looking for. This could be in the form of “Desired role: Sr. Go Engineer” or it could be more implicit (i.e. just by listing your most recent job title, assuming you’re not looking for a change of roles).
> 
> Then second, it should be obvious what kinds of technologies you’ve used in the past. This could be in the form of a list of technologies (“Proficient in: Go, Python, and Kubernetes”), or it could be details of your most recent job(s). “At Acme Co, I wrote Go and Python for our Kubenetes cluster…”.
> 
> The point is, **these two details should basically jump out**. If I can’t immediately tell that the candidate is looking for a role I need to fill, and if I can’t immediately tell there’s a chance they might be experienced enough, I’ll discard or at least move to the bottom of the consideration pile.

For bonus points, the conversation went on to mention some unique résumés that I’ll link below. If you’ve ever used a particularly unique résumé, I’d love to see it, and hear how successful it was at finding a job. I may use it in an upcoming post and/or podcast episode. Hit REPLY and tell me about it!

- [Patrick Moroney](https://pkg.go.dev/github.com/pmoroney/resume), written entirely as Godoc ([Go](https://golang.org/) built-in documentation format)
- [Tierney Cyren](https://www.npmjs.com/package/bitandbang), installable as an npm module (or [read the source](https://github.com/bnb/bitandbang/blob/master/build.js))

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
How you can be like JavaScript
Published: 2021-07-13 23:26:50

JavaScript is a programming language that is in wide usage today. Virtually all websites and web applications implements one form of JavaScript code or the other, in fact, any website or web application that makes use of HTML 5 API's is made up of some form of JavaScript code because most of the HTML 5 API's were written in JavaScript. 

Frameworks are now dominating the web space, almost all enterprise level applications are built using frameworks, however, the most popular and most used frameworks are mostly JavaScript frameworks.

However, the question that buggles my mind is how did this small programming language written by one man become one of the most widely adopted programming language.

JavaScript was written by a man known as Brendan Eich in the year 1995, surprisingly, it took Brendan Eich only 10 days to write this very popular programming language called JavaScript.

Due to the short period of time used to write the language, JavaScript as a language had lots of errors embedded in it but despite those errors, it was still implemented in major browsers and virtually all browsers.

In order to correct those errors, different modifications were carried out on the language and the most popular been the ECMA Script 6 or ECMA 2015.

JavaScript is a language based on ECMA script which is a standard for scripting languages and is been governed by the European Computer Manufacturers Association (ECMA).

You too can become like JavaScript, a language full of errors that rose to become one of the most popular programming languages.

I don't know the stage of your professional career that you are currently on, you might be at the stage where your potentials are yet to fully manifest, probably, you are full of errors like JavaScript, you don't have good communication skills, don't have what it takes to get things done, cannot meet set targets in the workplace and generally seen as an under achiever and under performer.

Don't beat yourself down, you too can ride from a nobody to a somebody, from an under achiever to an over achiever, you too can become the new biggest and most sought after individual in your industry, you just have to consistently work on yourself.

💥 Invest your time, energy and money in your growth and development, 

💥 Show up but don't show off,

💥 Trust your process, 

💥 Look up the Giants in your industry and follow their foot steps and in no time, you will become one of the the most valuable persons (MVP) in your industry.

If JavaScript can, You will.

Franklyn

#javascript #codenewbie #softwareengineer
What is your go-to state management library? No frameworks!
Tags: discuss, beginners, javascript
Published: 2021-07-13 22:25:36

Hello.

What is your go-to state management library? I know we can use redux without React and I have. Redux is such an amazing tool. But, are there any alternatives? PS, if possible, also share how the library you mentioned saved your bum.

I remember I was working on a project where I was not going to use any JavaScript frameworks. Somewhat complex google maps system for a WordPress multisite. For each site we used to input the associated shop/branch coordinates and then polygon information for coverage area.

Since, there were over 25 sites, I cached all the settings in a new table that I had created in order to fetch all the data in a single query instead of changing the "blog", fetching that information for that specific site and changing it again.

The data was complex but I handled it beautifully. After I was done, I thought only if I had used Redux in order to make state management super super easy! My project did use custom observers, immutable data and selectors. Replacing that with Redux would've meant that other developers would've started with it like real easy!

Anyways, thanks for reading this post. Give me some awesome recommendation and also, how the library you mentioned saved you bum! Thanks!
Day 407 : Brain
Tags: hiphop, code, coding, lifelongdev
Published: 2021-07-13 21:52:57

_liner notes_:
- Professional : Whew... one of those days where you get a bunch of stuff done and you are just brain tired. haha. Had a meeting, did some pair programming on a demo application, recorded a promo for an upcoming workshop I'm doing, looked over some demos for the workshop. I thought I was going to have to create the demo applications, but turns out I already did 2 out of the 3 I was looking to showcase. haha The good part about always creating random demo applications to test stuff out. All I have to do is clean it up some. The last demo I need to make is basically a mix of other demos I can pull from to hopefully get it together quickly. The workshop isn't until Thursday afternoon and I don't think there will be much slides needed. Pretty much just looking through the code and explain parts and answer questions. I don't think people want to see me fumble around with my typos while live coding. haha.

- Personal : Last night I was able to create a demo application where I can send a link to a video to an API to have it analyzed with the AI and then make calls to some endpoints to get things like transcriptions, a summary of the video, action items, questions, analytics, and more. Pretty cool technology. The only thing I couldn't get working is the webhook. I thought I set it properly, but I end point is never called when the video is finished being analyzed. I'll figure it out. If not, I'll just hit up the company on their Twitter account. They started following me and that's how I learned about them. Oh and I was able to watch an episode of "Fire Force" while having dinner. I think I'm going to keep up that habit.

![A dirt trail with tall green grass and purple flowers on both sides leading up to some hills as the sun sets in Kaiserstuhl, Germany](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59xqclas80q2w8j7fdca.jpg)

Like I said before, my brain is fried. haha Going to eat, watch some anime and hopefully be in the mood to figure out the webhook issue. I'll also probably go through some tracks for the radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube uNiY4XoTGV8 %}
Take the Jamstack Community Survey 2021!
Tags: jamstack, webdev, netlify
Published: 2021-07-13 21:52:28

---
title: Take the Jamstack Community Survey 2021!
published: true
description: The 2021 Jamstack Community Survey is out and we want to hear from you!
tags: jamstack, webdev, netlify
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evmqbtcuysv8a6olb8m7.png
---

The 2021 Jamstack Community Survey is out and we want to hear from you!

[Take the survey here!](https://www.surveymonkey.com/r/jamstack-survey-devto)

Last year when we ran the survey, we had over 3000 responses, and we'd love to blow that number out of the water. We're excited to see the year-over-year trends for the category. Seeing which frameworks are growing, which ones are losing ground, which ones make you happiest, which CMS people love the most... it'll be so interesting to see how that has changed over the past year! [You can see last year's results here](https://www.netlify.com/blog/2020/05/27/state-of-the-jamstack-survey-2020-first-results/).


Plus, you can get a limited-edition Jamstack sticker with your responses 👀 get 'em in quick!

Once again, [here's the link to take the survey](https://www.surveymonkey.com/r/jamstack-survey-devto). It should take you about 5 minutes, and we'd love to hear your thoughts!
ES6 notation
Published: 2021-07-13 21:50:38

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

```
const materials = [
  'Hydrogen',
  'Helium',
  'Lithium',
  'Beryllium'
];

console.log(materials.map(material => material.length));
// expected output: Array [8, 6, 7, 9]


// Traditional Function
function (a){
  return a + 100;
}

// Arrow Function Break Down

// 1. Remove the word "function" and place arrow between the argument and opening body bracket
(a) => {
  return a + 100;
}

// 2. Remove the body braces and word "return" -- the return is implied.
(a) => a + 100;

// 3. Remove the argument parentheses
a => a + 100;

```
Install Firefox on Linux
Tags: linux, firefox
Published: 2021-07-13 21:10:23

I have faced this issue that no article or no forum shows correct way to install firefox on debian based distros, or maybe I haven't found such article, but anyways I figured out myself.

**Step 1**
Download your desired [firefox](https://www.mozilla.org/en-US/firefox/all/#product-desktop-release) browser.

**Step 2**
Extract firefox tar file and it should give you the internal firefox folder in your downloads folder.

**Step 3**
Now to move that extracted firefox folder to `/opt` directory.
```
sudo mv ~/Downloads/firefox /opt
```
**Step 4**
Now to create firefox's `.desktop` file in user's applications directory
```
cd ~/.local/share/applications
```
You can name your firefox desktop file anything like I have installed firefox developer addition, so my file name is `firefox-dev.desktop`. But you can name it anything which is relevant.

```
touch firefox-dev.desktop
nano firefox-dev.desktop
```
Inside this file my configuration is something like this:

```
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=/opt/firefox/firefox
Name=Firefox Developer Edition
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Comment=Custom definition for Firefox Developer Edition
Terminal=fasle
```
**Note:**
1. You can see that location to execute firefox is in out `/opt/firefox` pointing to firefox executable file.
2. Icon for out firefox will be found in given location, you can choose any set of icons, whichever suits your need.