teleren/devto huggingface dataset:
How to understand any codebase
Tags: programming, codenewbie, testing, tutorial
Published: 2020-12-15 07:57:45

I used to freak out whenever I joined a new client. To be productive fast, I have to figure out how their sometimes massive codebase works in a few days. It’s a humbling situation, but one we can speed up with a neat trick.

Whenever I have to learn a new codebase, I start by writing tests for it. They help me see how small units of the project work. Where I begin doesn’t matter all that much. There is no “wrong” place to start from, as any test teaches me something useful.

Functions with input and output are easy starting points. If I know what parameters a function takes, I don’t even need to know what it does before writing tests. Let’s test an imaginary `slugify` function:

```js
it('slugifies', () => {
  expect(slugify('Hello Code')).toBe(5);
});
```

It is possible but unlikely that this function would return a number. I **want** my test to fail at this stage, because that tells me what the function _really_ returns:

```diff
+> expected: 5
-> actual:   'hello-code'
```

Nice! So this call returns `'hello-code'` instead. I can now try another input:

```js
it('slugifies', () => {
  expect(slugify('Hello Code')).toBe('hello-code');
  expect(slugify('… what?')).toBe('…-what?');
});
```

Whether this second expectation passes or fails, I will learn something new about the code. I will know _what_ the function does, even though I still have no idea _how_ it does it. Once I have tests in place, I can change the function as much as I want. If my tests still pass, I know I didn’t break anything.

Next time you’re joining an existing project and don’t know where to start, try writing a few tests.

– Dom
Greatlivings
Published: 2020-12-15 07:54:10

__10 Best Flushing Toilets of 2020 – Reviews and Buyer’s Guide__

We can all agree that although it’s not the most glamorous appliance in our house, but it’s definitely one of the most important [https://greatlivings.com/best-toilet-reviews/](https://greatlivings.com/best-toilet-reviews/).

Well that in mind, we’ve gone compiled a list of the best toilets for home to help you make this very important decision. You’ll find reviews for our top ten toilets picks to aid in your quest to find the one throne to rule them all.
GitHub's New Appearance Setting: Dark Theme
Tags: github
Published: 2020-12-15 07:54:04

It's about time, my favorite website has now a **Dark Theme**.

 [2020's GitHub Universe](https://githubuniverse.com/)  came in with a lot of new goodies and features for the developers and GitHub users.

Of all the new features, the Dark theme on GitHub and the Emoji skin tone really caught my eyes. Here's a quick guide on how to adjust your appearance settings:

Go to the Appearance tab on your  [GitHub settings](https://github.com/settings):

Or quickly use this link  [https://github.com/settings/appearance](https://github.com/settings/appearance) - Ensure to be logged in to your account 

Default theme:
Select The theme of your choice and even more! Emoji skin tone

![light.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1607536790984/dMGzskbOC.png)

Dark Theme

![dark.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1607536856252/WdvCcf6ah.png)

Now that's just a few of the new stuff from GitHub this year, be sure to go through GitHub's blog to view more cool stuff.


%[https://github.blog/2020-12-08-new-from-universe-2020-dark-mode-github-sponsors-for-companies-and-more/]
Get confused- how can you trust Cash app with my SSN?
Published: 2020-12-15 07:53:31

Are you perceive for how can you trust Cash app with my SSN to access its all services without any clog? Ok, does have. SSN, it is basically a social security number that you have to create at the time of sign up for a new account. But, you have to put only the last four digits of it to verify your identity. So, must read this full article to know the exact point about it.

One of the common questions that we receive here by the users, they ask can I trust Cash app with my SSN. So, in this blog, we are going to discuss SSN, how safe it is, why it needs to enter, and many more. So, come with the below guidelines. Before going for troubleshooting points, we must know some basic details.

How Cash app work:-

While you set up an account on Cash app after entering the confirmation code, it asks you, how you are going to use, business, or personal. You can select anyone as per your choice. Even, it is personal bydefault, but you can switch it by navigating the app settings.

How to send money:-

❏	You can use Cash app on your mobile phone.
❏	Make transactions via Cash.me website.
❏	If you are an iOS user, then you can use Cash’s iMessage.
❏	You can also ask Siri to send money to you.

How to receive money:-

❏	You must link a bank account or debit card to deposit money into your bank account.
❏	You are allowed to request a free Cash card to spend money from Cash app balance.

What the limit to spend money:-

You can spend up to $250 in a week without verifying your identity on Cash app. To increase the spending limit, you have to verify your identity by providing the last four digits of SSN, DOB, full username.

Conclusion:-  In this post, we talk about can you trust Cash app with my SSN. If any issues, then contact our tech support team.
https://www.gonetech.net/can-i-load-cash-app-card-at-walmart/
Advent of Code 2020: Python Solution Day 15
Tags: adventofcode, algorithms, challenge, python
Published: 2020-12-15 07:39:52

Now elves are causing our system to heat up. First part was easy because we only had to loop until 2021 but the second part is insanely huge. First I used normal dictionary and list for first part. And speed was not a problem for first part. But for second part, time we need is `14,851.485` more than for the first part. So after scrolling more and more [reddit](https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/) threads, I knew `defaultdict` and `deque` is the best option. 

## Part 1 and 2

```python
from collections import *
def day15(filename, turns):
    with open(filename) as fp:
        lines = [l.rstrip() for l in fp.readlines()]
        lines = [int(l) for l in lines[0].split(",")]
                 
    num_to_speak = lines[-1]
    turn_num = defaultdict(deque)
    
    for v, k in enumerate(lines):
        turn_num[k].append(v+1)
        
    turn = len(lines)+1
    while turn<=turns:
        l = len(turn_num[num_to_speak]) 
        if l>1:
            num_to_speak = turn_num[num_to_speak][-1] - turn_num[num_to_speak][-2]
            turn_num[num_to_speak].append(turn)
        elif l==1:
            num_to_speak = 0
            turn_num[num_to_speak].append(turn)
        else:
            num_to_speak = 0
            turn_num[num_to_speak].append(turn)
            
        turn+=1
    print(num_to_speak)

day15("day15.txt", 2020)
day15("day15.txt", 30000000)
```
**Please share your solution too.**
Wanna know- can you put money on a Cash app card at an ATM?
Published: 2020-12-15 07:22:28

Are you thinking for can you put money on a Cash app card at an ATM? Well, does have. Here are many facilities that attract users to use this online mobile banking application (s). So, it is confirmed that you also curious to know the exact point. So, read this article carefully.

Here, we receive many requests from users that ask to put money on a Cash app card at an ATM. Yes, you can. But, you can withdraw money from ATM which is in your Cash app balance and only within 60 days from the payment initiate date.

How to withdraw Cash app money with Cash card from ATM?

Yes, you will become happy to know that you can use Cash Card to withdraw Cash app balance from ATM in simple steps. One more good news is that user can withdraw money from any certified bank without any issues 24*7. All the verified users are eligible to get a decent Visa debit card.

Cash app card work as same as the other bank card does and it is secured by an entry PIN. Your all information is encrypted into the embedded microchip.

What the limit to withdraw money from ATM?

Here, we mentioned the limit for every user to withdraw money from the ATM. Go with the below details:

❏	Only $250 per transaction
❏	$1000 in 24 hours
❏	$1000 in 7- days period
❏	$1250 in 30- days period

Generally, a bank doesn’t offer any cashback for using their debit card, but Square app does. Square app offers cashback to the user for the regular use of a Visa debit card. One thing, you have to point, that whenever you are going to check balance on ATM, then you will see $0.0 on the screen. So, you have to check it on your mobile phone.

Conclusion:-  In this post, we talk about can you put money on a Cash app card at an ATM. If you have any doubts, then contact our tech support team to get tech solutions.
https://www.gonetech.net/can-i-load-cash-app-card-at-walmart/
I'm looking for Django and react programmer to exchange knowledge.
Tags: django, react
Published: 2020-12-15 07:14:45

I'm trying to create a tweet clone using Reactjs +Typescript and Django. Currently, I'm following this tutorial [Create a Twitter-like](https://youtu.be/f1R_bykXHGE), but I think it is much better if I can work with a team where i can teach you and you teach me...
[my_repo](https://github.com/aliplutus/Tweet-clone-Tweetme-2.git)
Advent of code - Day 14
Tags: javascript, typescript, adventofcode
Published: 2020-12-15 07:07:45

Are you participating in the [Advent of code](http://adventofcode.com) this year?

If you don't know what the advent of code is, it's a website where you'll find a daily challenge (every day it gets harder). It's a really fun event, you should participate!

I try to solve the exercises using either JavaScript or TypeScript and will share my solutions daily (with one day delay so no one can cheat!). I only share the solution for the second part.

Damn, this one got me a little crazy. I couldn't manage to realise that the numbers you receive as inputs are 36 bits long. So bitwise operation would fail! (the first 4 bits would be discarded). This is why you can see the `orMask` and `andMask` are unused in my solution. I ended up rewriting entirely the bitwise operations using strings to try to understand what was happening... Thanks JavaScript...

With proper bitwise operation, the solution would be way simpler. For each line, you would just compute `memory[address] = ((value | orMask) & andMask) >>> 0`.

Note that it would be possible to use bitwise in JavaScript, you would just need to extract the first 4 bits into a different number to apply the mask there, then recombine the number together... But I didn't have the motivation to redo it!

Here is my (string-based) solution for day #14:
```js
const sections = 
  .split('mask = ')
  .filter(Boolean)
  .map((str) => str.split('\n'))
  .map(([mask, ...actions]) => {
    return {
      mask,
      orMask: parseInt(mask.replace(/X/g, '0'), 2),
      andMask: parseInt(mask.replace(/X/g, '1'), 2),
      actions: actions.filter(Boolean).map((action) => {
        const [addressPart, valuePart] = action.split(' = ')
        return {
          address: parseInt(/\d+/.exec(addressPart), 10).toString(2).padStart(mask.length, '0'),
          value: parseInt(valuePart, 10),
        }
      }),
    }
  })

function getAddresses(address, mask) {
  if (!mask.length) return ['']
  const addresses = getAddresses(address.slice(1), mask.slice(1))
  if (mask[0] === '0') return addresses.map((a) => [address[0], ...a])
  if (mask[0] === '1') return addresses.map((a) => ['1', ...a])
  return [...addresses.map((a) => ['0', ...a]), ...addresses.map((a) => ['1', ...a])]
}

const memory = sections.reduce((acc, section) => {
  section.actions.forEach((action) => {
    const addresses = getAddresses(action.address, section.mask).map((a) => a.join(''))
    addresses.forEach((a) => {
      acc[a] = action.value
    })
  })
  return acc
}, {})

console.log(Object.keys(memory).reduce((acc, key) => acc + parseInt(memory[key], 10), 0))
```

Feel free to share your solution in the comments!

________________________

Photo by [Markus Spiske](https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText)
Why does ${this} happen on Google Hangouts in Firefox?
Tags: help, google, watercooler, bug
Published: 2020-12-15 07:04:24

So, I've been using GH for a while, and for a while it randomly stopped working (and it still isn't working), I thought it'd work if I just waited, assuming it was an issue with the site that Google'd fix.
Nope.

The issue is that the webpage background is just black, and none of the clickable items on the page are functional (except the one that helps redirect you to other Google services).
It looks like this:
![Black bg with non-functioning buttons. Img src: https://dev-to-uploads.s3.amazonaws.com/i/j09y5sgu17nuo739jeeq.png](https://dev-to-uploads.s3.amazonaws.com/i/j09y5sgu17nuo739jeeq.png)

So, why is this happening??
<br/>
Here's some info if it helps:
```ini
activePluginsAndExtensions = ["Adblock Plus", "VPN", "Google Translate", "Google Hangouts Web Messenger"]
deleteCookiesOnclose = true
sendDoNotTrackSignal = 1
protection = standard
version = 83.0 (64-bit)
```
I tried clearing my cache, but that didn't work.

Thanks in advance.
Cheers.
Laravel Fullcalendar Ajax CRUD
Tags: laravel
Published: 2020-12-15 07:03:37

Hi All,

This example is focused on laravel 8 fullcalendar example. this example will help you laravel 8 fullcalendar tutorial. Here you will learn how to use fullcalendar in laravel 8. you'll learn laravel 8 implement fullcalendar. Alright, let’s dive into the steps.

In this example, we will simply create crud application with fullcalender so you can easily create event, edit event by drag and drop and delete event. in this example we will create events table with start, edit date and title column. then you can add, edit and delete that event with database.


READ MORE: https://www.itsolutionstuff.com/post/laravel-8-fullcalendar-with-create-edit-delete-event-exampleexample.html
Project Universe game dev update
Tags: gamedev, indiedev, unity3d, opensource
Published: 2020-12-15 06:06:57

In space room pressurization & what gases fill the rooms matters!

Affects humans, aliens, flora & fauna!

Plants may not grow in oxygen; Matters mostly for open room hydroponics

Careful of mixing gases & rapid depressurization!

https://dev-to-uploads.s3.amazonaws.com/i/ekchxehsmlruyqvjpchg.png
DATATABLE
Tags: react
Published: 2020-12-15 06:06:55

I made a datatable by get data from API but in table i m fetching just first name, last name and email-id of customers  from API endpoint and  there is many fields like age,phone no. , etc. type .
I am made the first names a links by which i connected a component that when i click a "name" then that is  going  to next page but dont  show the full details of that customer.!!!! which is in api.. like age, phone no. etc(which columns i dont show in datatable)
i tried  a component method ,Params but nothing works
how can i fetch the api full  data of that particular ID   in next page.
Google servers down!
Tags: server, google, youtube, gmail
Published: 2020-12-15 05:04:40

The most essential products and services of google were down on 14th December 2020 from around 11:56 GMT. The hashtags #googledown and #youtubedown were trending on twitter, while the memes on the internet said "How should I Google that Google is not working?" This outage effected many users across the world and the trust of the users for the tech giant seemed to be deceiving.

The Google services and the error messages displayed were:
- YouTube: "Something went wrong" with a monkey
- Gmail: "We’re sorry, but your account is temporarily unavailable. We apologise for the inconvenience and suggest trying again in a few minutes. You can view the G Suite Status Dashboard for the current status of the service."
- Google Docs: "Google Docs encountered and error. Please try reloading this page, or coming back to it in a few minutes."

Although the Google has not officially commented on the outage yet, however a Google spokesperson said "Today, at 3.47AM PT (Pacific Time), Google experienced an authentication system outage for approximately 45 minutes due to an internal storage quota issue. Services requiring users to log in experienced high error rates during this period. The authentication system issue was resolved at 4:32AM PT. All services are now restored. We apologise to everyone affected, and we will conduct a thorough follow up review to ensure this problem cannot recur in the future"

As various third party applications/websites depend on Google based authentication (Sign in with Google) which is an Oauth 2 flow, hence some of those third party applications/websites would also focus on including a Facebook based (Sign in with Facebook) authentication method on their registration process. There might be a chance that Google stocks may take a small slump and Facebook stocks might rise up a bit, so invest accordingly.
Ansible Ad-Hoc commands for easy use 
Tags: ansible, devops, linux
Published: 2020-12-15 05:18:05

Hello Everyone,
I would like to share my first post here,
we know ansible is a great tool for automation in DevOps field. it has a great documentation though.
Ansible is maintaining its playbooks documentation great.
here, i would like to introduce some of you may know.
ad-hoc command is the one-liner ansible command that performs one task on the target hosts. It allows you to execute simple one line  task against one or group of hosts defined on the inventory file configuration. 
eg:

To get route table of a node
----------
root@kube-master:~# ansible all  -m shell -a 'route '
192.168.122.3 | CHANGED | rc=0 >>
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         _gateway        0.0.0.0         UG    0      0        0 enp1s0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 enp1s0

To check the available disk space
---------------
root@kube-master:~# ansible all  -m shell -a 'df -h'
192.168.122.3 | CHANGED | rc=0 >>
Filesystem                         Size  Used Avail Use% Mounted on
udev                               1.9G     0  1.9G   0% /dev
tmpfs                              394M  1.6M  393M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   19G   15G  3.5G  81% /
tmpfs                              2.0G   16K  2.0G   1% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              2.0G     0  2.0G   0%                  19G   15G  3.5G  81% 
root@kube-master:~#

To call a script
--------------
root@kube-master:~# ansible all  -m shell -a 'bash test.sh'
192.168.122.3 | CHANGED | rc=0 >>
hell world
root@kube-master:~#

here, we are using a module "shell" and applying the command on a target server. 

Hope you may get some extra knowledge from this post
Thanks
Sid
It's ok to Google
Tags: python, coding, programmer, google
Published: 2020-12-15 04:48:04

Yes, many newbies hesitate to google things related to coding and they think it is not a good habit for programmers to google.

BUT, it's alright to google as a programmer as coding is not about remembering things it's only about understanding the concepts. You can always use google to get the exact syntax you need but the wrongs that you should not do is that to copy the code from the net and just pasting it without understanding the concept behind it.
Destructure & Spread operator, Learn it now!
Tags: es6, destructure, spread
Published: 2020-12-15 04:39:00

Destructure is a beautiful ES6 standard which gives convenient way for a programmer to access the values from object or an array. People forget to use this and end up in bad programming habits in Javascript or React famliy.

Let's see where and all we can use destructure
1. [Functional Component](https://www.youtube.com/watch?v=GcK8k2wqRyY)
    * [Inside a function parameter](https://www.youtube.com/watch?v=GcK8k2wqRyY&t=170s)
    * [Inside a function body](https://www.youtube.com/watch?v=GcK8k2wqRyY&t=334s)
2. [Class component](https://www.youtube.com/watch?v=GcK8k2wqRyY&t=554s)
3. [Array Destructure](https://www.youtube.com/watch?v=GcK8k2wqRyY&t=748s)
4. [Spread Operator](https://www.youtube.com/watch?v=GcK8k2wqRyY&t=914s)
   * Array and object spread


Watch the below video which is explained in a beautiful way. 

{% youtube GcK8k2wqRyY %}
What are your thoughts on strapi.js?
Tags: javascript, discuss, backend, webdev
Published: 2020-12-15 04:06:07

I recently came across [strapi.js](https://strapi.io/). They describe themselves as,  "the next-gen headless CMS, open-source, javascript, enabling content-rich experiences to be created, managed and exposed to any digital device."
So I went ahead and bootstrapped a simple blog application. From the looks of things, it seems like a pretty decent resource.
To anyone that has used Strapi before, would you recommend it? which customizations does it offer? features like extending the user models, authentication, scalability, ease of hosting? How does it fair security-wise? What tips would you give to a beginner learning the CMS?
Ok here we go! | DevTo / DO Hackathon
Tags: dohackathon, javascript, react, docker
Published: 2020-12-15 04:04:44

### FIRST OF ALL
I must say dude, is my first hackathon, so i'm little nervous. Lets start. I plan to document my progress here and on my personal blog as the days go by.

##### The millionarie IDEA (or no)
I thought of a problem that I have at home and probably other people as well, the uncontrolled consumption of electricity, it is something simple but it can help you save some bills and at the same time inform the benefits of saving energy for the Earth as a page of destination.

#### DAY 0
You can see the repo [here](https://github.com/fullsnack-coder/lets-go-dohackathon)
- Creating the repo and first plan
I didn't do much today, let's say I was planning the phases that I will have to go through to finish this on time.

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

The first step to prevent them from seeing an empty page in the process is to publish a small React app with a countdown towards the estimated project completion date. 
There is a guide from which I was inspired, [here](https://www.digitalocean.com/community/tutorials/react-countdown-timer-react-hooks) you can see it.

**once created I will upload as seen in the next update with the link**

#### Resume steps
- create the landing page
- deploy the static resources
- implement node for some features (sockets and some endpoints)
- code refactor ...
- deploy all repo features on DigitalOcean throught an powerfull CI/CD tool >:)
- be happy eating pizza


**Its all for this article, see you in the next! Dont forget follow me for read this adventure...**
Tsgist
Tags: tsgist, cli, typescript, npm
Published: 2020-12-15 03:45:21

Tsgist is a CLI  made with commander and inquirer which helps you to create easy and customizable `tsconfig.json` files.To get started, install it by running the following command inside of your terminal
```bash
npm install -g tsgist
```
or , if you want to use it in a project, run:
```bash
npx tsgist init
```
This will, initiate a interactive inquirer, from which you can choose the framework you want the `tsconfig.json` for. You can make a `tsconfig.json` files for the following frameworks:
```bash
> Node
> ReactJS
> VueJS
> React-Native
> AngualrJS
```
Alternatively, you can contribute to the project on its [Github repo](https://github.com/Japroz-Saini/tsgist)

### TuringAI
`TuringAI` is a organization I created for Artificial Intelligence and Machine Learning.Visit its [Github account](https://github.com/turing-ai)