teleren/devto huggingface dataset:
Starting something new for 2020
Tags: svelte, beginners, webdev, todayilearned
Published: 2020-01-11 21:51:44

Recently, or just yesterday, I thought of making a video tutorial about programming. My wife has been pushing me to make a podcast (with her) but I can't really think of good topics we can enjoy discussing to make it a fun listen. Programming has been my passion and career so I thought why not do that instead and be informative. She's currently in a different country though, plus I am really bad at explaining in just words. So video it is. And just me.

After having a discussion with her, we thought teaching the basics (the right basics) first just for the curious people who want to learn programming will do. I am not really aiming for anything here and this is just my outlet to when I am alone and want to pass the time.

*Why Svelte?* I am aware that Svelte is not being taught at all in any schools as an introductory language. Maybe most schools might not even know something like Svelte exists. But I chose Svelte because of 2 things: first, web is the best platform to program for. Web is where you see everything converge. Your laptop, phone, everything is connected to the web. Everyone uses Google or Facebook. Second, Svelte is a lot simpler than Python if you know a bit already about HTML (and other web technologies). With Python you have to learn the language, and work on the command line. If you're just curious to know what programming is, learning something simpler but still something that can be a lot productive is a better approach.

*So what is Svelte actually? Is it a new language?* Yes and no. Yes because it needs its own compiler to work. It's built on top of JavaScript and HTML (no it didn't add anything to CSS… yet). Your old JavaScript and HTML codes will still work. But your Svelte code might not work (as you've expected) as just plain HTML and JavaScript without compiling it (with Svelte). And no because I still write valid JavaScript and HTML, and only for the UI-related behavior you write Svelte-only code (so you could say it's just a framework like React).

So that's my opinion of Svelte. If you think you don't agree that this is a good language to teach programming basics, let me know. For professionals out there, if I got you curious about Svelte, please check out [Sapper](https://sapper.svelte.dev/). My ongoing video series can be seen [here](https://www.youtube.com/playlist?list=PL0SawbNhryoaK9JVn_t27ndPaJMJ1hJcI).
GTM vs gtag
Tags: javascript, webdev, discuss, help
Published: 2020-01-11 22:15:27

---
title: GTM vs gtag
published: true
description: 
tags: #javascript, #webdev, #discuss, #help
---

What's the benefit of using Google Tag Manager (GTM) instead of gtag?

As a Developer you have full control of what data will be sent to GoogleAnalytics (GA) with gtag and you don't need to configure it twice (gtag in code + GTM tag with trigger and variable).

I see so far few possible benefits:

- It tracks generic events like `page_view` on `history_change`, `scroll`, `video_play`, etc.
- Add HTML snippets for FacebookPixel or some ChatWidgets with some conditions (specific page, event)
**but isn't it more reliable and under control with source code?**
- Configure event mapping for FacebookPixel, etc.?
- If you configure GTM trigger as click on button and send event without a need to add an event in code
**but it's unreliable solution, because once code is changed it will be difficult to figure out what's broken**
- If you push in dataLayer context, so instead of sending 
```
gtag({ event: "search", search_term: "keyword" })
```
you send
```
gtag({ action: "search", search_term: "keyword" })
gtag({ event: "submit" })
```
**but then you can figure out in GTM which variables to use, but this will require to do a lot of conditions in GTM to define different logic for each event**

There is no simple way just to forward all events from GTM to GA, if you forward all events it will also forward all gtm events like: `gtm.start`, `gtm.history`, etc. So the workaround is to use:
```
{ event: "interaction", action: "search" }
```
But also in this case you will need extra conditions if you want to send different context for different events.

I like GTM. I like how it works and how it looks. I just don't understand benefit of using it, while you can do things faster and better with gtag.
Development Environment: Windows or MacOS?
Tags: linux, apple, microsoft, operatingsystem
Published: 2020-01-11 22:07:14

---
title: Development Environment: Windows or MacOS?
published: true
description: It's the ever-present question (and argument): Microsoft or Apple?
tags: linux, apple, microsoft, operating system
cover_image: https://thepracticaldev.s3.amazonaws.com/i/kp11c3f8l111cnt4mryo.png
---
Perhaps it's just me; I have no preference at all. I can flip between Catalina and Windows 10 like a acrobat in the circus. It's as close as I will come to being an acrobat in any sense, I assure you.

However, I'm genuinely curious: which environment do you prefer as a developer? 

The question truly occured to me when I was redesigning my portfolio. Using the excellent site [Unsplash](unsplash.com) for a placeholder background began to show a pattern. A lot of the images that appeared for the result 'web development' contained Macbooks. It wasn't familiar to me - nor was it indicative of my development experience.

I've invested a lot into my Windows setup but that's because I also spend my time playing some big ol' games. Many of my peers, however, exclusively work on Macbooks. I oft wonder if it would be worth the investment one day.

So what made you choose one way or another? Is it the software that's available? The aesthetic and appearance? The hardware? The ease of use?

Or are you like me? Have you no preference at all? And why is that? Personally, I worked as an IT technician for 12 months; I was hands-on with the guts of both Apple devices and others. By the end of the year, I was comfortable with most Operating Systems.

I'm not necessarily looking for a definitive answer but, like mine, more anecdotal, personal experiences. So: why do _you_ prefer _your_ environment?
Embedding C# libraries as source code
Tags: csharp, dotnet, json
Published: 2020-01-11 21:45:25

Hi,
I stumbled upon conflicting dll dependencies several times now, and I was wondering how often others do experience the following case:

 * There is .NET Lib 'A' (e.g.: well-known JSON.Net)
 * There is .NET Lib 'B' using Lib 'A' (e.g.: Configuration Manager)
 * There is .NET App 'C' using Lib 'A' and Lib 'B'

The problem arises, when the used versions of Lib 'A' differ for Lib 'B' and the application in an incompatible way.


There are ways to have two different versions of the same .NET library around, but I did not find this to be convenient/safe.

My proposal for those problems: Why not share Lib 'A' as source code? Different versions of the source code would be compiled directly into Lib 'B' and the application.

I did that for my project and wrote a [compact JSON serializer](https://github.com/pupsette/CompactJson). Nuget allows packaging sources, which are added to your C# project conveniently.

I think, this is a nice and clean solution. But still I haven't found many others complaining about conflicting dll dependencies as much as I do. Also, I did not see _C# source code packages_ in general to become very popular. I was wondering, if I missed the down-side.

So, I'm interested in your thoughts. Thanks!
So you want to start conference speaking? Submit that CFP!
Tags: cfp, conferences, publicspeaking, speaking
Published: 2020-01-11 21:29:54

_This is the seventh and final post in a series on getting started as a conference speaker. This post focuses on submitting the CFP._

You have done so much prep work up to this point that this should be the easiest step. 🙌


## Read the guidelines
When filling out the actual CFP, the golden rule is to **read and follow all of the guidelines**. Every conference and every CFP is different. Some want things formatted a certain way. Some want you to remove identifying information. Some want you to include past speaking experience and videos so they can take a look. Some have very interesting submission deadlines (I’m looking at you PyCon 👀 who has a deadline of Anywhere on Earth (AoE) instead of 11:59 PM EST like many conferences). To ensure that your proposal makes it past the first round of cuts, make sure that you meet all of their submission criteria. 

## Easy to understand title
The next tip for submitting a strong proposal is to pick a title that tells the audience exactly what your talk is about. Quirky and punny titles can be fun, but if an attendee wouldn’t be able to tell on the program what your talk is about, they probably won’t attend and the organizing committee wants to select talks that their attendees **want** to see.

## Don't make the selection committee think too hard
Finally, remember that the organizing committee is reviewing hundreds (if not thousands) of talk submissions on a deadline. If they can’t figure out what your talk is about quickly, they don’t have time to put in the effort. Don’t make the organizing committee think too hard. Show that you are organized and prepared. Clearly outline what the talk is about and why it is important. There are often extra questions and response areas in addition to the abstract so that you can demonstrate that you know what you’re talking about and will give a stellar talk for your audience.

Make sure that you submit to as many different conferences as you can. Experienced speakers average a 20% or less acceptance rate on their talks. You have to play the numbers—the more you submit, the more conferences you will get accepted at. 

Don’t get discouraged if your talk did not get selected. Most often, it was not because your submission was bad but because the programming committee had to make a decision and could only accept a small number of talks. That conference just happened to be in the 80% that you didn’t get picked for.

You are great and you have so much to share with your community! I can’t wait to see what you put together. And if you are looking for feedback, please reach out! I’d be happy to help if I can 🤗

## Related resources
- [5 Tips for Getting Your Next Conference Talk Accepted by Aisha Blake](https://dev.to/aishablake/5-tips-for-getting-your-next-conference-talk-accepted-cic)
- [A collection of past PyCon proposals - both accepted and rejected](https://github.com/akaptur/pycon-proposals)
- [Is Your Conference Proposal Good Enough? by Raquel Vélez](https://rckbt.me/conference-proposals/)
So you want to start conference speaking? Find open CFPs
Tags: cfp, conferences, publicspeaking, speaking
Published: 2020-01-11 21:24:58

_This is the fifth post in a series on getting started as a conference speaker. This post focuses on finding open CFPs._

Yay!!! At this point, you have all the pieces you need to start submitting your talk to conferences! Remember, you do **not** need to have the entire talk written before you apply to give it! But how do you find conferences who are accepting calls for proposal (CFPs)?

There are a lot of different sources to find open CFPs. Some conferences share their CFP on multiple sources and some don’t share on any, instead relying on their own social media and newsletters. Finding open CFPs is more of an art than a science. 

Here is a list of resources I use and like, and sometimes there is overlap between them.

* [Papercall](https://www.papercall.io/) - Papercall is a platform where you can add your talks and submit them to different CFPs. You can save your talk and submit it to multiple different events which is a nice feature.
* [confs.tech](https://confs.tech/) - An open-source and crowd-sourced list of conferences around software development, including ones with open CFPs.
* [CFP Land](https://www.cfpland.com/) - A website listing upcoming CFPs, it also has a newsletter you can sign up for to get a digest directly in your inbox.
* [SeeCFP](https://twitter.com/AppCfp) - A Twitter account that tweets out upcoming and current open CFPs. It also has a newsletter you can sign up for to get a digest directly in your inbox.
* [Tech Daily CFP](https://twitter.com/TechDailyCFP) - A Twitter bot that retweets CFPs for tech conferences and code camps. Sometimes there are false positives but still a great resource.
* Specific conference Twitter accounts - I follow the Twitter accounts of conferences I particularly like so I see updates about when they’re opening their CFPs directly

And `<shameless plug>`, I created a little React app that’s hosted on a free Heroku dyno to consolidate a bunch of these sources in one place. You can find it at [cfp-organizer.mercedesbernard.com](https://cfp-organizer.mercedesbernard.com). It can be slow to boot up, but it’s a handy little tool if you want to check it out.

Finding open conference CFPs can be a challenge if you don't know where to look. As you start submitting to and attending more conferences, talk to other speakers to find out where they discover open CFPs as well.

Now that you've found a whole bunch (and I mean a whole bunch) of open CFPs, the key to not stressing out is to decide which to fill out and which to skip.
API Design Tip
Tags: api
Published: 2020-01-11 21:23:52



Don't keep Important informations as top level object key, cause then the client has to iterate through the object, find the key, relevent to him, at the same time discard the other irrelevant keys and then extract the data.

> DO NOT PUT IMPORTANT DATA AS OBJECT KEYS

I faced this issue with my AI team, and had to spend a fuckload of time parsing the response

# BAD RESPONSE DATA: 

```javascript
{
 "i_am_a_unique_id": 50
}
```

# GOOD RESPONSE DATA

```javascript
{
 "id": "i_am_a_unique_id",
 count: 50
}
```
So you want to start conference speaking? Choose your headshot
Tags: cfp, conferences, publicspeaking, speaking
Published: 2020-01-11 21:23:28

_This is the fourth post in a series on getting started as a conference speaker. This post focuses on how to choose your headshot._

In addition to a speaker bio, most conferences will ask for a headshot to use on their website. The key to a good headshot is a **high resolution, square, color photo with a plain background**. 

Most modern phone cameras will take a beautiful high-resolution photo so this isn’t as challenging as it used to be. A high-res photo will hold up better as the conference resizes it to fit on all of the mediums they need it (website, printed schedule, schedule displays outside of the session rooms, social media, etc). You're less likely to end up with a grainy image of you shared with all the conference attendees.

Using a color photo is also a considerate choice for the conference organizers. If the conference’s website design is in black and white, they can easily grayscale your color photo but if you give them a black and white photo and they have rich color photography, your headshot will look out of place from the rest of the photos.

And, please please please pick something with a relatively plain, quiet background. I’ve heard horror stories of volunteers and interns having to try to separate the speaker from the image background for the website design and the speaker submitted a headshot of them standing in front of a tree or a bush. Those poor volunteers spent hours on a single headshot. Just like using a high-res, color photo, a plain background gives the conference more latitude in making your headshot match the design of the rest of the conference assets.

The last bit of advice I’ll offer is to use a photo that looks like you. Many attendees will refer to photos before they come up to talk to you to make sure that they’re talking to the right person. Using a photo of your dog or your favorite anime character is cute, but your speaker headshot is not the right use case for that image. Save it for your Slack avatar or Twitter image.

Have you noticed that we're already on step 4 and we still haven't written your talk?? This is intentional. My rule of thumb is 1 hour of preparation (writing, creating slides, practicing, editing, etc) for each minute of the talk, i.e. for a 40-minute talk I plan for 40 hours of preparation. Putting all of that time into a talk before you know if its been accepted or not is a huge commitment. Your talk might be amazing but just not the right fit for the audiences you pitched. It’s better to save your time and mental energy for preparing your talk **after** someone has asked you to give it.

## Related resources
- [Lady Conference Speaker Headshot by Heidi Waterhouse](https://heidiwaterhouse.com/2019/07/16/lady-conference-speaker-headshot/)
So you want to start conference speaking? Write your speaker bio
Tags: cfp, conferences, publicspeaking, speaking
Published: 2020-01-11 21:21:15

_This is the third post in a series on getting started as a conference speaker. This post focuses on how to write your speaker bio._

Now that you have a strong, informative abstract, you are almost ready to start applying to speak at conferences and submitting your CFP. But almost every conference is going to ask you for a speaker bio. Rather than try to come up with that on the spot in the last 30 minutes before the application closes (because we all procrastinate at some point right? 😉), let’s take some time and write that out beforehand.

A good speaker bio is also short, only 3-4 sentences. Think of it as your own personal abstract. Your bio should answer
1. Who are you?
2. What qualifies you to give this talk? What perspective do you have?
3. What is something fun for them to remember you by? What is something they can chat with you about at mealtimes?

We all feel pressure when writing our bios to tell people why we’re amazing and list our accomplishments. But I don’t think that’s the best use of this space. The speaker bio helps your audience understand your perspective and decide if they think you’ll have something unique and interesting to say on the topic. A list of awards isn’t as memorable as someone sharing why they are uniquely qualified to talk to a room of strangers about their topic.

Including something fun and interesting about yourself at the end often sets you apart from other speakers. It gives shy or nervous attendees an easy opener if they see you at the conference. As a speaker, many people will want to chat with you and hear more about what you have to say. An interesting line about spinning your own yarn (from one of my bio’s) or watching Star Trek (from a friend’s) can be the perfect little nugget to bond over and start a larger conversation.

Writing about yourself feels weird, especially in the third person. Find a friend to read your new bio and give you feedback. Friends are usually better at telling us why we're awesome than we are anyway 😉 

And don't be afraid to sell yourself as the amazing speaker you are, that's the point of this exercise. You have a unique perspective, you're going to put in the work to make a valuable talk, and gosh-darn-it people will learn a lot from you!

## Related resources
- [Lady Conference Speaker: Speaker Bios by Heidi Waterhouse](https://heidiwaterhouse.com/2019/06/19/lady-conference-speaker-speaker-bios/)
- [How to write a conference proposal: Biography by Mike Moore](https://blowmage.com/2013/01/24/writing-conf-proposals#biography)
Convert to JSON in Python vs Javascript
Tags: python, javascript, json
Published: 2020-01-11 21:19:01


# Python:

```python
import json

user = {
    "name": "Victor"
}

json_py = json.dumps(user)
```

# Javascript:

```javascript
const user = {
    name: "Victor"
}

const jsonJs = JSON.stringify(user);
```
Check if key exists in Dictionary/Object in Python vs Javascript
Tags: python, javascript
Published: 2020-01-11 21:16:07


# Python

```python
dict = { 'platform': 'telegram' }

if 'platform' in dict:
 # do something
```

# Javascript

```javascript
let obj ={ platform: 'telegram' }

if(obj['platform']){

   // do something

}
```
Airtable backups made simpler with AWS Lambda & S3!
Tags: airtable, aws, opensource
Published: 2020-01-11 21:12:17

Today, we released as OSS our boilerplate project https://github.com/UnlyEd/airtable-backups-boilerplate which is meant to manage Airtable backups lifecycle for you.

See our announcement on the Airtable forum: https://community.airtable.com/t/unly-releases-an-open-source-software-for-airtable-managed-backups/26752

Share the OSS love!
Encapsulation and horses
Tags: computerscience, beginners, codenewbie, javascript
Published: 2020-01-11 21:07:27

_This post is the eighth of a series adapted from my conference talk, [Fun, Friendly Computer Science](/speaking/fun-friendly-cs)._

Did you know that a horse has 4 main gaits? A horse can walk, trot, canter, and gallop. Walking is characterized by a slow, 4-beat pace. Trotting is a bit quicker 2-beat gait. Canter is even faster with a 3-beat gait. And galloping is a horse’s fastest pace characterized by a 4-beat gait.

If you were playing a programming game where you had to move a horse across the screen, would you want to be required to know about the different gaits that a horse uses at different speeds? And what order to move the legs in to achieve those gaits and those speeds? Probably not.

The first principle of object-oriented programming is encapsulation. Encapsulation is when you "hide" an object's state from other objects. You create a public interface (a method or property) for other objects to interact with your object and mutate its state. When you encapsulate an object, you don’t allow any other object to mutate your object’s state directly. The only interaction is through the interface you defined.

In the horse example, you would create a horse object with methods for `walk`, `trot`, `canter`, and `gallop` that handles animating the horse’s legs to match the desired gait and speed. This way the user doesn't need to manually mutate the state of the horse's legs in the correct order. 

For example, an extremely simple version of your canter method might look something like this 

```
canter(steps) {
  let time = 0;
  let distanceTraveled = 0;

  for (let i = 0; i < steps; i++) {
    this[backLeftLegPosition] = LegPosition.UP;
    this[backLeftLegPosition] = LegPosition.DOWN;

    this[backRightLegPosition] = LegPosition.UP;
    this[frontLeftLegPosition] = LegPosition.UP;
    this[backRightLegPosition] = LegPosition.DOWN;
    this[frontLeftLegPosition] = LegPosition.DOWN;

    this[frontRightLegPosition] = LegPosition.UP;
    this[frontRightLegPosition] = LegPosition.DOWN;

    time += 0.27; // 3.667 steps / second
    distanceTraveled += 6; // 22 ft / second
  }

  return { steps, time, distanceTraveled };
}
```

And then other objects or your user would make a horse canter with the following code

```
const GiddyUp = new Horse();
const steps = // read from input;
GiddyUp.canter(steps);
```