teleren/devto huggingface dataset:
TIL: Connecting to the host from Testcontainers
Tags: testing, todayilearned, java, kotlin
Published: 2020-11-02 22:51:23

> TL;DR: [Testcontainers](https://www.testcontainers.org/) allows you to expose a host's port to containers using `Testcontainers.exposeHostPorts(localServerPort);`.

A short reminder: for my Master's thesis I have to work with Selenium docker containers to automate Twitter accounts. My latest task was to make it possible to specify a proxy, which should be used by the Chrome browser running inside a container. That way, it want to fool Twitter about the true origin of an account, which is especially interesting if you want to automate multiple accounts at the same time on the same machine.

While setting the proxy has to be done using Selenium's `JavascriptExecutor.executeScript(..)` method in conjunction with JavaScript code accessing the [Proxy API for Extensions](https://developer.chrome.com/extensions/proxy) *(for more information, have a look at the example in [spring-selenium-pool](https://github.com/alxgrk/spring-selenium-pool/#-custom-chrome-extension))*, I finally wanted to test my setup.

As a mock proxy server, I decided to use [MockServer](https://mock-server.com/) - integration with Java/Kotlin is easy, as is defining stub responses. The final question however was: how could I connect to the MockServer running on the host from inside the Selenium container?

Luckily, Testcontainers guys got me covered. The [documentation](https://www.testcontainers.org/features/networking/#exposing-host-ports-to-the-container) provided the answer: `Testcontainers.exposeHostPorts(localServerPort);`.

That's all we need. Just make sure to run that line **before** your container starts, but **after** the mock server is running.

The host will then be available from inside the container at `host.testcontainers.internal` + your random local port.

What I understood it does under the hood, is to start another Docker container with an ssh-server that uses [port forwarding](https://en.wikipedia.org/wiki/Port_forwarding) to route all TCP traffic from the container of interest through the ssh-container to the host.

So in the end, here is the skeleton of the resulting test:
```kotlin
@SpringBootTest(classes = [TaskWithProxyTest.App::class],
        webEnvironment = SpringBootTest.WebEnvironment.NONE,
        properties = ["selenium.pool.size=1"])
class TaskWithProxyTest {

    // causes the container from spring-selenium-pool to come up
    @SpringBootApplication
    class App

    companion object {

        lateinit var mockProxy: ClientAndServer

        @BeforeAll
        @JvmStatic
        fun first() {
            val mockServerPort = SocketUtils.findAvailableTcpPort()
            mockProxy = startClientAndServer(mockServerPort)

            // necessary to access mockserver from container
            Testcontainers.exposeHostPorts(mockServerPort)
        }

        @AfterAll
        @JvmStatic
        fun tearDown() {
            mockProxy.stop(true)
        }
    }

    @Test
    fun `your test`() {
        // ...
    }
}
```
Day 247 : Look over your shoulder
Tags: hiphop, code, coding, lifelongdev
Published: 2020-11-02 22:44:56

_liner notes_:
- Saturday : Did the radio show from the park. It was pretty busy because it was Halloween. It was pretty chill day. Had a good time. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a scene from Michael Jackson's Thriller video where he turns around with the yellow eyes with the words Oct 31st 2020, Fell on a weekend](https://dev-to-uploads.s3.amazonaws.com/i/u6oz0yzpore7vybcpil9.jpg)

- Sunday : Got up early. Finally finished adding the last bit of features I wanted before letting people start to use. Once some folks use it, I think I'll get a better idea of what to do next. Then I went out to my parents' place because they need help with some stuff.

- Professional : Got to do a livestream with the team today. Of course my laptop lost internet connection with the WiFi right before the show was to start. Had a good time. Learned alot! After the livestream, I had back to back meetings. After that, did some online training and started working on a demo project for my next blog post.

- Personal : Last night, did some more coding, watched some shows and went to sleep. Also did some post radio show work.

![Light coming through trees in a forest in Ardennes, Belgium](https://dev-to-uploads.s3.amazonaws.com/i/gnj92igq6g45zux5tf7q.png)

Well, Election day in the US is tomorrow. Let's see what happens. Either nothing will happen or it could get pretty bad. Feels like it will be "Look over your shoulder" season for a little while. haha. Good luck to us all!

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube Yl_-3oSlWaU %}
My first open source contribution through hacktoberfest
Tags: hacktoberfest, machinelearning, datascience, opensource
Published: 2020-11-02 22:11:29

It was a great experience with hacktoberfest 2020🔥 and thanks for helping me know about open source, its importance and letting me realise how interesting and amazing open source contribution is.❤️👌

On the way to a new journey , hope to have a lot of fun.🙌
Hacktobarfest-born.
Tags: hacktoberfest, beginners
Published: 2020-11-02 22:01:36

Like every other junior developer out there, the fear of doing something new the wrong way always soaks me in my anxiety. When I came across the Hacktobar-fest flyer, I scrolled down without a second look. But deeply, I felt guilty. I felt guilty of not trying my hands on something related to my field, I felt guilty that I was running 'way from learning something new, then I decided that I'll be doing this not for the prize but for the experience! 

Be it as it may, I sent my four PRs on Oct 1st, with some hours difference. I was curious and nervous as to what my fate would be, and to my utmost surprise, my 4 PRs were accepted(one of the best moments of my life) after two-weeks of review. This has really encouraged me to try out more opportunities out there.



THANK YOU DIGITAL-OCEAN FOR THE IDEA OF HACKTOBARFEST!!!
My Goals for my 17th year on this planet
Published: 2020-11-02 21:55:15

It's my 17th birthday already?


> So I want to set some goals, not for 2020 or 2021 I'm gonna set it for my year I want to make a post about it because the first goal is to blog again I did it for like 3 months and I loved it but when I got home and school I stopped, So here I am doing my first goal


## Goals
* Blog 
* Do sports Swim, Bike, and Run (triathlon)
* Meditate
* Be more social
* Photography
* Contribute to open source (I couldn't participate in hacktoberfest)
* Grow my business
* Get my First Client
* Code Code Code

Next are SOME projects I want to FINISH (in React) and I want it to be production-ready

* My Personal Site (PWA)
* e-commerce store in Nextjs (JAM Stack)
* Blog (For my mom)
* Restaurant Site (and Sell it)
* Cinema site (connected to a real cinema(s))
* Overcome my fear of AWS
* Music Player
* A Secret project

That's all for now (I want to post it before 12 am So bye)

---

<center>Cover credits: <span><a href="https://unsplash.com/@popnzebra?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Pop &amp; Zebra</a> on <a href="https://unsplash.com/s/photos/happy-birthday?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span></center>

---

<center>*Thanks For Reading, I really appreciate it*</center>
After 5 years, want to restart to dev... What do you think?  
Published: 2020-11-02 21:49:45

I'm a girl of 37 years old. From 2006 to 2013 I've been a sw developer. In 2013 I have my daughter and in 2015 my second child. In 2017 I do a great course in Digital Marketing but I understand that my passion is more technical and in sw dev, although I'm creative. 
In these last 12 months read many to understand changes in sw, but I'm always afraid to fail and to miss all in past I've done!
I love Java and prefer backend, not very passionate of js and miriad of frontend frameworks.
Do you think is possible to reallocated in a few weeks?
Is sufficient see other in actions? How can candidate in job offers?
MMT Tech Meetup October 2020 - Featuring NightwatchJS, CodeceptJS and Cypressio
Tags: nightwatchjs, codeceptjs, cypress, automatedtesting
Published: 2020-11-02 20:51:18

---
title: MMT Tech Meetup October 2020 - Featuring NightwatchJS, CodeceptJS and Cypressio
published: true
description: This meetup covers both NightwatchJS, CodeceptJS and Cypressio talks
tags: NightwatchJS, CodeceptJS, Cypress, AutomatedTesting
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/qcultcb75kf92vv1sgo6.png
---

## MMT Tech Meetup - October 2020 featuring NightwatchJS, CodeceptJS and Cypressio

We had the following speakers for this meetup:
- Testing with NightwatchJS - (Ilesh Mistry, CMS Specialist, MMT Digital)
- Introduction to CodeceptJS (Radhika Vanteru, Test Automation Engineer, MMT Digital)
- CodeceptJS + Playwright (Michael Bodnarchuk, Owner of CodeCeptJS)
- Cypress (Owen Ayres, Principal Engineer, MMT Digital)

This is the recording from the tech meetup https://www.youtube.com/watch?v=nnh_Dwj1uTY
[![MMT Tech Meetup - October 2020 - Featuring NightwatchJS, CodeceptJS and Cypressio](https://dev-to-uploads.s3.amazonaws.com/i/qcultcb75kf92vv1sgo6.png)](https://www.youtube.com/watch?v=nnh_Dwj1uTY)

This is the recording from the MMT Tech Meetup where we have the following content in this video:
00:00:00 - Welcome to the MMT Tech Meetups by Ilesh Mistry
00:02:23 - Testing with NightwatchJS by Ilesh Mistry
00:34:40 - Introduction to CodeceptJS by Radhika Vanteru
00:54:15 - CodeceptJS + Playwright by Michael Bodnarchuk
01:28:18 - Cypress by Owen Ayres
01:57:44 - End
My "Hacktoberfest 2020" Journey
Tags: hacktoberfest, opensource, github
Published: 2020-11-02 20:50:27

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/92rr381utazy3rp11t9o.png)
# What I Learned From Hacktoberfest
This is the first time I participated in Hacktoberfest and also my first opensource contribution. I learned a lot of new skills from Hacktoberfest, working with new developers on their projects helps me to improve a lot. It was a great experience.

Hacktoberfest 2020 is one of the best experiences of my journey to a developer, that I will always cherish it. The excitement at the hour when my first pull request was merged can't be expressed in words. To Be Honest, I didn't know the importance of this fest I just take part in this fest for fun. My only target was to submit 4 pull requests but Later on, I realized that I did more than 4 pull requests. I am extremely grateful to be a part of Hacktoberfest 2020 which boosted my confidence to a different level.

Skills I gained during this period -
* Git
* GitHub
* CSS
* Finding issues

** I hope my journey with open-source will continue.**

Thanks a lot, Digital Ocean for this opportunity!
Iterative nested object traversal
Tags: javascript, algorithms, tutorial, computerscience
Published: 2020-11-02 20:48:49

Recently I had this problem where I needed to traverse deeply nested objects. More specifically it was about translation files which were of irregular structure (as usual) and partially quite deep (in some spots > 10 levels). So I needed an easy way to traverse through the entire structure and do some transformations / replacements. E.g. convert `UPPERCASE` to `lowercase` or replace language-specific quotation marks (`„“` `«»`, the ones word processors like MS Word write for different languages like German or French) with ASCII quotation marks.

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

Now, there's the choice of implementing the traversal algorithm recursively or iteratively. Slightly above 10 levels of recursion are unlikely to cause a stack overflow, but I wanted it to be iterative, since in my opinion it's easier to debug.

The key to the iterative implementation is to use a `while` loop which is kept running as long as the `queue` of unprocessed objects is not empty. Each object's properties are iterated and if a property contains another object it's simply enqueued to the queue. For any other kind of value a callback is called, where any kind of transformation/replacement can be made.

So, here's the code. If you want to see how it's being written, watch the video. 👋 Any feedback will be appreciated, just let me know and leave a comment. 🙏

{% youtube d3gF9MEKQYI%}

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ibsdhr9w8cnq7plyyrej.png)
Angular: Is View Code Immutable?
Tags: angular, typescript
Published: 2020-11-02 20:45:09

<sub>Scenario: We have a working view, but new specs ask to add another select html element only used on special occasions. We don't want to change the working view due to the Open/Closed principle, instead we want to modify it. Are Views Immutable?

**The Mutable Way**:
Just add ng-content tag into existing view. This mutates the code and subsequent View when displayed.
 
```html
<working-component
   [firstOptions]="firstOptions"
>
... has other working stuff above.
 
<ng-content></ng-content> //Mutation here

... other working stuff below.
</working-component>
```
 
How to use:
```html
<working-component
   [firstOptions]="firstOptions"
>
   //Here we add our new content!
   <ourNewComponent
      [options]="things"
   >
   </ourNewComponent>
</working-component>
```
Adding the ng-content code we are able to inject our new content without impacting the existing code. We are using a view layer compositional technique.

**The Immutable Way**

```html
<app-working
   [firstOptions]="firstOptions"
>
</app-working>
<ourNewComponent
      [options]="things"
>
</ourNewComponent>
```
In this method we simply add our new component after the working component and use styling to make them look like the same single component. We are not altering the original view.

The functions to save the changes just require the addressibility to both components using either design. Option 2 follows the Open/Closed Principle. Option 1 follows Compositional Rules. Either way, just make sure the code is atomic for each. 

There is a third way which is to crack open the original component and insert a new select element. It will need to be hideable based on the specs. and showable only on special occasion. This is the least favorable option.
Biggest questions getting a job
Tags: discuss, career
Published: 2020-11-02 20:29:46

---
title: Biggest questions getting a job
published: true
description: 
tags: discuss, career
//cover_image: https://direct_url_to_image.jpg
---

Gang,

  I've been thinking about what I should write about here and on my site to help devs get the jobs they want, but I wanna know what topics you're interested in.

  **So what are your biggest questions when it comes to getting a dev job?**

  And how have you solved them so far?
Abstracting From Nested Monadic Computations w/o Do-Notation
Tags: javascript, functional, learning
Published: 2020-11-02 20:21:04

---
title: Abstracting From Nested Monadic Computations w/o Do-Notation
published: true
description: 
tags: #javascript #functional #learning
//cover_image: https://direct_url_to_image.jpg
---

As soon as we work with monads in Javascript we wind up with nested monadic computations, because there is no do-notation as in Haskell or multi-prompt coroutines as in Kotlin. We cannot use generators either, because they are insufficient for the job.

So are we stuck with nested monadic computations in an ad-hoc fashion like the following?

```javascript
// Monad

const arrChain = mx => fm =>
  arrFold(acc => x =>
    arrAppend(acc) (fm(x))) ([]) (mx);

// auxiliary function

const arrFold = f => init => xs => {
  let acc = init;
  
  for (let i = 0; i < xs.length; i++)
    acc = f(acc) (xs[i], i);

  return acc;
};

const arrAppend = xs => ys =>
  xs.concat(ys);

// MAIN

const main = arrChain([1,2]) (x => // nested monadic computation
  arrChain([3,4]) (y =>
    arrChain([5,6]) (z =>
      x === 1
        ? []
        : [x, y, z])));

main; // [2,3,5,2,3,6,2,4,5,2,4,6]
```
Actually, there is a small improvement. We can treat monadic actions like applicative functors by wrapping them in the context of their corresponding monad:

```javascript
// Monad

const chain3 = chain => tx => ty => tz => fm =>
  chain(chain(chain(tx) (x => fm(x)))
    (gm => chain(ty) (y => gm(y))))
      (hm => chain(tz) (z => hm(z)));

// MAIN

const main = chain3(arrChain) // much more readable
  ([1,2])
  ([3,4])
  ([5,6])
    (x => x === 1
      ? []
      : [y => [z => [x, y, z]]]);

main; // [2,3,5,2,3,6,2,4,5,2,4,6]
```
[run code](https://repl.it/@scriptum/ClearcutWateryPerl)

Given `chain3` we can implement other arity aware combinators and overload them inside a variadic `chainn` to gain more flexibility.

More on this and other FP topics in my course for FP in JS:
[A fool's scriptum on functional programming](https://github.com/kongware/scriptum).
Help!
Published: 2020-11-02 20:11:21

Hello, Computer language is foreign to me! BUT have followed copy and paste instructions to install ffmpeg using “Homebrew” and it seems to have gone well!!?…but I can’t find 
It on my Mac (OS 10.14.6) 

I need to specify a path to ffmpeg in a program called Opentoonz 1.4.

Can you please tell me, in idiot proof language, what I should type for the path to ffmpeg?

Thanks very much in anticipation!

Paul Haskew.
How to add RTL support in Figma
Tags: figma, rtl, uiweekly, reactnative
Published: 2020-11-02 20:09:20

Around 20 countries in the world speak a language that is written RTL (right-to-left). Thus, RTL support is necessary for any digital device either web or mobile.
Currently, Figma doesn't support RTL language but there are a few community plugins that help us achieve the goal. Let's look into it.

## Problem:
By default when we write an RTL text in Figma it does the following:
It won't show the text IF you haven't selected an RTL supporting font.
It won't automatically make the text RTL. Rather, the individual characters of your text will be written LTR.

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

## Solution:
To fix the issue above we need to install a third-party plugin developed by Figma community members. I have selected the [Arabic & RTL Support](https://medium.com/r/?url=https%3A%2F%2Fwww.figma.com%2Fcommunity%2Fplugin%2F732290356467065314%2FArabic-%2526-RTL-Support) plugin developed by [Ahmad Alhaddad](https://medium.com/r/?url=https%3A%2F%2Fwww.figma.com%2F%40ah) for this tutorial.

## Steps:
* Click on the mentioned link and it will take you to the plugin page
* Click on install and it will automatically load into the Figma
* In Figma, write some RTL and from plugins select the installed plugin to fix the direction of the text

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

There is a list of a few more RTL plugins in the library you can find and install the best that suits your requirements.
Learn [what is Redux and how it manages the state](https://dev.to/aimenbatool/an-intro-to-redux-and-how-the-state-is-updated-in-a-redux-application-k97) Or tweet me [@aimenbatool](https://twitter.com/AimenBatool).
Personal Projects Showcase
Tags: django, python, github, node
Published: 2020-11-02 20:01:41

Hi,
I am writing this blog to showcase some of my little projects built using **Django**. All of them are open-source, so you can find them on Github. I shall also provide the links of the deployed site as well as the Github Repository.

1. **Shorty - URL Shortening Service**
Shorty is a URL Shortening service built using Django. As a common user, you can generate random as well as custom shortlinks for your loooong urls. Apart from that, if you signup(which is absolutely free), we'll generate unique QR Code for each shortened URLs.As an authenticated user, you can keep track of all your previously shortened URLs too.
The site is deployed on Heroku and can be found [here](http://srty.me) or http://srty.me
Github Link : https://github.com/ashutoshkrris/Shorty.

2. **PyWisher - Automatic Birthday Wisher**
We often forget our friends' birthdays. This project sends email to your friends on their birthdays. Just add an excelsheet containing all the data or simply add it manually on the site and it will be in action from the next minute itself.
This site is accessible at https://pywisher.herokuapp.com/
Github Link : https://github.com/ashutoshkrris/PyWisher

3. **Techink - Blog**
This is a Tech blog built using MERN Stack(MongoDB, ExpressJs, ReactJs and NodeJs).
This site can be found at https://technik-blog.herokuapp.com/
Github Link : https://github.com/ashutoshkrris/Technik-Blog

4. **Password Manager**
This is an ongoing project. It is a password manager that helps you store your passwords securely with encryption. It can also generate random strong passwords for you.

If you liked my projects,please try them and review them in the comments. Also please star them on Github.
Also feel free to raise any issue on Github for bug fixes or improvements.
You can also find me here at http://srty.me/Ashutosh
FREE Dev Tools / Dev Tools Gratis
Tags: webdev, productivity, todayisearched
Published: 2020-11-02 19:41:59

Hello! I hope everything is fine in this pandemic.

In this time, I have had some job gaps (which means that I have not been doing much), so I did a little research about tools that can improve and facilitate our work, whether you are a **frontend or backend dev**, or a __UX designer / UI__, and _I found a website on a youtube channel that has a lot of information that can help you or others_, this content is not mine, it is from a youtube channel in Portuguese, however, I think it is correct to share this type of tools to people who do not know them and thus to be able to help a little to those who are starting and those who are taking learning steps.

It is a website that lists tools that are sectioned by work area, for example, we have from **APIs to Web hosting**, __testing tools and repositories and design aid websites__, in short, there is enough to occupy and share and I think that most of the resources are free.

But hey, sometimes you have to pay a few dollars for a service that will make your website / project / development more professional and your experience more enriching for the company / business / freelance in which you operate.

[Tools Link](https://free-for.dev/#/)
[YT Channel Link](https://www.youtube.com/channel/UCU5JicSrEM5A63jkJ2QvGYw)


If you want me to do some research on a specific topic, tell me below, I hope I can be of help.


Regards!!







//Spanish Version

En este tiempo, he tenido algunas brechas laborales (lo que significa que no he estado haciendo mucho), así que investigué un poco sobre las herramientas que pueden mejorar y facilitar nuestro trabajo, ya sea que seas un desarrollador de frontend o backend, o un UX diseñador / UI, y encontré un sitio web en un canal de youtube que tiene mucha información que puede ayudarlo a usted o a otros, este contenido no es mío, es de un canal de youtube en portugués, sin embargo, creo que es correcto compartir este tipo de herramientas a personas que no las conocen y así poder ayudar un poco a quienes están comenzando y quienes están dando pasos de aprendizaje.

Es un sitio web que enumera herramientas que están seccionadas por área de trabajo, por ejemplo, están disponibles desde APIs hasta alojamiento web, herramientas de prueba y repositorios y sitios web de ayuda al diseño, en fin, hay suficiente contenido para ocupar y compartir y creo que la mayoría de los recursos son gratuitos.

Pero bueno, a veces tienes que pagar unos dólares por un servicio que hará que tu sitio web / proyecto / desarrollo sea más profesional y tu experiencia más enriquecedora para la empresa / negocio / freelance en el que operas.

[Herramientas](https://free-for.dev/#/)
[Canal de Youtube del contenido](https://www.youtube.com/channel/UCU5JicSrEM5A63jkJ2QvGYw)

Si quieres que investigue sobre un tema específico, dímelo a continuación, espero poder ser de ayuda.

¡Saludos!