teleren/devto huggingface dataset:
12: Maggie Appleton on Open Source as a Gift Economy
Published: 2020-05-29 17:41:21

---
title: 12: Maggie Appleton on Open Source as a Gift Economy
published: true
date: 2020-03-06 18:00:00 UTC
tags: 
canonical_url: https://share.transistor.fm/s/9d389287
---

Posting the episodes from the Maintainers Anonymous podcast!

{% spotify spotify:episode:5XvzG7KQZkeI4dxSuvbW56 %}

Is the open source community a gift economy? What even is a gift? Maggie Appleton joins Henry to discuss open source as a gift economy (versus a market economy), why we participate in open source and exchange gifts, rituals and habits, patronage and crowdfunding, quantified self and disembodiment, our role in tech  
  
Transcript at: https://maintainersanonymous.com/gift  
Maggie: https://twitter.com/Mappletons  
Henry: https://twitter.com/left\_pad
Down the rabbit hole we go!
Tags: angular, javascript
Published: 2020-03-06 17:37:41

One part of my migration plan to angular typescript is also to get rid of something we called "page scripts" which basically were a bunch of globally registered jQuery scripts that were pertinent to a certain page but not limited to a certain controller or directive but enacted upon all or multiple rendered components. It was a way to previously get some code-reuse across parts where the developer was not aware of how to do it through services or similar approaches.

With that explained, I now went down the rabbit hole of checking "What is this function used for and is it needed anymore?"-queries... There was one particular one that removed and added a class to an input's child element if you clicked on the input and if you clicked outside of it.

We have similar functionality that recently got converted into a component, so I checked that component and it also had some issues. It was also binding to the document and with a global click event. Manipulating the DOM or attaching to "outside" isn't a desirable thing as it may introduce unnecessary or unexpected DOM manipulations or cause serious side-effects. There's an isolate scope for a reason.

So.... to get some code-reuse and reusing that drop-down component, I have to first fix that so it's keeping to itself, then replace all instances of a dropdown multi-select element with that shared component instead and once that is done I can remove the pageScript code.

I'm feeling a little bit like Hal from Malcom in the middle.

{% youtube AbSehcT19u0 %}
Do you code Games?
Tags: discuss, career
Published: 2020-03-06 17:34:18

Hi Friends!

The question is in the title: do you code games, at least sometimes? Sorry, but it is very short post :)

I can elaborate, however. It's not necessarily about polished-finished games, like silly mobile "jump-jump for the stars" with rich graphics and sound.

Perhaps you code some basic pen-and-pencil games as an exercise, or even puzzles (not necessarily tic-tac-toe, but similar). Or small logic turn-based ones (like evade zombies, travel the maze etc). Perhaps you spent a week to write the code, then play for 20 minutes and forget about it :)

Do you put more attention to game logic - or to look-n-feel and sound? What have you coded, please, feel free to share links if you have something at hand!
Good enough portfolio ?
Tags: help, feedback, portfolio
Published: 2020-03-06 17:32:30

Hi dev.to this is my first post, I would like to introduce myself and share some insights from my [website](https://lsroa.xyz)  and ask for opinion of this amazing community

![Imgur](https://i.imgur.com/f5j7YCbl.jpg)

I am mix of web developer and designer so my website looks more informal then others programmer portfolios, all the images used in my site are made by me although I think it project more a designer vibe than a programmer site. So I would like to ask:

* what do you guys think ?
* it runs the the model smoothly ?
* it takes to long to load the website ?
* does work well in mobile ?


The model was made with blender and Marvelous Designer, rendered with Three.js and all the site is made with Vue and CSS grid, hosted in Netlify. There is some little details like the backlights that change its color from blue to red to simulate indirect light from the back boxes

![Imgur](https://i.imgur.com/oXRtuZam.jpg)
![Imgur](https://i.imgur.com/9LyOMs7m.jpg)

And if you enter in dark mode I actually turn of the lights of the scene and turn on a light that simulate the monitor.

![Imgur](https://i.imgur.com/RKUpXGCl.jpg)

I recently move to Europe and I am having a huge Impostor Syndrome, I know its  trending but I want to get into the industry I would like to have some feedback of this portfolio Thanks for your time happy weekend
Nevertheless, Ravina Deogadkar Coded (Up's and Down's)
Tags: wecoded
Published: 2020-03-06 17:22:16

<!-- ✨This is my first blog so I'll rather keep it simple and sort.✨ -->

I am a Software Developer working across different technology stack, a self-taught coder and a beginner blogger.

Altogether till now lots of things has changed.
- I joined a startup as intern and then continued as a full time developer.
- I have left job with not such offer in hand.
- I have lost offer in hand (due to long notice period)
- I was unemployed for brief interval.
- I have upgraded my skill.
- I took on a challenging role.

One thing I have learned is life will not be always chocolate cake. There will be a time you will lose everything and there will be a time when life will pay back to you. With all this big decision, I am proud for standing still and letting myself to comeback with a bang.

My advice for allies is to stay strong, have hope and keep on improving yourself.

## If you want to see yourself at a position then you have to work on it.

Happy Coding!

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Nevertheless, Sarah Coded
Tags: wecoded
Published: 2020-03-06 17:21:45

---
title: Nevertheless, Sarah Coded 
published: true
tags: shecoded
---

It's that time of the year when we get to write this and I am happy to write one. Not because I've got some exciting story to inspire or motivate you but simply to tell you that sometimes it's okay not to have it all figured out. That's how I feel right now. Why do I feel this way? Let me tell you a little story about myself.

A few years ago, I started my journey in tech as a frontend developer. You see, frontend development has always been my strong point. I mean give me any design and I'll make the interface look like the design while making it responsive and trying to make it as accessible and performant as possible. 

Last year, I joined a different company. Not as a Frontend developer this time but as a software engineer. What this means is that I do backend tasks and everything in between. I was excited to learn a whole lot of new things. I still am. With each challenging task I overcome, I feel happier and I feel better. 

But I guess there's something about trying out a different challenge. While you feel excited, there's this constant reminder that you don't really know as much as you should. I ask myself sometimes, do I really know what I am doing? What do I want to do next? What do I want to learn next? I mean with Frontend development there's always something I want to try out or do. I had a path all figured out in my head. But it's different with backend development.

Don't get me wrong, I really love my current job and I think it challenges me enough. But I'm just at this point where I really do not know what I'm doing. I can't be the only one that feels this way. Or am I? 

I know this is a phase in my career that will pass. I know sometime soon I'll have a clear plan of what I want to do next. Till then, I'll continue to show up at work every day and do my best. I'll continue to try to learn new things and grow in my knowledge. I'll continue to start new courses and get tired of them halfway. I'll continue to solve Leetcode problems whenever I can. I'll continue to code.

Till next time!!!
Wizar devlog 07 - Connect Crafter to React (wip)
Tags: react, typescript
Published: 2020-03-06 16:55:37

This week I was on a critical task for Ravioli MVP. I am still on it, there is a lot of work.
I need to enable the use of React with Ravioli. In short I need to recreate Mobx React.

Crafter, the underlying reactive library of Ravioli is very close to the design of Mobx. So I benefits of all the years of resolved issues that Mobx React has completed and it is a huge benefit.

It is like having a scrum board with right written tickets including acceptance tests.
It removes the mental charge of architecture overthinking and I can focus on implementation.

Here is a test example

```ts
    let store

    let todoCompleteRenderings
    const TodoComplete = observer(function TodoItem(props) {
        todoCompleteRenderings++
        return <>{props.todo.completed && ' - x'}</>
    })
    
    let todoItemRenderings
    const TodoTitle = observer(function TodoItem(props) {
        todoItemRenderings++
        return <li>|{props.todo.title}<TodoComplete todo={props.todo}/></li>
    })

    let todoListRenderings
    const TodoList = observer(
        class TodoList extends React.Component {
            public render() {
                todoListRenderings++
                const todos = store.todos
                return (
                    <div>
                        <span>{todos.length}</span>
                        {todos.map((todo, idx) => <TodoTitle key={idx} todo={todo} />)}
                    </div>
                )
            }
        }
    )

    beforeEach(() => {
        clearContainer()
        todoCompleteRenderings = 0
        todoItemRenderings = 0
        todoListRenderings = 0
        store = observable({
            todos: [
                {
                    title: "a",
                    completed: false
                }
            ]
        })
    })

    test("first rendering", () => {
        const { container } = render(<TodoList />)

        expect(todoListRenderings).toBe(1)
        expect(container.querySelectorAll("li").length).toBe(1)
        expect(container.querySelector("li")).toHaveTextContent("|a")
        expect(todoItemRenderings).toBe(1)
        expect(todoCompleteRenderings).toBe(1)
    })
```

For now the basic reactivity works but I need to rewrite the reaction part of Crafter to get rid of unecessary renders.

Hope to finish soon, can't wait to put a online demo.
Today I Learned - query string library have stringifyUrl
Tags: javascript
Published: 2020-03-06 17:26:02

---
title: Today I Learned - query string library have stringifyUrl
published: true
date: 2020-03-06 16:38:03 UTC
tags: javascript
canonical_url: https://krzysztofzuraw.com/blog/2020/stringify-url
---

I’ve been using [query-string](https://github.com/sindresorhus/query-string) library to create myquery string for a long time. Normally I’ve used it as follows:

```
import * as qs from 'query-string';

const API_URL = '/users?' + qs.stringfy({ user: '1' });
// API_URL will be /users?user=1
```

Everything was fine until my parameter was null or undefined. When such case occurs my `API_URL`looked something like `/users?`. It wasn’t a problem for the endpoint - the request was hitting backendyet I’ve some feeling that it can be done better. Today when I was integrating `query-string` intoa new project I found out about new function: `stringifyUrl`. Let’s see it in action:

```
import * as qs from 'query-string';

const API_URL = qs.stringifyUrl(
  {
    url: '/users',
    query: {
      user: 1,
    },
  },
  { skipNull: true }
);
// API_URL will be /users?user=1
// and in case when user id is null
// /users
```

Perfect 🎉. Now I’m happy and I’ve learned new stuff - so if you happen to use [query-string](https://github.com/sindresorhus/query-string) consider using `stringifyUrl`.
Nevertheless, Bárbara Coded
Tags: wecoded
Published: 2020-03-06 16:36:13

---
title: Nevertheless, Bárbara Coded 
published: true
tags: shecoded
---
<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like...

When everyone has the opportunity to enter the industry, to work, to grow, to share knowledge and to be paid fairly, regardless of gender, race, sexuality or any other factor. 

## My advice for allies to support self-identifying women and non-binary folks who code is...

First of all, LISTEN to them. Get to know their point of view, their problems, their ideas. Don't dismiss them when they call out prejudice just because it "never happened" to you. Give them the chance to show their work and share their knowledge. 


<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Why I made 29 PR's in the repository of 11ty's documentation
Tags: beginners, opensource, productivity, eleventy
Published: 2020-03-06 16:33:22

---
published: true
title: "Why I made 29 PR's in the repository of 11ty's documentation"
cover_image: "https://raw.githubusercontent.com/gabbersepp/dev.to-posts/master/blog-posts/pr-11ty-website/assets/header.jpg"
description: "Why I made 29 PR's in the repository of 11ty's documentation"
series:
tags: beginners,opensource,productivity,eleventy
canonical_url:
---

During the last three weeks I made 29 pull requests in the repository of [https://github.com/11ty/11ty-website](https://github.com/11ty/11ty-website):

![](https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/master/blog-posts/pr-11ty-website/assets/stats.jpg)

I also read through many issues and added a comment if I was sure that the issue can be closed. A collegue of mine asked me why I am doing this. He would not want to spend time for that because he had so much other own projects to maintain.

# Please support your favorite open source projects

I tried `11ty` about four or six weeks ago and I falled in love at the first sight. It is so easy to use with so many possibilities. Currently I have build two websites with eleventy. 

My personal portfolio page where I aggregate everything I do into one place:

{% github gabbersepp/biehler-josef.de %}

And a german page that publishes cartoons with developer background:

{% github gabbersepp/kack_dev %}

The owner of that repository invested many time into this neat tool and into the documentation also. And all that stuff helped me a lot. I am happy to be able to give something back to the owner and I ask you to do the same with your favorite open source project. Every line of code helps.

In this case the only thing I have done was to add new JSON files like that one:

```json
{
	"url": "https://kack.dev",
	"name": "KackDev",
	"description": "Cartoons from the life of a developer.",
	"twitter": "KackDev",
	"source_url": "https://github.com/gabbersepp/kack_dev"
}
```

They are used to build the list of pages that are [built with eleventy](https://www.11ty.dev/docs/sites/). There were about 50 issues that aimed to add a new site. About 20 issues were obsolete because the site they are about have been added i former committs. And for the remaining 30 issues I have created pull requests.

You might think that this is stupid work with no intellectual claim. And you are right. But there is one fact that counts: **It costs time to implement all those issues**.

Time the owner maybe does not have. So if you have some time and you see some issues that you can solve, please try it.

What do you think? How much time do you spend at open source projects?

----

# Found a typo?
As I am not a native English speaker, it is very likely that you will find an error. In this case, feel free to create a pull request here: https://github.com/gabbersepp/dev.to-posts . Also please open a PR for all other kind of errors.

Do not worry about merge conflicts. I will resolve them on my own.
I'm moniquejank, and I support women devs.
Tags: wecoded
Published: 2020-03-06 16:19:06

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like…

## I will advocate for equality by…

## My advice for fellow allies to support self-identifying women and non-binary folks who code is...

<!-- Once your post is published, it will not appear on the /t/shecodedally page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
How to insert a Postgres Array from a Stringified JSON Array
Tags: postgres, json, array
Published: 2020-03-06 16:13:33

In an endpoint in a project that I’ve been working on this week, we receive a JSON payload from a call to our API, but the Postgresql database with which we’re working stores the contents of this payload as a Postgres Array. 

To make matters a little more complicated, the value field is sometimes a single string, rather than an array, and so the .sql file takes either a stringified JSON or a string as its argument.

I couldn’t find a simple explanation for how to work with this particular arrangement, because I don't imagine it's that common. However, just in case it's useful for anyone else, here's how to do it (and hello me in the future, when I’ve forgotten how to do this!).

Consider the following table:

```sql
CREATE TYPE v_type AS ENUM ('text', 'list');
CREATE TABLE demo_table (
  id bigserial NOT NULL,
  value_type v_type NOT NULL,
  text_value text NULL,
  list_value _text NULL
);
```

And we want to insert either a `text_value` or a `list_value` depending on the `value_type` column.

The insert statement must look like this:

```sql
    INSERT 
    INTO
        demo_table
        (value_type, text_value, list_value) 
    values
        ($1,  case 
            when $1 = 'text' then   $2 
            else null 
        end, case 
            when $1 = 'list' then   ARRAY(SELECT
                json_array_elements_text(cast($2::text as json))) 
            else null 
        end);
```

The reason that the second part is so complicated is as follows:
 - Postgres functions are typesafe, and so each function needs to ensure that its inputs are of the correct type. Therefore, you need to specify that $2 will be a text getting cast to JSON, which can then be fed into json_array_elements_text (which will only accept a JSON). Note that this may error at runtime if the text isn’t a valid JSON structure (but that doesn't concern us - it will be processed beforehand).
 - The only way in Postgres (that I could find) to turn a JSON into an array is to use json_array_elements to expand the JSON array to a set of text values, and then ARRAY to take the text values and make them into an array.

Credit to Erwin Brandstetter for [this StackExchange answer](https://dba.stackexchange.com/a/54289), which provided the bulk of my research.
Passing Private Params to an Update Method in a Controller (Rails)
Tags: ruby, rails, codenewbie, beginners
Published: 2020-03-06 16:03:57

In this post, I want to take a moment to dissect a block of code that I found challenging while working on my first Ruby on Rails project.

In our Bachelor/Bachelorette web app, a user can update an existing event by adding activities and other users to it.

For example, a Bachelorette named Amy can select “Amy’s Bachelorette Party” and edit it to include activities like Brunch, a day on Lake Travis, Barhopping, etc. Amy can also select each of her friends from a dropdown menu and add them to “Amy’s Bachelorette Party”.

Let’s pretend that Amy wants to update her Bachelorette Party (event) to include Brunch (activity) and a friend Kelly (user)

Our Models have these relationships:

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

Our Events Controller (simplified) has this Update method with this private method:

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

Here is a line-by-line explanation of the logic in the Update method:

1. Find the event (Amy’s Bachelorette Party) in the database by the event’s assigned ID #
2. Find the activity to add (Brunch) from a dropdown menu within the “Update Event” form
3. Find the user to add (Kelly) from a dropdown menu within the “Update Event” form
4. If the event is assigned a valid activity and user, save these updates to the database UNLESS they are already saved (to prevent duplicates)
5. If the event is successfully updated, redirect the user to a page that shows them their newly updated event with all of the event details
6. If the event is not successfully updated(perhaps the user forgot to complete a field), then show them the original “Update Event” form (so they can try again)

The private method “event_params” dictates that, if a user is creating or updating an event, they will have access to activities and users in the database. This allows them to assign activities and users to events.

Takeaway:
After completing this project, I learned that this code could be refactored further to include checkboxes instead of dropdown menus. This would allow a user to add multiple activities and users to an event, instead of just one at a time through the dropdown menu.

Learn more about Strong Params [here](https://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html)
She Coded! But she tired from the week.
Tags: wecoded
Published: 2020-03-06 15:56:28

---
title: She Coded! But she tired from the week.
published: true
tags: shecoded
---

I'll make this quick. A lot has changed since my last #SheCoded [post](https://dev.to/missamarakay/nevertheless-amara-graham-coded--5beb) -

* I got a promotion.
* I switched companies.
* I took on a strategic role.
* I moved from an IC to a people manager. (And a manager of manager!)

That's just the **_big_** items. I'm incredibly proud of the work I've put in to get this far and I made sure to take some time to celebrate along the way. I always recommend you do the same.

But what hasn't changed is I still make time to code, hone my technical skills, and learn new topics. You will still see me learning in public, educating folks on my "gotchas", and making the developer experience easier when working with anything in my sphere of influence.

Nevertheless, she coded. But she's tired and thank goodness it's Friday!
General Sibling Combinator
Published: 2020-03-06 16:03:47

The general sibling combinator (~), is a great way to avoid using unnecessary divs when styling your HTML file. It used used to select elements that are siblings of another element, in other words, defined elements that come after or precede another defined element. For example:

   p ~ ol {
  background-color: yellow;
           }

This would give every ordered list element that are preceded by a paragraph element a background color of yellow
That's why I can't use Svelte
Tags: svelte, typescript
Published: 2020-03-06 16:03:21

Since the OpenSource era beginning, the modern developing environment is built from small and independent pieces. This is our power and our weakness. An average Web app can contain dozens or even hundreds of separate technologies. And this brings the power to replace some parts of it without touching another.

This is especially true for the React related ecosystem: you are supposed to pick every single piece yourself and then build them up. This is hard, but this is powerful.

Say, you are not tied to Babel to compile JSX, you can pick some another transpiler/compiler or even language such as Kotlin. Or you can use no JSX with [hyperscript](https://github.com/hyperhype/hyperscript).

But, in Svelte it looks like you don't have the freedom to control every part of your stack. You [can't even use TypeScript](https://github.com/sveltejs/svelte/issues/1639), which gains popularity every day, and is de facto standard in some companies. There is some work is in progress on it, but [is far from finish](https://gist.github.com/orta/ce05553de3fa9ba847ab410f29f874a4) I'm afraid.

![Svelte TS issue](https://dev-to-uploads.s3.amazonaws.com/i/oazjx8w1z8un98zrvb9e.png)

I hope this will change in the future, but today it feels a deal-breaking thing.