teleren/devto huggingface dataset:
Stage, Commit and Push Changes to Github Repositories in Atom without commands
Tags: github, atom
Published: 2021-11-23 04:21:22

Context: I recently switched to Atom Editor as I faced some problems with VS Code and did not have time to figure it out, then.

Install the Atom Editor from their [official website](https://atom.io/).

Open it and work on your code that's already cloned from a remote repository.

Save your work with Ctrl+S or `Save`.

Click on `Git` which is on the bottom right side, as shown in the image.

![0.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597068004/U5p73scAj.png)

This is how your work will be seen, currently. It's unstaged. You can see this on the right side of this image.

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597025158/KSNpqjNsu.png)

It will also show you the changes to the file that you have made. Click `enter` to stage it.

![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597135311/GLf7WTKAg.png)

Now, the changes would move to the staged area, on the right side.

![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597186848/xXzQzNg4R.png)

Enter your commit message before you commit by clicking on `Commit to Master`. 

Now, your code would have got committed.

![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597269100/eaFRtwNMc.png)

Click on this `Push` button to push the code to your remote repository.

![5.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597297028/45PcTBBnLu.png)

Once it's pushed, you'll see `Fetch` instead of `Pull`.

![6.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597322771/9RwP4uX3rI.png)

If you'd want to push the changes to a different branch, click on `master` as shown in this image.

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1637597619223/szBMHOg6mQ.png)

In case you don't have a branch named `master`, any other branch may show up there. You can change it from the drop-down menu shown above it.
Self-Taught Developer Journal, Day 3: Algorithms Dance and Stressed Out
Tags: todayilearned, codenewbie, devjourna, beginners
Published: 2021-11-23 03:29:35

Today I learned....

## Algorithms Dance
My co-worker introduced me to this channel, [AlgoRythmics] (https://www.youtube.com/channel/UCIqiLefbVHsOAXDAxQJH7Xw), where they recreate algorithms in different styles of dance! Very interesting, never thought about algorithms in dance version.

## What kind of developer do I want to be?
I read this article recently on Medium, [Advice From an Ex-Tech Recruiter to a Self-Taught Programmer by Angelica Dietzel] (https://betterprogramming.pub/advice-from-an-ex-tech-recruiter-to-a-self-taught-programmer-4d3eb0c5138e), where she offered insightful advice to self-taught programmers as a former tech recruiter (if you didn't already get that from the title). There was one portion of the article where she discussed about having a targeted approach when building your portfolio for that stuck out to me. I haven't really put much thought into what kind of company or field I'm interested in so I spend some time today trying to research with not much luck....

At most, I think I made myself more stressed out, whoops. Combined that with a long work day, I did not get a chance to study any coding today :(, not without being miserable anyways. No one said this would be easy. Here's hoping for a better tomorrow.

Day 2: https://dev.to/jennifer_tieu/self-taught-developer-journey-day-2-39b6
Please refer to [Starting My Self-Taught Developer Journey]( https://dev.to/jennifer_tieu/starting-my-self-taught-developer-journey-2dga) for context.
Enable Lambda Insights Using Python AWS CDK
Tags: aws, lambda, monitoring, devops
Published: 2021-11-23 03:17:17

## Code for enabling Lambda Insights with the Python CDK
```
# Define the layer, make sure you use the right layer for your region and the pick the most up to date layer https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html

layerArn='arn:aws:lambda:us-east-1:580247275435:layer:LambdaInsightsExtension:14'
insight_layer = _lambda.LayerVersion.from_layer_version_arn(self,'lambda_insights_layer',layerArn)

#Add the layer to the function as shown below
_lambda.Function(
    self, 'my_function',
    runtime=_lambda.Runtime.PYTHON_3_8,
    handler='my_function.handler',
    code=_lambda.Code.from_asset(
        path = 'lambda'
    ),
    layers=[insight_layer]
)

# Optional: Add the managed policy 
If using the `AWSLambdaBasicExecutionRole`, which CDK uses by default when creating a Lambda function, there is no need to do this. Otherwise, add the `CloudWatchLambdaInsightsExecutionRolePolicy` managed policy to the function.

```

**Note:** make sure to pick the most up to date and correct region ARN for the Lambda Insights Extension layer. Reference [these docs here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html) for ARNs for all regions and version

Here are the [AWS docs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started-clouddevelopmentkit.html) on how to enable Lambda Insights for the Typescript CDK.

## More CDK or AWS Serverless Questions?
Feel free to leave a comment here or hit us up on [LinkedIn](https://www.linkedin.com/company/signet-seal).

Want to learn more about how SignetSeal can help make your chats more secure? Read more about us on our website [SignetSeal.com](https://signetseal.com/)
Ask user to save the data before window close
Tags: javascript, webdev, webassembly
Published: 2021-11-23 03:16:25

```js
window.onbeforeunload = function (e) {
   // return a string if you don't want to close
   // the returned string will be displayed in the browser
   return "Do not close please!";

  // return undefined to close the TAB
  return;
};
```
Configure CORS for an S3 Bucket Using Python AWS CDK
Tags: aws, cloudnative, cdk, s3
Published: 2021-11-23 02:41:54

## Get right to it, here is the code
Python CDK code for configuring CORS on an S3 bucket.
```
bucket = s3.Bucket(self, "myBucket",
    cors=[
        s3.CorsRule(
            allowed_headers=[CORS_headers],
            allowed_methods=[s3.HttpMethods.PUT, s3.HttpMethods.POST, s3.HttpMethods.GET, s3.HttpMethods.DELETE],
            allowed_origins=[CORS_url]
        )
    ]
)
```

A list of the HTTP methods which can be configured can be found here in the [aws_cdk.aws_s3.HttpMethods docs](https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_s3/HttpMethods.html#aws_cdk.aws_s3.HttpMethods)

Relevant docs:
* https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_s3/Bucket.html
* https://docs.aws.amazon.com/AmazonS3/latest/userguide/ManageCorsUsing.html


## More CDK or AWS Serverless Questions?
Feel free to leave a comment here or hit us up on [LinkedIn](https://www.linkedin.com/company/signet-seal).

Want to learn more about how SignetSeal can help make your chats more secure? Read more about us on our website [SignetSeal.com](https://signetseal.com/)
Sydney Rug Cleaners
Tags: sydney
Published: 2021-11-23 02:27:03

Nowadays rugs come in a seemingly endless number of shapes, sizes and colours, from traditional Persian or Oriental rugs, costing many thousands of dollars, to modern synthetic rugs in vibrant hues and funky avant garde designs. What they all have in common is they hugely benefit from regular servicing, which consists of deep cleaning by properly qualified professionals like Sydney Rug Cleaning Carpets. Link.http://sydneyrugcleaningcarpets.com.au/
Randomly order elements in an array Once in React (Possibly using Use effect) SOLVED
Tags: react, javascript
Published: 2021-11-23 01:59:57

I'm working on a solo project quizzical whilst learning react but cant find a solution to give the answers a random order without breaking my code. I have tried to use a shuffle function but this just causes the order of the answers to change with every click, I also tried to add the correct answer at a random index but the same problem happened. Not sure if I have to totally restructure my code or if there is a workaround. Be great if someone could take a look.

https://scrimba.com/learn/learnreact/fork-of-section-4-solo-project-coc8e46febb53e8d33018993e

As you can see all correct answers are in the last position in the answer array

I have attempted to use useEffect but really unsure if this is a situation where it should be used, this is just what i've left in my code. Removing the useEffect shuffles on every button click placing answers in the wrong places. I have included this code but may be hard to gauge the problem so scrim is attached

const correctId = nanoid()
        const incorrectIds = [nanoid(), nanoid(), nanoid()]
        let counter = 0
            
        const correctAnswer = 
                                    <button 
                                            value='correct'
                                            id={correctId}
                                            onClick={e => {
                                                changeClass(correctId, 'correct')
                                                props.answerQuestion(e, 'correct')
                                            }}>       
                                    {props.result.correct_answer}</button>
                            
                                    
                
        let answers = props.result.incorrect_answers
        let allAnswers = answers.map(answer => {
                            const id = incorrectIds[counter]
                            counter++ 
                            return (
                            <button 
                                value='incorrect'
                                id={id}
                                onClick={e => {
                                    changeClass(correctId, 'correct')
                                    changeClass(id, 'incorrect')
                                    props.answerQuestion(e, 'incorrect')
                                }}>
                            {answer}</button>)})
                            
        allAnswers.push(correctAnswer)
       
       React.useEffect(function() {
           allAnswers = shuffle(allAnswers)
        }, [])
The 15 Best Artificial Christmas Trees
Published: 2021-11-23 01:59:24

<a href="https://homechit.com/best-artificial-christmas-trees/">Artificial Christmas Trees</a> are the best way to get that classic winter feeling. They're also much easier on your wallet than real ones, and you can find one just about anywhere these days! Artificial Christmas trees have come a long way since their first appearance in the early 1900's. These fake greenery pieces of art can now be found on homes across America, and they provide that extra bit of holiday spirit to make your house feel like an authentic Dickensian manor! The best part? You don't need much space for installation because these things are tiny- only about four feet tall if we're talking full height models (although there is some variation).
Read more: <a href="https://homechit.com/best-christmas-tree/">best christmas tree</a>, <a href="https://homechit.com/best-fake-christmas-tree/">best fake christmas tree</a>, <a href="https://homechit.com/best-pre-lit-christmas-tree/">best pre lit christmas tree</a>, <a href="https://homechit.com/best-christmas-garland/">best christmas garland</a>, <a href="https://homechit.com/best-christmas-light-projector/">best christmas light projector</a>, <a href="https://homechit.com/best-christmas-lights/">best christmas lights</a>, <a href="https://homechit.com/best-christmas-tree-lights/">best christmas tree lights</a>, <a href="https://homechit.com/best-christmas-stockings/">best christmas stockings</a>, <a href="https://homechit.com/best-christmas-tree-stand/">best christmas tree stand</a>, <a href="https://homechit.com/best-christmas-tree-toppers/">best christmas tree toppers</a>, <a href="https://homechit.com/best-christmas-tree-skirts/">best christmas tree skirts</a>.
Best Cloud Computing Platforms With Free Trials 2021
Published: 2021-11-23 01:22:48

Hello & Welcome. In this post we are going to know about some of the Best Cloud Computing Platforms With Free Trials. All the Cloud Computing Platforms listed in this post are completely free to use for a specific period of time but later you can upgrade them. So let’s get started and dive into interested content.

[Read Complete Post](https://crunchythings.xyz/best-cloud-computing-platforms-with-free-trials/)
Code review for release 0.3
Tags: opensource, codereview, programming, productivity
Published: 2021-11-23 01:19:44

## First review 

For the first review, I'm taking a good look at @lmpham1 [PR](https://github.com/Seneca-ICTOER/IPC144/pull/102) where he fix the `types.md`. Before I was in, there was a lot of comments on how to improve the docs. The docs look pretty clear and straightforward to me the only comment that I would make was adding a suggestion on how he would organize text and integral types in the table. I would love to go with his idea where we organize the elements follow excel flavor

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fa1wz5inz2t9hb12lag8.png)

## Second review

My second reviews is on Antonio [PR](https://github.com/Seneca-ICTOER/IPC144/pull/104). So when I did the first review I regconize @lmpham1 move the image to be fetched from `static/img/` so I make a comment to direct him to @lmpham1 PR

## There is always a learning opportunities

When doing review, you might get back a lot of knowledge and information. I come accross this [PR](https://github.com/Seneca-ICTOER/IPC144/pull/50) where one of my colleague trying to add Prettier as source code formatter to the IPC144 project. I learn that the order merging PR matter, and some of the comment of our prof also point out the direction on how we should solve the problem

>The minute we land the prettier stuff, we also need to format the whole tree at the same time. We have to be ready to deal with the edge cases before this goes in.

>I would file issues on the specific things that Prettier is breaking, get those fixed and merged, rebase this, and then run prettier over the whole tree and land. 

So review is also a learning opportunity as you go but also help the PR author catch and receive different aspect of how peoples gonna solve the same problem
NCLEX Certificate without Exam
Tags: nclex, exam, education, nurse
Published: 2021-11-23 01:18:15

Buy NCLEX Certificate without exam
Welcome to the most reliable source where you can get  data base registered and verified NCLEX  certificate. Are you tired of failing the NCLEX exams? or don’t have time to sit for them? and you’re thinking how to pass NCLEX without taking exams? 
Are you looking for the most reliable source of getting data base registered and verified NCLEX certificate? Be it LPN or RN, we can help you get it . 
Notwithstanding, we work with influential personnel and have access to the PEARSON VUE database which allows us to register candidate data and provide registered NCLEX, and other certificates with or without exams. 
Buy NCLEX certificate online. Nevertheless, we provide genuine and authentic CNA,RN or LPN license directly from the NCSBN with or without writing the NCLEX LICENSURE exams.
allexamscertificates.com l NCLEX without exam online we provide genuine and authentic CNA,RN or LPN license directly from the NCSBN with or without writing the NCLEX LICENSURE exams.
Buy NCLEX Certificate Online
NCLEX License for Work & Migration
Genuine NCLEX License For sale
NCLEX Certificate without Exam
Buy Genuine NCLEX Certificate without exam
Get Valid NCLEX License Online Without Taking exam
Real Registered NCLEX-RN License for Sale Online
Buy Legit NCLEX-PN Certificate Without Exam
Passed NCLEX without studying
NCLEX exam without going to nursing school
Buy valid and genuine NCLEX-RN and NCLEX-PN certificate license without taking the text

Contact us : 
https://www.allexamscertificates.com/
genuinecertificateforsale@gmail.com
+1 (213) 375-4130
Get unique objects from an array
Tags: javascript, array, object, map
Published: 2021-11-23 00:35:06

Suppose you have an array of objects with at least one common property that could be used as an identifier.

This function will allow you to create a new array with unique objects based on the selected property:

```javascript
function getUniqueElementsFromArray(array, uniqueProperty) {
  const result = [];
  // The map will help us keep a record of the objects
  const map = new Map();
  array.forEach((item, i) => {
    if (!map.has(item[uniqueProperty])) {
      // New element, push it into results
      map.set(item[uniqueProperty], true); // you can set any value, we just need it to be in the Map
      // save unique object
      result.push(item);
      }
    });
  return result;
};
```

Example: 
Let's say we have an array:
```javascript
const sample = [
  {name: 'a', points: 20, game: 1},
  {name: 'e', points: 5, game: 3},
  {name: 'a', points: 15, game: 3},
  {name: 'i', points: 5, game: 3},
  {name: 'e', points: 50, game: 1},
  {name: 'a', points: 0, game: 5},
  {name: 'o', points: 100, game: 2},
  {name: 'e', points: 20, game: 2},
  {name: 'u', points: 20, game: 1},
  {name: 'i', points: 50, game: 2},
]
```
We can use the property `'name'` as identifier
```javascript
console.log(getUniqueElementsFromArray(sample, 'name'))
```
And the result will yield:
```javascript
[
  { name: 'a', points: 20, game: 1 },
  { name: 'e', points: 5, game: 3 },
  { name: 'i', points: 5, game: 3 },
  { name: 'o', points: 100, game: 2 },
  { name: 'u', points: 20, game: 1 }
]
```

Adding here a typescript version:
```javascript
export const getUniqueItems = (array: any[], uniqueProperty: string): any => {
  const result: any[] = []
  const map = new Map()
  array.forEach((item) => {
    if (!map.has(item[uniqueProperty])) {
      map.set(item[uniqueProperty], true)
      result.push(item)
    }
  })
  return result
}
```
7 and a half months into coding
Published: 2021-11-23 00:17:24

This is a quick overview of what I have learned in the past 7 months. Important to mentioned is that I am doing it full time, every day including on weekends, so your mileage may vary.

I started coding on April 5. 2021. I know the day, because I looked at my browsing history. In May 2021 I did not know the difference between Java and JavaScript, so I was new to coding, as new as one can be, with no knowledge of variables, functions or lists.

I started with **python**, which is a great beginner language as you don't have to deal with pointers or callbacks much, and a clean syntax. I took the CS50x, MIT 6.00.1x, Rice University's Interactive Python courses, the latter being the better one of the three. With Python I've build simple programs like a pin pong game or a memory game.

The end of July and part of August were spent mostly on **CSS**, in August I finally dived into **JavaScript** and learned it through September. In September I started toying with **React**, which was my subject-to-learn in October and November. 

In November, in addition to React, I learned Node.js with MongoDB, how to build simple controllers with functionalities that allow posting, fetching and changing items in the database. 

As of November, I can confidently build a fullstack application using the **MERN** stack - a stack which I would recommend to any beginner. MERN stands for Mongo, Express, React, Node and it's one of the easiest yet powerful choices one can make to build web application. Ben Awad (see him on YouTube) does amazing things with React and he uses as similar stack with the difference of using a Postgress SQL for database.

Along the way I have also learned Django and a bit of **Go**. I was blown away by the sheer speed Go offers. Using goquery I have build a scraper that scrapes listings for used items, and it's much much faster than say Python's Scrapy.

For the next few months I plan on finally building larger applications for a portfolio, because as of right now I only have simple landing pages, calculators, to-do apps, weather apps and simple games, which even to me are not very impressive. 

I have Youtube, Instagram and Twitter **clones** lined up. These projects will allow me to learn user authentication, registration, something I haven't yet done and will give me the overall experience of building a larger app. 

I have other weak points such as git. I also known very little about creating images with Docker, I know very little about Gatsby or NextJS, but for me they have not been to different from React. I have build a couple of things in both. So, those two React frameworks are also on my list to learn. Redux is also on the list, as I might need it for a larger project.

I have never learned to much in such a short period of time in my life. I have probably sunk **1600** hours into coding as of November 23., 2021!
Calling functions in x86 assembly
Tags: assembly, nasm, x86
Published: 2021-12-04 19:14:50

---
title: Calling functions in x86 assembly
published: true
date: 2021-11-23 00:00:00 UTC
tags: assembly,nasm,x86,assembly
canonical_url: https://www.mourtada.se/calling-functions-in-x86-assembly/
---

This is the fifth post about x86 assembly. In this post I will show how to call functions in x86 assembly.

Below is a simple program that has three functions besides main.

```
global main
extern printf
section .text
main:
        mov rdi, 5
        call times2
        mov rdi, rax
        call print_value
        call exit
times2:
        push rbp
        mov rbp, rsp

        mov rax, rdi
        add rax, rax

        mov rsp, rbp
        pop rbp
        ret
print_value:
        push rbp
        mov rbp, rsp

        push rdi
        mov	rdi, fmt
        pop	rsi
        mov	rax, 0
        call printf wrt ..plt

        mov rsp, rbp
        pop rbp
        ret
exit:
        mov rdi, 0 ; exit code 0
        mov rax, 60 ; system call for exit
        syscall

section .data
fmt: db "The value is %d", 10, 0

```

## Passing values to functions

The code above is following the Linux 64-bit ABI where the first six arguments(integers and pointers) are passed through registers. You could also pass the arguments on the stack or hardcoded memory locations.

## Function prologue and epilogue

The beginning and the end in the functions `times2` and `print_value` is called the function prologue and epilogue.

```
  push rbp
  mov rbp, rsp

  ...

  mov rsp, rbp
  pop rbp
  ret

```

This a convention for preparing the stack for usage. The prologue creates a new stack frame for the called function and the epilogue restores the stack frame for the calling function.
♻️ Reusing SVG elements in HTML without copy-pasting it
Tags: helloworld
Published: 2023-04-22 19:29:05

---
title: ♻️ Reusing SVG elements in HTML without copy-pasting it
published: true
date: 2021-11-23 00:00:00 UTC
tags: helloworld
canonical_url: https://bstefanski.com/reusing-svg-elements-html-without-copy-pasting
---

Sometimes you might encounter the case where you want to use the same SVGs multiple times across one page. The first example that comes to my mind is the use of social media icons both in the navbar and footer. This is how I would approach this

```

function SomePage() {

 return (

// Invisible symbol 

<svg style={{ display: "none" }} version="2.0">

<defs>

<symbol id="linkedin-badge">

/\* This is where you would put the contents of the SVG 

 (everything that is inside SVG tag except the tag itself) \*/

</symbol>

</defs>

</svg>

// And this is how you would use it 

<svg

width="32"

height="32"

viewBox="0 0 32 32"

version="2.0"

>

<use href="#linkedin-badge" />

</svg>

)

}

```

Of course, you can just copy-paste it, but it will make the size of your HTML document bigger and delay the [FCP](https://web.dev/first-contentful-paint/).  
<!-- -->You could also export it to a file, and load it through the `image` element, but it would cause flicks, which you probably don't want to have, especially when the element is above the fold.