teleren/devto huggingface dataset:
Como deletar recursivamente todos as pastas node_modules do Windows, Linux e Mac
Tags: dev, linux, macos, node
Published: 2019-12-17 02:19:09

---
title: Como deletar recursivamente todos as pastas node_modules do Windows, Linux e Mac
published: true
date: 2019-12-17 02:15:31 UTC
tags: Dev,linux,macos,node
canonical_url: https://marquesfernandes.com/2019/12/16/como-deletar-recursivamente-todos-as-pastas-node_modules-do-windows-linux-e-mac
---

Quem desenvolve em [node](https://marquesfernandes.com/2019/03/05/afinal-o-que-e-nodejs) já percebeu que toda vez que começamos um projeto e executamos `npm install`, uma infinidade de dependências são instaladas e na maioria das vezes não nos preocupamos com a quantidade de arquivos e o espaço que eles podem ocupar em nosso disco.

Uma única pasta _node\_modules_ pode chegar a pesar entre 200mb e 1gb! Multiplique isso pela quantidade de projetos que se tem em seu computador e teremos um verdadeiro problema de armazenamento.

Recentemente precisei fazer um backup da minha pasta de projetos, mas ela estava pesando algo em torno de 20gb, o que tornou o processo extremamente lento, mesmo comprimindo, ainda precisava otimizar mais. Decidi então remover todas as pastas node\_modules e para minha ~~não~~ surpresa, o tamanho reduziu para apenas 2gb!

## Encontrando e listando todas as pastas _node\_modules_

Primeira vamos listar todas as pastas **node\_modules** dentro da pasta em que queremos procurar recursivamente, é importante analisar com calma para não deletar algo indesejado.

### Mac / Linux:

```
$ cd projects $ find . -name "node\_modules" -type d -prune -print | xargs du -chs
```

### Windows:

```
$ cd projects $ FOR /d /r . %d in (node\_modules) DO @IF EXIST "%d" echo %d"
```

Eu estou usando o [emulador de terminal](https://marquesfernandes.com/2019/10/07/melhores-emuladores-de-terminal-para-windows) do GitBash que me permite o uso do comando rm -rf no Windows.

## Deletando todas as pastas _node\_modules_

Agora vamos adicionar ao nosso comando a opção de deletar. **ESSE PROCESSO É IRREVERSÍVEL** , tenha certeza do que está fazendo.

### Mac / Linux:

```
$ cd projects $ find . -name 'node\_modules' -type d -prune -print -exec rm -rf '{}' \;
```

### Windows:

```
$ cd projects $ FOR /d /r . %d in (node\_modules) DO @IF EXIST "%d" rm -rf "%d"
```

#### Windows PowerShell:

```
Get-ChildItem -Path "." -Include "node\_modules" -Recurse -Directory | Remove-Item -Recurse -Force
```

O post [Como deletar recursivamente todos as pastas node\_modules do Windows, Linux e Mac](https://marquesfernandes.com/2019/12/16/como-deletar-recursivamente-todos-as-pastas-node_modules-do-windows-linux-e-mac) apareceu primeiro em [Henrique Marques Fernandes](https://marquesfernandes.com).
JavaScript or Frontend centric conference to attend in 2020?
Tags: conferences, discuss, css, javascript
Published: 2019-12-17 02:35:14

---
title: JavaScript or Frontend centric conference to attend in 2020?
published: true
date: 2019-12-17 02:05:30 UTC
tags: conferences, discuss, css, javascript
canonical_url: https://www.iamdeveloper.com/posts/javascript-or-frontend-centric-conference-to-attend-in-2020-m44/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/yy5za1fjbfq1m3jh6wvk.png
---

The only conference I’ve ever attended was [JBCN](https://www.jbcnconf.com/2016/) in 2016 for Java when I worked in Barcelona because my company at the time was a sponsor.‪

I’ve never been to a JavaScript or frontend centric conference before. If you were to pick one to attend, regardless of location and cost, which one would you choose?‬

<center>
<img src="https://media.giphy.com/media/OvDTq5V3EepBS/giphy.gif" alt="Morphius asking Neo to choose the red or blue pill" />
</center>

P.S. I’m also a fan of React, so the conference could be React centric.
Day 53 : Whenever
Tags: hiphop, code, coding, lifelongdev
Published: 2019-12-17 02:03:14

_liner notes_:
- Saturday : Whenever I do the radio show, it's always an adventure. haha Even after 11 years broadcasting. I was running super later for the show and when I got to the station, there was someone in the room that I use to set up my equipment. I had to think fast and try condense everything unto one table. Still had a great time and you can check out the show at kNOwBETTERHIPHOP.com I did the post radio show work pretty quickly and got the recording online with timestamps and different podcast apps. When I was done, I went to my van to prepare to spend the night in my van. It went okay expect I forgot to pack a blanket and it was freezing! Next time, I will definitely not forget! haha
![Man holding large wad of money to the side of his head](https://thepracticaldev.s3.amazonaws.com/i/wih0vfozykzfagz6nraq.jpg)
- Sunday : Got home pretty early in the morning and went to sleep for a little while longer. Didn't really do much coding at all. Watched some anime and did some planning for the van build out. Ordered my windows and found out that I wouldn't get them till February next year!
- Professional : Today, just did some topic research and on how I want to structure my blog post for this week. Also sat in on an all hands meeting. Good to hear what is going on in other parts of the company.

- Personal : Bought a few items for the van. I ordered a fridge, power station and composting toilet. Once I get everything in, I'll have a better idea of how I want things placed in the van. Then I'll get the framing I need to put it all together.  

![Arial view of Plougonvelin, France with blue skies, clouds and a peninsula and water](https://thepracticaldev.s3.amazonaws.com/i/v3glbm2nseodpyb72cdp.png)

Going to see if I can get some more work done on the backend / admin side of my side project. Been slacking on it a lot.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube YXTTiX5w5DE %}
Ensuring Docker Compose Startup with Systemd
Tags: linux, containers
Published: 2023-01-06 01:48:08

---
title: Ensuring Docker Compose Startup with Systemd
published: true
date: 2019-12-17 01:57:36 UTC
tags: Linux,Containers
canonical_url: https://brandonrozek.com/blog/composesystemd/
---

I’ve been having trouble getting some docker containers such as `nginx` to start automatically on bootup, even with the `restart: always` flag.

To compensate, I wrote a small systemd script and enabled it on startup.

`/etc/systemd/system/docker-compose.service`

```
[Unit]
Description=Docker Compose Application Service
Requires=network.target docker.service
After=network.target docker.service

[Service]
Type=oneshot
User=brandonrozek
Group=brandonrozek
RemainAfterExit=yes
WorkingDirectory=/home/brandonrozek/docker/
ExecStart=/usr/bin/docker-compose up -d --force-recreate
ExecStop=/usr/bin/docker-compose down
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target

```

To enable on startup

```
sudo systemctl enable docker-compose

```

To start now

```
sudo systemctl start docker-compose

```
What is "enumeration" anyway?!
Tags: codenewbie, todayilearned, security, developing
Published: 2019-12-17 00:51:54

If you are new to development, or coding in general, you also keep hearing the word "enumeration". "Enumerate over this list" or "enumeration is key" or occasionally "just enumerate it". I don't know about you, but to me this doesn't make sense. Part of my coding bootcamp used the words too but lacked in any real explanation of it. I discerned that it was the process of doing something to each item in a list.

# So What is enumeration?
By definition _"an enumeration is a complete, ordered listing of all the items in a collection."_ (3) 

![](https://media.giphy.com/media/LR10n91YGFSJz3psO9/giphy.gif)
Soo... Its a list.. that's... not helpful... How can it be a list when it is used like a action??


# What is Enumeration Used For?
Well, in mathematics and computer science the term is commonly used to refer to a listing of all of the elements of a set.
In InfoSec it is used to refer to gather information from lists, such as usernames or group names, hostnames, network shares and services, IPtables and routing tables, service settings and audit configurations, application and banners, and SNMP and DNS details. (4)

![](https://media.giphy.com/media/Qtpdtlk9rpb8PKK0ih/giphy.gif)
Oh, that actually makes more sense. 
Enumeration is used for listing details in a list or a process of mentioning items in a list one by one.


# Where Do You Need to Enumerate?
In many languages you enumerate over a list to map the items in a list, group items in a list together, or perform a task, such as math, on each item in a list.
```listnumbers = [1, 2, 3]
listnumbers.each { |n| n * 2 }
=> [2, 4, 6]```


In Info Sec you hear a lot about enumeration and how important it is. 
Two examples of how it's used is to try and brute force a login with a list of usernames and well known passwords or finding what services are running, versions, open shares, account details, or possible points of entry by port scanning or passive fingerprinting.







<hr>

Happy Hacking
![](https://media.giphy.com/media/l3vRmVv5P01I5NDAA/giphy.gif)

#### References 
1. Security+ cert book
2. Web Application Hackers Handbook
3. https://en.wikipedia.org/wiki/Enumeration
4. https://resources.infosecinstitute.com/what-is-enumeration/#gref
5. https://resources.infosecinstitute.com/process-scanning-and-enumeration/#gref
6. http://www.knowthetrade.com/scanning.html


###### Please Note that I am still learning. If something that I have stated is incorrect please let me know. I would love to learn more about what I may not understand fully.
How to Upload and Download Files Pragmatically to Azure Blob Storage using VB.Net
Tags: azure, azurefilestorage, blob, vbnet
Published: 2019-12-17 00:21:23

In this [tutorial](https://github.com/patricksameerajayalath/AzureTutorials/blob/master/How%20to%20Upload%20and%20Download%20Files%20Programmatically%20to%20Azure%20Blob%20Storage%20using%20VB.Net.pdf) I’m going to show how to:

•	Connect to Azure Storage
•	List files/folders (CloudBlockBlob/CloudBlobDirectory) within an Azure File Storage
•	Create a Shared Access Signature for a Blob
•	Obtain Blob properties
•	Read content from a Blob
•	Write content to a Blob
•	Upload a Blob to Azure File Storage
•	Delete a Blob
•	Rename/Move a Blob
•	Download a Blob


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/7ocgrz8oku73iylkz8uo.jpg)


You can find the PDF version of this tutorial [here](https://github.com/patricksameerajayalath/AzureTutorials/blob/master/How%20to%20Upload%20and%20Download%20Files%20Programmatically%20to%20Azure%20Blob%20Storage%20using%20VB.Net.pdf).

You can find all my Azure/.Net tutorials [here](https://dev.to/patricksameerajayalath) and [here](http://sameerajayalath.blogspot.com/).

Enjoy !!
Hoisting: The most quirky term in JavaScript
Tags: hoisting, javascript
Published: 2019-12-17 00:01:44

# Hoisting in Javascript

Ever wondered how the **undefined** gets set to a variable when declared but not initialised or a function that gets **executed** even before its declaration?

Yes, I was one of them who used to think how a variable that was never initialised has a value called *undefined* in it when I first started with Javascript.

####*Variable hoisting*####

Let's look at a very simple example code below

{% runkit %}

console.log(greet);

var greet;

{% endrunkit %} 

this outputs *undefined* to the console, as per MDN, undefined is a primitive value automatically assigned to variables that have just been declared. 

The process of assigning the primitive undefined values to declared variables is called **hoisting** in Javascript.

Let’s look at when exactly hoisting happens when a javascript code gets executed.

Before I talk about this, I need to touch a concept called execution context in Javascript. Execution context is an abstract concept of an environment where the Javascript code is evaluated and executed in two different stages

1. creation phase
2. execution phase (I won’t be talking about execution phase in this post)

Creation phase is where the variable and function declarations are put into memory, but stay exactly where you have written them in your code. In the creation phase, all variables that are declared but not initialised with a value will be assigned `undefined` by javascript engine.

That is how we see *undefined* value for variables that are not initialised but used in your code.

As a good practice, avoid initialising variables with **undefined** in your code.

####*Function hoisting*####

Functions also get allocated in memory during creation phase, which will allow us to use a function before it is declared in the code. 

For example:

{% runkit %}

sayHello('World');

function sayHello(name) {
  console.log('Hello! ' + name);
}

/*
The result of the code above is: "Hello! World"
*/

{% endrunkit %}

Let's look at above code example, I called the function in my code first, even before the function is written, the code still works. This is because of execution context in JavaScript.

One thing to keep in mind about hoisting is, only declarations get hoisted in JavaScript, not the initialisations.

I hope this post helps to understand and clear confusion about variable and function **hoisting** in JS.
🇫🇷 Introduction à TDD en Swift (Partie 2) - Vive le typage et la généralisation
Tags: swift, tdd, ios
Published: 2019-12-18 07:34:58

---
title: 🇫🇷 Introduction à TDD en Swift (Partie 2) - Vive le typage et la généralisation
cover_image: https://academie.ryfacto.fr/images/2019/12/intro-tdd-2.jpg
published: true
date: 2019-12-17 00:00:00 UTC
tags: swift, tdd, ios
canonical_url: https://academie.ryfacto.fr/advanced-ios-craft/intro-tdd-swift-2-typage-et-generalisation.html
---

Cet article fait partie de la série _"Introduction à TDD en Swift"_

- [Introduction à TDD en Swift (Partie 1) - 7 étapes essentielles](https://academie.ryfacto.fr/advanced-ios-craft/intro-tdd-swift-1-7-etapes)
- **Introduction à TDD en Swift (Partie 2) - Vive le typage et la généralisation**
- [Introduction à TDD en Swift (Partie 3) - Une bonne documentation](https://academie.ryfacto.fr/advanced-ios-craft/intro-tdd-swift-3-une-bonne-documentation)

Dans le [précédent article](https://academie.ryfacto.fr/advanced-ios-craft/intro-tdd-swift-1-7-etapes) de cette série tu as appris les bases de TDD en faisant un cycle complet de 7 étapes.

Nous allons continuer aujourd’hui le kata [FizzBuzz](http://kata-log.rocks/fizz-buzz-kata) en implémentant plusieurs nouveaux tests en TDD.

Cela te permettra de mieux comprendre la profondeur et l’intérêt de cette pratique qui a changée ma manière de travailler.

Au programme :

- trois techniques de refactoring pour améliorer la qualité du code,
- l’utilisation du système de type pour éviter l’écriture d’un test,
- des propriétés intéressantes du TDD, au-delà des tests en eux-même,
- du fun comme jamais ! _(Ok ça c’est peut-être un peu exagéré !_ 😂_)_

Alors, prêt(e) ?

[Lire la suite...](https://academie.ryfacto.fr/advanced-ios-craft/intro-tdd-swift-2-typage-et-generalisation.html "Introduction à TDD en Swift (Partie 2) - Vive le typage et la généralisation")
Hyperledger Fabric (v1.1) Setup on Ubuntu 18.04 — Part III
Tags: hyperledger
Published: 2022-10-08 08:04:42

---
title: Hyperledger Fabric (v1.1) Setup on Ubuntu 18.04 — Part III
published: true
date: 2019-12-17 00:00:00 UTC
tags: hyperledger
canonical_url: https://sainath.tech/hyperledger-fabric-v11-setup-on-ubuntu-1804-part-iii
---

In the previous section Part - I we saw about the necessary pre-requisites for running the Hyperledger Fabric and in this final section, we will finally install the essential command-line tools to run the fabric development environment.

Install Composer-CLI using npm which is the essential aspect of fabric development using composer.

```
npm i -g composer-cli</span>

```

We will need Composer Rest Server in order to expose our business network as RESTful APIs.

```
npm i -g composer-rest-server</span>

```

In the previous post, you would have seen about Yeoman which is a scaffolding tool that we will be using here in order to pack the application assets related to fabric.

```
npm i -g generator-hyperledger-composer</span>

```

There is an online app called Playground for developing business network applications using hyperledger fabric. If you would like to have a local copy of it just install the package and use it from your local machine.

```
npm i -g composer-playground</span>

```

Create a folder called fabric-dev-servers and navigate to the folder.

```
mkdir ~/fabric-dev-servers cd ~/fabric-dev-servers</span>

```

Using CURL command fetch fabric-dev-servers tar file and unpack it using tar -xvf by passing the file to it.

```
curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz tar -xvf fabric-dev-servers.tar.gz</span>

```

Unzipping the folder will give you a list of files out of which you have to run `downloadFabric.sh` and prior to this kindly set the environment for the desired fabric version as mentioned in the code below.

```
cd ~/fabric-dev-servers export FABRIC_VERSION=hlfv12 ./downloadFabric.sh</span>

```

The `downloadFabric.sh` would install a list of docker images required for running the fabric. You can check the list of images using the command docker images. Ensure that you have all the images in the list as mentioned below in the screenshot.

Thats it and you are done. Before finishing there are few things to be noted. If you are using Ubuntu as a cloud instance or connecting a remote Ubuntu server, ensure that you dont do the fabric installation as a root user. Kindly create a new user and change your profile to that new user that you have created. At times if you dont have the right to perform or run docker commands, use sudo and execute it.
ERROR in Maximum call stack size exceeded - the unsual kind
Tags: typescript, angular
Published: 2019-12-16 23:41:21

Wow.... who would've known that the next issue would be right at the corner so soon. :grin:

I'm working on a markdown component, and I needed a list of colon emoji keys's (`:smile:`) to have simple overview for them :smile:


While angular was running, I created this [> file <](https://gist.github.com/negue/2110c5f87cad2367ddc65729454ded9b#file-example-emoji-list-ts) nothing happened.


When I imported it...

## `ERROR in RangeError: Maximum call stack size exceeded` happened
.... ok what ... why?!


Usually this error means, some module imported a different one which imported the previous one, which imported "the different"-one ... and so on.

Or it means just any methods called itself until the stack exceeded, but it wasn't a runtime error, it was a compiler error.

## Ok. Weird. 

What did I do before it... "just added a file"... right?

To make sure it is not a hiccup again, I restarted angular/typescript.

The error still happens.

Removed the file and its working again?!


## Lets try to debug it again.

Added the file back and started angular in verbose mode.

```
ERROR in RangeError: Maximum call stack size exceeded
    at needsIndentation 
```

```ts
        function needsIndentation(parent, node1, node2) {
            parent = skipSynthesizedParentheses(parent);
            node1 = skipSynthesizedParentheses(node1);
            node2 = skipSynthesizedParentheses(node2);
```

Sadly I haven't took a deep-dive into typescript (yet), but today wouldn't be the day either :grin:, but maybe there was already anything anywhere => searched for the first 2 lines, but I couldn't find anything useful.

## Solution. :tada:

Use an array of strings and then just `.join()` them together. [> Gist <](https://gist.github.com/negue/2110c5f87cad2367ddc65729454ded9b#file-working-emoji-list-ts)
Project failure lessons (let's learn together!)
Tags: productivity, project, business, startup
Published: 2019-12-16 22:31:29

---
title: Project failure lessons (let's learn together!)
published: true
description: Let's learn together and avoid common mistakes.
tags: productivity, project, business, startup
---

I think we spend a lot of time congratulating ourselves and others when our projects succeed. This is a great way to build up positive reinforcement but as we all know there are at least 5 failures for every 'success'. Sometimes this number is more like 50:1 or more.

Success can mean anything like getting your first paying customer, reaching 500 users or being featured in a large publication.

On the other hand, failure can happen for a plethora of reasons and usually is caused by more than one factor. I personally wouldn't even know of many of the reasons why my old projects failed. I want to learn from your experiences and I want everyone else on Indie Hackers to be able to learn too.

If you please;
- list one or more reasons why projects of yours failed in the past (possibly telling us how you found out/fixed it).
Catalog Your Blogs
Tags: blogs
Published: 2019-12-16 23:05:14

---
title: Catalog Your Blogs
published: true
description: 
tags: blogs
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/sq0pcxbict5dosj8trbx.jpg
---
Photo by [Maksym Kaharlytskyi](https://unsplash.com/@qwitka)

I've always loved writing.  When I entered the tech industry, it felt natural that I would gravitate towards the idea of blogging.  Many of my early articles were contributions for my company's website.  Company blogs are a great platform to write on.  I learned to work with other departments (usually marketing since they were the ones in charge of the website) and they were always very grateful to get more content.

As I moved from company to company, I tried to continue this practice.
One of the problems I have run across is, the internet is not really a permanent thing.  Websites get rewritten, articles get lost, companies sometimes remove the blogs of former employees.  

As a result, many references to my old blogs were suffering from link rot.

This is not really an uncommon thing.  But I had wish I had preserved the articles I've written since they represent past work that I'm proud of.

So with the help of the [Wayback Machine](https://archive.org/web/), I started collecting some of my past articles and putting them into a [GitHub repo](https://github.com/lizlam/p4blog).

My process for this looked something like:

1.) Find an old URL and look for it in the Wayback Machine
2.) Save a PDF or PNG using a [Chrome extension](https://gofullpage.com/)
3.) Commit to GitHub repo  

Having a catalog in GitHub works pretty well since I can browse the articles pretty easily and previewing PDF's and PNG's are not a problem.

![Blog in GitHub](https://thepracticaldev.s3.amazonaws.com/i/23ct2711ft6lah21k3jq.png)


They feel just as relevant as any side coding project I've ever done.

I also started collecting other articles I've written for other websites and made a [repo](https://github.com/lizlam/miscblogs) for those.


In conclusion, if you have blogs on other platforms and websites that are not your own, it's a good idea to keep record of it.  I was only able to recover a fraction of what I've written in the past from the Wayback Machine, but that is a good place to start.  I would also recommend putting current blogs in a repo for posterity, because you never know when those references will experience link rot as well.
How do you find mentors
Tags: discuss
Published: 2019-12-16 23:01:58

Recently I started learning [go](https://golang.org/), I wanted to learn a new backend language and after playing around a bit I started really enjoying it. However, being new to the language I am not sure if I am doing anything wrong or if there are better ways of doing things.

### The question is...

How do you go about finding mentors or people to look over your code to provide a second opinion? Unfortunately, none of the people I work with knows go so I can't turn to them.

Are there any websites or places you go to find someone to help you learn concepts and provide feedback on your work?

**Note**: This doesn't have to be go specific, any guidance on the subject will be great!