teleren/devto huggingface dataset:
GitHub Actions for Node Modules in a Monorepo
Tags: github, node, monorepo, actions
Published: 2020-09-12 17:53:10

One of the projects I have been working on uses a monorepo, where we have multiple frontend applications with shared private dependencies. We decided all of our shared node modules would live under one top-level folder to keep things organized. When it came time to set up our CI for the project, I found that writing some custom bash scripts was the easiest way to avoid setting up a workflow per module.

This strategy might not work well for you if you have quite a few private packages; however, since we only have a handful, I determined our best bet would be to have one workflow that ran anytime any of our packages were updated. As we keep all of our these packages under a folder named `private_modules`, I set the workflow to target anything with a path of `private_modules/**` and then had it run a custom shell script that could take in a yarn script to run. We're using [yarn](https://yarnpkg.com/) to manage our dependencies, but this should work with npm as well.

```yml
name: Private Packages

on:
  pull_request:
    paths: 
      - "private_modules/**"

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [12.x]
    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: yarn install and test
      run: |
        cd private_modules
        ./yarn_run.sh test
```

As you've seen, all we have to do without our workflow file is `cd` into the top-level directory and run our bash script. If you need to run more than one yarn command, you can either add a new step for each command or update the bash script to take multiple commands.

The bash script itself is straight forward. It will loop through all of the subdirectories within the folder, install any dependencies, and then run the yarn script specified in the arguments. This way, we could use it for all of our CI steps, whether it be linting, testing, or publishing.


```bash
#!/bin/bash

CMD=$1

dir_resolve()
{
cd "$1" 2>/dev/null || return $?
echo "`pwd -P`"
}

for dir in ./*/
do
    (
      abs_path="`dir_resolve \"$dir\"`"
      echo "Installing $abs_path"
      cd $abs_path
      yarn install
      yarn run $CMD --max-warnings=0 2>/dev/null
      if [ $? -ne "0" ]
      then
        exit 1
      fi
    ) || exit 1
done
```

Using this bash script has kept our workflows both easy to manage and maintain. The main thing to keep in mind is that every package will need to have the yarn command configured that you intend to pass into the bash script, or the script will fail.

_Originally published on [jessie.codes](https://jessie.codes/article/monorepo-github-actions)_
moar-sarcasm plz: A tOtAlLy NeCeSsArY web components tutorial
Tags: webcomponents, javascript, silly, tutorial
Published: 2020-09-12 17:51:42

[Banner Image from TheSpongeMock on twitter](https://twitter.com/TheSpongeMock/status/863966406592925696)
 
The world needs more sarcasm.... Oops... sorry, I just realized that this is not funny to you because you can't see the intonation in my voice as I type. Hold on (takes 17 minutes). Ok this is much better...
## Demo pen
{% codepen https://codepen.io/btopro/pen/LYNmXrP %}

## Video of how I made this
{% youtube a0I8_5syU7o %}

Great, NOW I can appropriately troll with minimal effort. If this VanillaJS element doesn't make you smile then... I don't care, it was still fun and provides a great example of baking complex functionality into a small web component with ZeRo DePeNdEnCiEs.
## Resources
- [npm install @lrnwebcomponents/moar-sarcasm](https://www.npmjs.com/package/@lrnwebcomponents/moar-sarcasm)
- [Sarcasm in WHATWG spec](https://html.spec.whatwg.org/#the-q-element)
- [nth child CSS](https://www.w3schools.com/cssref/sel_nth-of-type.asp)
- [Mutation Observer for text changes](https://stackoverflow.com/questions/40195514/mutation-observer-not-detecting-text-change)
What's the output?
Tags: javascript, webdev, codenewbie, quiz
Published: 2020-09-12 17:49:28

```
const result = -1 ? 'foo' ? null : -1 : 1;
console.log(result);
```

.
.
.
.
.
.
.
.
.
.
.

Output: `null`

---
**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack  
**[codedrops.tech](https://www.codedrops.tech/)**
Necessity is mother of invention
Tags: python, pdf, webscrapping, pydroid3
Published: 2020-09-12 17:37:07

During this lock down my mother came to me asking for her Gujarati news paper. As news paper weren't allowed to be distributed in our residential complex i tried to find an e-paper for her. The paper was available on the news paper's website for free but issue was all pages were stored as PDF files but stored as 1 file per page.

I am big fan of Python's approach to find solution for practical problems and ever growing list of modules and libraries for anything under sun. 

I followed an experiment model and combined different methods to get the required result.

I use BeautifulSoup to scrap the data and PYPDF2 to read and merge files with tips from Stakeoveflow :)

Below is the code. This gets me a single PDF in a directory with today's date. She is able to run this from her smart phone using Pydroid3.

from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
import requests
import os
from datetime import datetime

today=datetime.today().strftime('%d-%m-%Y')
if not os.path.exists(today):
   os.mkdir(today)

os.chdir(os.path.join(os.getcwd(),today))

req = Request("http://www.newspapaersomething.com/frmEPShow.aspx")
html_page = urlopen(req)

soup = BeautifulSoup(html_page, "lxml")

links = []

for link in soup.findAll('a'):
    links.append(link.get('href'))

mylist=[]
del links[0:15]
mylist=links

cnt=len(mylist)
i=0
urlnew = [None] * cnt

while True: 
    urlnew[i] = mylist[i]
    r = requests.get(urlnew[i], allow_redirects=True)
    z=urlnew[i].split("/")
    name=z[-1]
    open(name, 'wb').write(r.content)
    i = i + 1 
    if(i >= cnt): 
        break


from PyPDF2 import PdfFileMerger,PdfFileReader

def mergeIntoOnePDF(path):
    f=path+"/"
    pdf_files=[fileName for fileName in os.listdir(f) if fileName.endswith('.pdf')]
    merger=PdfFileMerger()
    for filename in pdf_files:
       merger.append(PdfFileReader(os.path.join(f,filename),"rb"))
    merger.write(os.path.join(f,"merged_full.pdf"))

mergeIntoOnePDF(os.getcwd())
I discovered OpenUP methodology
Tags: agile, agilemethodology
Published: 2020-09-12 17:36:01

Usually when people talk about agile methodologies present examples like Scrum, Kanban or XP (Extreme programming) but in my 5 years working in software and 10 since I began my studies, I had never heard about OpenUp, but last week my teacher talked about it and intrigued me. 

OpenUP is an iteratively incremental method of software developments,  that uses iterative and incremental principles within a structured lifecycle. OpenUP uses a pragmatic philosophy of flexible development, which is based on a collective approach to software development. What struck me the most was how little the companies in my country (Colombia) know about it, so I wanted to give a little resume.

This method allows us to have defined the roles in the project:
- Stakeholder: represents interest groups whose needs must be satisfied with the project. 
- Analyst:  represents the customer and end-user concerns by gathering input from stakeholders to understand the problem and write the requirements.
- Architect: is responsible for designing the software architecture, this person takes the key technical decisions.
- Developer: is responsible for developing a part of the system
- Tester: is responsible for test the solution.
- Project Manager: leads the planning of the project. 

That's helpful because not every person in the team has to be an expert (in this case senior developer). After all, the team can rely on the architect for guide and information and into the Project manager for the tools needed. Another key component about OpenUp is the life cycle, this method has four defined phases for the project: Inception (Getting the requirements), Elaboration (Planing the architecture), Construction, and Transition, each phase could contain one or more iterations but in each one of them we will encounter 6 categories of tasks:
- Business Modeling
- Requirements  
- Analysis and Design
- Implementation 
- Test
- Deployment

The work intensity needed in each of the tasks will vary in relation to the iteration necessity and in the phase in which the project is located.

And for the last part in this post, I want to mention that in an OpenUP project each member of the team contributes their work in micro increments, which typically represent the outcome of a few hours to a few days of work, and daily they give a little retrospective of the work of that day, which increases visibility, trust and teamwork.

Thank you for reading!
Adding a Twitter timeline to your website: 4 easy steps.
Tags: webdev, tutorial, top7
Published: 2020-09-12 17:28:01

Originally posted on my Twitter page via a thread.

{% twitter 1303773277555433474 %} 


I have been learning more and more everyday about HTML & JS. 

I am very active on Twitter and wanted to incorporate my Twitter feed on to my personal portfolio site, I managed to do this in 4 easy steps (Lucky for us - Twitter produce the code snippet for you, to insert into your HTML body via `a & script` tags)

Check it out here:

1 - Head on over to [Twitter] (https://publish.twitter.com/#) & from the drop-down menu, choose which option you would like to display on your page, it can either be a single tweet, a collection, a handle or a profile. 

Here, I've selected the collection option, to display a list of my tweets which are accessible by scrolling up and down.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/htn1qhg14m20o3bwtr5j.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/miwigccpvjmbhk0vgnh6.png)


2 - An option will be given to either display an embedded timeline, or Twitter buttons. Select the one you wish to use - the embedded option displays tweets in list order, whereas the Twitter buttons just display a follow/tweet button linked to your profile. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nzkedc32vy9e0ib2y99b.png)

3 - One of my favourite parts of this, is the ability to customise it and make it more accessible to the user, and to fit in with your website design/layout. There is a light/dark option along with height/width, you can even choose a particular language for your timeline to be displayed in! Cool huh? 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/itahanhegildvg3b5ci7.png)

4 - Once customised, This is the super easy bit! An individual code snippet is produced for you to copy and then paste into your site's HTML body, wherever you want to display it! - All done!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0ynyi3w54iy83tiwu4sw.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/liqxvboegajbnsi6o0an.png)



Thank you for reading my article!
Running Kubernetes on MacBook, without minikube
Tags: kubernetes, beginners, macbook
Published: 2020-09-12 17:23:20

# Docker on Mac with Kubernetes

Docker on mac version 2.3.0.4 is come with default support of kubernetes. Kubernetes support with docker on mac is available since 18.06 stable or higher, but by default kubernetes is not enable, you have to enable it which we will see how to do it
![Screenshot 2020-09-12 at 22.49.10](https://dev-to-uploads.s3.amazonaws.com/i/78ovn2kg6fz65n6e356i.png)
 
It is very easy to enable kubernetes. 

1. Go to Preferences of Docker on Mac
![Screenshot 2020-09-12 at 22.54.58](https://dev-to-uploads.s3.amazonaws.com/i/hh7e8xt35mxran4n6yve.png)
 
2. Select kubernetes and click on enable kubernetes checkbox. finally restart and observe Kubernetes status. 
![Screenshot 2020-09-12 at 22.56.15](https://dev-to-uploads.s3.amazonaws.com/i/127qf2k3ehqezxresg33.png)
 
If you are lucky enough kubernetes satus might get turn from starting to running state. But don't worry if kubernetes is not getting started perform following action. 

> go to terminal and run following command
`rm -rf ~/Library/Group\ Containers/group.com.docker/pki/`
`rm -rf ~/.kube`
finally 
restart Docker for Mac:

after restart give 5 mins for kubernete to start and you will see following 

![Screenshot 2020-09-12 at 23.04.04](https://dev-to-uploads.s3.amazonaws.com/i/2tmhkhek467t46czpqf6.png)
¿Cómo ser un programador?
Tags: beginners, javascript, codenewbie
Published: 2020-09-12 17:15:56

Hoy, 12 de Septiembre es el día 256 del año 2020, y cómo ya es sabido entre la comunidad de los programadores, es nuestro día.

Este pequeño POST tiene 2 objetivos:

1- Saludar a quienes ya han escrito sus primeras líneas de código.
2- Sumar más gente a la tribu.

### Vamos por el objetivo #1:

```
${Inserte su nombre}, ¡FELIZ DÍAAAAAA!
```



### Okey, vamos por el objetivo #2:

Desde un principio voy a dejar claro que todos somos programadores. Si alguna vez organizaste una reunion con amigos o diste indicaciones de cómo llegar a algún sitio, de manera implícita insertaste un algoritmo en la cabeza de esa persona para que realice una serie de acciones y cumpla un objetivo.

Ahora bien, un programador no se gana la vida programando personas (al menos los que yo conozco), sino que le ordena a una computadora lo que tiene que hacer para llevar a cabo alguna actividad. 

Esto se puede hacer a través de distintos lenguajes, cada uno con sus particularidades, pros y contras. 

Pero a fin de no alargar mucho más el cuento, hoy le vas a hablar a una computadora en Javascript y de una vez por todas vas a ser un programador con todas las letras.

Seguime...

1- Abrí un navegador (de preferencia __Google Chrome__ está en casi todas las PC y con este vamos a hacer el tutorial).

2- Abrí una pestaña nueva (cómo cuando vas a googlear algo).

3- Hacé click derecho en cualquier parte de la pestaña y seleccioná _"inspeccionar"_ (Es la última opción, también podés presionar F12 o Ctrl+shift+I).

4- Se va a abrir una pestaña con muchas cosas, te vas a fijar en la esquina superior izquierda. De izquierda a derecha vas a leer las opciones: Elementos, consola, etc...

5- Selecciona la opción __"consola"__. Ahí vas a ver un símbolo __">"__ y a su lado un cursor que te está pidiendo a gritos que escribas algo.

6- En ese cursor, escribí: 

```
console.log('Hello world!');
```

-----

Y en este punto quiero que me prometas algo: 

Si al presionar __"enter"__ la consola te responde con un "Hello world!", vas a seguir aprendiendo, desarrollando y compartiendo tu conocimiento con la comunidad, siempre va a haber alguien dispuesto a ayudarte o que necesite tu ayuda.

Si no ocurre eso, me contactás y vamos a solucionarlo. Este es mi twitter: [@fecocode](twitter.com/fecocode).

-----

7- Presioná enter.


Ahora sí...

```
${Inserte su nombre}, ¡FELIZ DÍAAAAAA!
```
GSoC and Open-source contribution.
Tags: opensource, codenewbie
Published: 2020-09-12 16:58:30

I came across a LinkedIn in post which said that you can start GSoC with no coding experience!!! Is it true??? If yes how do we do it??? Also how do one can get started with open-source contribution?? I am a flutter developer and developed some apps how do I contribute to flutter open-source? I need a roadmap. Please provide me with information.
Get Ready For HackAtom Week!
Tags: blockchain, hackathon, contest, challenge
Published: 2020-09-12 16:45:28

Here's a hackathon for all BlockChain Enthusiasts and beginners!

[HackAtom India: Build the Cosmos](https://www.hackerearth.com/challenges/hackathon/hackatom-india/?utm_source=devto&utm_medium=post&utm_campaign=hackatom) is the first Cosmos virtual hackathon for developers in India to begin their journey into the Cosmos ecosystem. Cosmos provides high-performance, flexible, and interoperable building blocks to create blockchains perfectly tailored for all types of applications from finance, computing, gaming, and more.

Themes of the hackathon include Decentralized Finance (DeFi), Interoperability, and Open innovation.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yz6n6h04erbw3xjncffu.png)

To get you started, participate in HackAtom week by attending these [awesome workshops](https://www.hackerearth.com/challenges/hackathon/hackatom-india/custom-tab/upcoming-workshops/?utm_source=devto&utm_medium=post&utm_campaign=hackatom-workshop#Upcoming%20Workshops):

1) **Building Multi-chain Smart-contracts using Cosmwasm by Ethan Fray, Founder at CosmWasm**
*14th September 2020 at 5:30 PM IST*

2) **Starport: The fastest way to launch a Cosmos blockchain by Denis Fadeev, Director of Developer Experience at Tendermint**
*15th September 2020 at 6:30 PM IST*

3) **Learn how to set up an Ethermint development environment and use Ethereum tooling on Ethermint! by Elizabeth Binks, Software Developer, Chainsafe**
*16th September 2020 at 9:00 PM IST*

4) **Powering DeFi using Cosmos SDK by Deepanshu Tripathi, CTO at Persistence One**
*17th September 2020 at 5:00 PM IST*

While the human ability to come up with innovative applications is limitless, we often find ourselves encumbered by complicated blockchain frameworks that hinder our ability to create what our minds imagined. We believe the tools Cosmos provides change that, and we want to see what groundbreaking tools and applications you have to offer.

[Click here to know more about HackAtom and the workshops!](https://www.hackerearth.com/challenges/hackathon/hackatom-india/?utm_source=devto&utm_medium=post&utm_campaign=hackatom)
[Tutorial Linux] Terminal: copiando arquivos e diretórios
Tags: cp, terminal, linux, womakerscode
Published: 2020-09-12 16:42:13

## Copiar um arquivo

Para copiar um arquivo, digite no terminal:

```
$ cp <nome_do_arquivo_original> <nome_da_cópia>
```

- **$** indica que você deve usar o **usuário comum** para fazer essa operação.

- **cp** do inglês, copy, para copiar um arquivo.

- digite o nome do arquivo sem os sinais **< >**.

## Copiar um diretório

Para copiar um diretório, digite:

```
$ cp -r <nome_da_pasta_original> <nome_da_pasta_cópia>
```

- **-r**, vem de recursivo, pois será necessário percorrer a árvore do diretório a ser copiado, recursivamente, para copiá-lo.

## Copiar um arquivo para dentro de um diretório

Para copiar um arquivo para dentro de um diretório, digite:

```
$ cp <nome_do_arquivo_original> <nome_do_diretório_para_onde_se_deseja_copiar>
```

Exemplo:

![copiando arquivo para diretório](https://dev-to-uploads.s3.amazonaws.com/i/ahe6lb69yz8z0jwgw1sf.gif)

Caso o arquivo e/ou diretório não estejam onde você está no terminal, basta digitar o **caminho absoluto** até eles durante a cópia.

![copiando arquivo através do caminho absoluto](https://dev-to-uploads.s3.amazonaws.com/i/vhwft2zb6jig0vtwwuop.gif)
Using command line to get available domains for registration: open source
Tags: devops, beginners, marketing
Published: 2020-09-12 16:41:49

Hi, my friends,
I came across this a couple of days ago. I think it's really beneficial.
> I haven't done it yet.


NameBeta is a command line domain query application that is inspired by NameBeta.com.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dnjb2sx0dx2dmefffma5.gif)


You should get the repo here:


{% github TimothyYe/namebeta  %}


Please share your namebeta experience.
HOW DO YOU TRULY GET STARTED? (How does free work.... work?)
Tags: career, javascript, python, django
Published: 2020-09-12 16:30:44

I’m trying to get started with Web Design. I’ve been mainly using React and Vue. But recently I’ve been focusing on Python/Django because I want to be more specific to what I do.
Styling can be anything at times. 
I’ve gotten the tip to start “free work” to gain experience, HOW DO I TRULY START DOING THAT? 

Recently, (opposite way) I helped someone with a Wix Website, for free. The first site she had was bad, I helped and it looks great, BUT, she was ungrateful at the end and the FREE WORK, really was nowhere near what I wanted to do. No code, nothing. 
So, what type of “FREE WORK” should I look for? “HOW” I want to try and get a entrepreneur/ shadowing position (free) but I don’t Know what to look for.
js inheritance (part 2: OLOO)
Tags: javascript
Published: 2020-09-12 16:23:57

# Intro

A short blog about how you can achieve "inheritance" in js (second part, it's more about behavior and property delegation).
In this part I will try to demonstrate and explain a different approach how you can achieve "inheritance" (a more accurate
term is "delegation").

I read this technique in **Kyle Simpson's** book: *You do not know javascript: this & object prototypes*.
I his book called this code style *Objects linked to other objects (OLOO)*, which I found to be simple and elegant.

## OLOO (Objects Linked to Other Objects, a different way of inheritance)

let's see this concept by investigating the following code example:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0shoalq2isu2q26gftgh.png)

1. First an object Team is created (literal syntax used)
2. This object has three properties, all of them are behaviors
3. In line 15, a new object is created, but this time by using the
   function *Object.create()* and as an argument the object Team.
   In this way the two objects are **linked**.
   Which means that the object *messi* can make use of the Team behaviors
   if the behaviors are not found in the object *messi*.
   So, those two objects are **collaborators**! We have a synergy between
   them.

4. In line 17, a property called *setTeamDetails* is assigned to *messi*
   object. It is a behavior, that internally makes two calls in functions
   *setTeamName* and *setTeamColor*, which both are not properties of *messi*.

    But, because the objects *messi* and *Team* have established a synergy,
    the *messi* object will **delegate** the work to *Team* object!

5. In line 22, *messi* calls the function *setTeamDetails*, which
   internally makes to calls on the Team object behaviors.
   This calls, assigns the properties *teamName* and *teamColor* to *messi*
   , by **implicit call**.
   (see more on my previous blog about **this** keyword [a link](https://dev.to/konstantinosblatsoukasrepo/find-the-player-javascirpt-this-keyword-ha0))

6. Finally, a call to showTeamInfo is made, again here messi object
   delegates to Team object (since the messi object doesn't has a property named showTeamInfo)

## To sum up

- Two objects can form a *synergy/link*, by using the *Object.create()* function
- If some behavior is not found in one object, this object can *delegates/look up* this behavior
  in the other object that collaborates with. (This is one way relationship)
- New properties can be assigned to an object by using another object (in our example, messi
  object used Team object to assign two new properties teamName and teamColor)

Cheers!