teleren/devto huggingface dataset:
Support External Code Snippets & Output/Result Embed
Published: 2021-08-02 21:16:17

The Kunming.io development team announces the immediate availability of External Code Snippets & Output/Result Embed is supporting for all 36 programming languages on Kunming.io.

![Alt code snippets embed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ymf8mrv7gmltse0cf46.png)

What is embed code?

The "embed code" is a block of HTML which is embedded in the page-source and creates an object in doing so. 

HTML: 
one of the most basic languages used on the web, used to design and lay out web pages. You often see this code when you're in the "back end" of your blog post.
Here's what a string of HTML code looks like:
![Alt HTML embed code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i6z0tmkb6ezizopvrgs9.png)

Embed: 

the process of putting something into a website or blog post. It's often referenced with HTML to designate interactive content taken from social and content networks. It's a great way to get interactive, visual content on your blog without designing a thing.

How to embed your code snippets through kunming.io for your web page, blogs, articles and your Apps?

You can follow the below video to get it:

{% youtube xzNLGbeqHuA %}
Membuat Folder Tersembunyi di Android, Begini Caranya!
Published: 2021-08-02 21:14:14

Folder tersembunyi biasanya digunakan oleh sebagian orang untuk menyimpan berkas yang bersifat pribadi, penting atau rahasia. Sama dengan PC atau laptop, ponsel Android menyediakan fitur untuk mendukung penyimpanan berkas pada folder yang bisa disembunyikan. Bagi kamu yang belum tahu bagaimana cara membuat folder tersembunyi di Android, simak ulasan berikut ini. 

https://kuyakepo.blogspot.com/
How To Use `git diff`
Tags: git, todayilearned, productivity, discuss
Published: 2021-08-02 21:12:56

What do you do when your code was working on `main` but you've checked out a new branch, added a few changes, and it's failing?

One of your available tools is a powerful command my coworker taught me recently: `git diff`.

With it, you can see the differences between your current branch and `main`.

For example, say your [Prettier](https://prettier.io/) settings are suddenly not working after switching to a new branch and playing around a bit. You run `git diff`, scroll through the changes, and see:

```bash
 {
-  "editor.formatOnSave": true
+  "editor.formatOnSave": false,
 }
```

Oh my gosh! Somehow, your Prettier settings got set to `false` for `formatOnSave`. That explains it! 

`git diff` can save you a lot of time when you're debugging code behavior that's different from that on `main`. Let me know what other git tools increase your coding productivity!
Masih Bingung Cara Memindahkan Whatsapp Ke Hp Baru? Cek Lagi Yuk
Published: 2021-08-02 21:12:29

Tak perlu lama-lama ya, sobat. Langsung saja yuk menuju pembahasan cara memindahkan whatsapp ke HP baru ini. Tutorial ini memungkinkan kamu untuk tetap dapat memindahkan akun tanpa kehilangan data apapun. Sehingga dinilai aman dan nyaman. Penasaran, yuk cek ulasan penting dibawah ini.

https://kuyakepo.blogspot.com/
Upgrading to Apollo 3 in Meteor in 3 steps
Tags: meteor, javascript
Published: 2021-08-02 20:57:55

Apollo server 3 is out and in Meteor 2.4 the Apollo skeleton is going to be updated to it. But if you have an existing project with Apollo 2 in your Meteor app, you will have to spend a little bit of a time to get to the newest version.

Here I will cover the basic 3 steps to upgrade to Apollo 3 in your Meteor app. Do note that you will probably do a little bit more for your particular app as there are many changes. Don't forget to study the [Apollo migration guide](https://www.apollographql.com/docs/apollo-server/migration/).

## 1. Add Express to your dependencies

Express has become [peer dependency](https://www.apollographql.com/docs/apollo-server/migration/#apollo-server-express) for Apollo and Connect which comes bundled with Meteor is no longer enough, so you will need to add it for Apollo to run:

```bash
meteor npm i --save express
```

## 2. Update your Apollo starting script

You will have to re-visit your starting script as Apollo now requires to [explicitly call the start function](https://www.apollographql.com/docs/apollo-server/migration/#start-now-mandatory-for-non-serverless-framework-integrations). This will mean that you will have to re-structure a bit how to start the server with Apollo:

```js
// apollo.js
import { ApolloServer } from 'apollo-server-express';
import { WebApp } from 'meteor/webapp';
import { getUser } from 'meteor/apollo';
import { makeExecutableSchema } from '@graphql-tools/schema';

const server = new ApolloServer({
  schema: makeExecutableSchema({
    typeDefs,
    resolvers,
  }),
  context: async ({ req }) => ({
    user: await getUser(req.headers.authorization)
  })
})

export async function startApolloServer() {
  await server.start();
  const app = WebApp.connectHandlers;

  server.applyMiddleware({
    app,
    cors: true
  });
}

// main.js
import { startApolloServer } from './apollo';

function insertLink({ title, url }) {
  LinksCollection.insert({title, url, createdAt: new Date()});
}

try {
  startApolloServer().then();
} catch (e) {
  console.error(e.reason);
}
```

## 3. Update your resolvers and queries

Almost everything now is async in Apollo, so you will need to update your resolvers and queries with `async` keyword before them like this:
```js
const resolvers = {
  Query: {
    getLink: async (obj, { id }) => LinksCollection.findOne(id),
    getLinks: async () => LinksCollection.find().fetch()
  }
};
```

And that should be it! That is if you have a very simple setup. Changes are that you will need to dive in, especially in updating your options for Apollo, so don't forget to check with [the Apollo Server changelog](https://www.apollographql.com/docs/apollo-server/migration) for all the details.

--------
If you like my work, please support me on [GitHub Sponsors ❤️](https://github.com/sponsors/StorytellerCZ).
Localization in AvaloniaUI
Tags: csharp, dotnet, avaloniaui
Published: 2021-08-02 20:55:30

Hey there! This time I gonna explain how to add localization support in your AvaloniaUI app. As always I'm using my app called [Camelot](https://github.com/IngvarX/Camelot) as good working example.

# What is localization and why do we need it

Localization is a process of adding support for different locales in your app. Locales always include language, date/time formats etc. It allows users from multiple countries use your app in their native language.

# How to localize AvaloniaUI app

### Create resources

First step is to create set of resources files like [here](https://github.com/IngvarX/Camelot/tree/master/src/Camelot/Properties). It could be done automatically via IDE. `Resources.resx` is the main file with default culture translations inside, IDE also autogenerates `Resources.Designer.cs` class based on it. This class could be used in code if needed. Other `*.resx` files contain translations for different cultures etc. Please note that for same language it's possible to keep many locales, like `en-US` and `en-GB`.

### Integrate resources into views

Resources could be used as static objects in views. Translation for current locale will be shown. Here is an example how to use them:

```xml
<ToolTip.Tip>
    <TextBlock Classes="mainWindowTextBlock" Text="{x:Static p:Resources.GoBack}" />
</ToolTip.Tip>
```

### Add language selection logic

For usability it's good to provide ability to select language in UI. All you need on backend in this case is to set current culture:

```csharp
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(languageCode);
```

See [LanguageManager](https://github.com/IngvarX/Camelot/blob/master/src/Camelot/Services/Implementations/LanguageManager.cs) for more info

### Add translations

IDE support adding resources over UI:

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

Tips: use clear translation string names. If text is too long don't try to put full text in resource name. If you have resource that ends with colon I recommend to name it `...WithColon` because you might need similar resource w/o colon later and adding `:` in view to your text won't work for some locales as expected.

# Conclusion

In this post I described process of localization AvaloniaUI app. It's pretty straight-forward process. Feel free to contact me in comments if you have any questions!
Pleasing our Lord Google: A work in progress
Tags: webperf, webdev, discuss
Published: 2021-08-02 20:53:32

Improving the Core Web Vitals metrics does not seem to have any serious effect in incoming traffic from Google. In this example from one of our projects, impressions are up 15% (see cover photo) but clicks are more or less the same. At least the CWV charts looks is encouraging. 
![Core Web Vitals chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hjpskxabstfxmymqvh7u.png)

Does that mean the work is useless? No, probably it just means that this is the new baseline. As every other site on the web (or at least the ones active on continuous improvement) tries to also improve their CWV numbers, you also need to do the same just to keep your existing traffic.
The Future Of Chatbots (AI)
Tags: ai, chatbots, images, blog
Published: 2021-08-02 20:27:44

######Today will talk about how chatbots in Artificial Intelligence gonna revolutionize the way we get everything done…

###__What are Chatbots?__

* Chatbots powered by artificial intelligence have been long touted as something that will kill the apps eventually. They are text or voice-based interfaces that provide support and connect human users with the services or information they need. Some AI bots will help you manage your day data better.

* As per Gartner, in the next couple of years”. 48% of the organizations will use chatbots for customer care and 42% will deploy virtual assistants.

###__Future of AI Chatbots :__

With a variety of ‘Conversational Marketing’ techniques being used such as the voice-assisted Amazon Alexa and chatbots in Messenger, it will be interesting to see how this technology will take over the world. 

__1.Future Apps with Most Popular Chatbots__

* According to BusinessOfApps, messaging apps like WhatsApp which is the most commonly used social media in over 100 countries. It has over 2.5 billion active users. 

* WhatsApp is one of the few apps to be downloaded over five billion times on Android and iOS.

* Gartner predicted that in the next couple of years”. 48% of the organizations will use chatbots for customer care and 42% will deploy virtual assistants.

* They also predicted the use of chatbots in our day-to-day lives to grow to 94% by 2022.

![Whatsapp Users](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vw8zrwpy0ch42g5qeh1d.JPG)

__2.Humanoid Chatbots__
* Chatbots which feel increasingly ‘humanoid’ is already broadly used. All thanks go to natural language processing (NLP). NLP enables chatbots to communicate using complete sentences which have a natural, conversational flow. Dialects, small sounds, deliberate pauses, or even spelling mistakes can help customers feel more at ease. Conversations will feel more ‘realistic and lifelike. 

![NLP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89y14g43yhpptdydg42d.jpg)

__3.Problem-Solving__
* One of the most exciting chatbot trends is resolving the common annoyance of waiting in queue for your call to be answered at a call center. While some issues require human assistance, chatbots are increasingly capable of resolving many of them. Moreover, as chatbots become more human-like, the customer experience will feel as if an actual person is providing the customer service.

__4.Growth of voice-based apps__
* Some suggest that the growing popularity of voice-based software will decrease the usage of standard apps requiring typing. It’s often easier and faster to ask questions or make requests using your voice while leaving your hands free. Typing will remain common for a time, but the future is about voice- and video-based software and bots, such as Amazon Alexa or Google Assistant (AI-based video-interview bot).

Some of the most popular voice-assistants...

![Voice Assistant](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yrzohfomsuorcyvswmif.png)
Django Riffs, a podcast for learning Django
Published: 2021-08-02 20:19:22

I've started a podcast! The podcast is called Django Riffs, and my goal is to help beginners learn how to use [Django](https://www.djangoproject.com/). You can find the show at [djangoriffs.com](https://djangoriffs.com/) or check iTunes, Spotify, or wherever you get podcasts.

Each episode of the podcast will be a topical exploration of one facet of the Django web framework. With many years of Django under my belt, I believe I have the experience to help beginners on their journey into learning Django. More experienced Djangonauts may benefit from a refresher on the subjects that we cover.

With this launch announcement, I am releasing the first two episodes.

* The first episode, [Get To Know Django](https://www.mattlayman.com/django-riffs/get-to-know-django/) gets us situated with where Django exists in the context of the internet and web application development.
* In the second episode, [Enter With URLs](https://www.mattlayman.com/django-riffs/enter-with-urls/) we start our exploration of Django's features by focusing on how Django sets up URLs.

These episodes take quite a while to produce because of the research, preparation, and production of each one. My aim is to get out a new show every couple of weeks if I can.

If you would like, you can follow the show on [djangoriffs.com](https://djangoriffs.com). Or follow me or the show on Twitter at [@mblayman](https://twitter.com/mblayman) or [@djangoriffs](https://twitter.com/djangoriffs).

I hope you enjoy this. Please feel free to reach out to me with comments or feedback. My mission is to make a great Django learning experience for new developers and grow the Django community.
Making beautiful websites: Top 5 FREE font resources
Tags: webdev, design
Published: 2021-08-02 20:14:37



Choosing a beautiful and unique fonts makes your logo and your project stand out.

Check out the top five resources for unique and beautiful fonts below.

PS: Don't forget to check the *bonus link*!


## [fonts.google.com](http://fonts.google.com)
The internet’s source of freely-usable fonts. Period.
Nearly all fonts have different weights, pairing suggestions and they even host the files for you on their blazing-fast content delivery network.

## [fontsquirrel](http://fontsquirrel.com)
The "Free Font Utopia" provides you with hand-selected typefaces that are licensed for commercial work and ready to use. You will find a lot of unique fonts you just won’t find anywhere else.

## [dafont](https://www.dafont.com)
The largest collection with 60 378 free fonts for your creative process.

## [1001fonts](http://1001fonts.com)
15 929 free fonts and counting. Ready to use for your next logo.

## [fontasy](http://fontasy.org)
Fontasy is a free font archive featuring 1101 selected fonts.

## Bonus: [fontspace](http://fontspace.com)
Free downloads of licensed fonts that can be used in your commercial and non-commercial projects right away.

---

Have fun and if you [buy me a coffee](https://www.buymeacoffee.com/martinkr) I can stay awake and write another post ;)
I started studying Python3
Tags: python, education
Published: 2021-08-02 20:05:08

I am encountering employment difficulties with Perl lately, so I decided to cross the gap. A [*"reasons why"* post is also available](https://dev.to/smonff/why-am-i-giving-up-on-perl-4ni6).

I started less than one week ago, so coding is still a bit hard: I am mostly evaluating expressions in the repl, I use [`bpython`](https://bpython-interpreter.org/) and feel extremely satisfied with it.

For now, the feeling is smooth and I am quite happy: everything I am used to in Perl can be found in Python. I see no major differences between the two languages. I am a bit surprised how sometimes the Python core have batteries included, you don't necessarily need to install modules. The only thing I miss is Mojolicious, I mean, I know there are similar tools, but I have habits, and they should simply evolve.

# Reading

So far I am reading:

- [*The Django Tutorial*](https://docs.djangoproject.com/en/3.2/intro/)
- [*The Python tutorial*](https://docs.python.org/3/tutorial/index.html)
- [*Effective Python*](https://effectivepython.com/)

Planning to read:

- [*The Quick Python Book*](https://www.manning.com/books/the-quick-python-book-third-edition)



# Language

Relatively to the language itself here are few things I noticed:

- absence of sigils (`@those %things $you *know`): I really dislike it, it makes code less readable in my opinion. I would be tempted to systematically use `two_words` syntax for variables. With sigils, you target easier what is a variable or what is a keyword. Maybe I am too much used to Perl and that on the long term, this is really a minor issue, especially that functions require parenthesis with Python3, you can’t write `print 'perl is cute'`. 
- functions require parenthesis. It’s a lot of parenthesis typing, I guess my text editor is not configured the right way

# Modules

- I miss [`Data::Printer`](https://metacpan.org/pod/Data::Printer), one of my favorite Perl debugging tools ever. I install it everywhere, even for the simplest project. I searched for equivalents, but none of the one that I found, like [`data_printer`](https://pypi.org/project/data-printer/) (directly inspired from the Perl implementation) or [`objprint`](https://github.com/gaogaotiantian/objprint) are as simple to use out-of-the-box than `Data::Printer`, that also have a better display
Stop using switches the wrong way, use this instead
Tags: javascript, tutorial, codenewbie, beginners
Published: 2021-08-02 19:58:48

# Introduction
![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627946242543/S7r7O4a8K.png)

In this example we have a 'color' variable and a 'colorPsychology' variable, 'colorPsychology' will be assigned a string depending of the value of 'color', so in this case a switch statement works fine. The problem is that since we're just executing one line of code, it ends up being unnecessary long, so we could use a different approach. Lets see

# Using an object instead
![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627933879252/i82Kq9Dy3.png)

A good approach would be using an object where the keys are the names of the color and the values are their respective color psychology

The value assignment of 'colorPsychology' could be a little confusing, but here's what's happening:

1. the colorPsychology variable is created
2. JS looks for the the value of the key color in our colorPsyOptions object
3. since the key is the color variable and this contains a string 'blue', JS will look for the value of the 'blue' key in our object
4. If the 'color' variable contains a value that doesn't isn't a key in our object, it will assign a string 'unknow'

Don't understand objects yet? check the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)

# Using an array when using numbers
In case we're using numbers as keys, we could use a shorter version with an array, like this:

Instead of using this:
![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627933933632/n_GJNjauD.png)

We can do something like this:
![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627933941578/jaJ4v-ReW.png)

# When to use these approaches
When you're just assigning values in the switch statement

# Exercises
Replace the following switch statements with the previous approach

You can use [playcode](https://playcode.io/new/)

### Fruit names translation
![5.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627933982328/7O-k8GNb7.png)

### Planet names
![7.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627934092967/ChZfd51x9.png)

# Results
### Exercise 1
![6.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627934024145/hRgcZdV1T.png)

### Exercise 2
![8.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1627934036923/_UXD9Otjq.png)

I hope this was useful to you and consider following me on Twitter as [@BernardoT0rres](https://twitter.com/BernardoT0rres), I'll be posting daily JavaScript content there
CIS male, trans and non binary for the developer
Published: 2021-08-02 19:20:04

I spent a good deal of time watching YouTube about non binary and transgender individuals because I just wanted to learn, it's a really interesting subject.

I learned that I am a CIS male and that's okay, to me that's an immutable constant, it means that I am the gender I was assigned at birth, what can I say, I like being me. But there are other people who prefer to not see gender as assignment with either a null value, which is a value in itself, they are non binary, not true, not false.

Why? Well there are a thousands of reasons to feel this way, bit if it where my shoes, gender does drive me mad, I am implicitly less of a parent as a male, I like football as a male etc, it's a massive assumption about your state of mind and I get why you wouldn't want to be a part of this antiquated idea.

Transgender although I'm going to simplify this, is an assignment without typesafety for some, it means being assigned true when they should have been false, I'm not sure if it fits into non binary ways of thinking, wanting to go from this to that is not acknowledging non-binary belief by rejecting gender.

Anyway please don't judge me if I'm wrong, at least I am trying to understand it all for no other reason than because it's the decent thing to do
Cookies vs localStorage vs sessionStorage in JavaScript
Tags: cookies, javascript, localstorage, sessionstorage
Published: 2021-08-02 19:16:16

---
title: Cookies vs localStorage vs sessionStorage in JavaScript
published: true
date: 2021-08-02 19:15:14 UTC
tags: Cookies,JavaScript,localStorage,sessionStorage
description: Want to know the differences between Cookies, localStorage, and sessionStorage?
canonical_url: https://blog.jws.app/2020/cookies-vs-localstorage-vs-sessionstorage-in-javascript/
---

Back in 2012, I posted [How to store JavaScript values persistently, locally](https://blog.jws.app/2012/how-to-store-javascript-values-persistently-locally/) (a post that is apparently a bit broken).  I figured that it might be time to revisit the topic.

Let’s start by looking at how to create and read [cookies](https://en.wikipedia.org/wiki/HTTP_cookie), first.

{% codepen https://codepen.io/steinbring/pen/ExPJRmj %}

In the above example, we are creating a cookie called “cookieName” and setting it to expire in 365 days.  Cookies have the downside that you can only store 4kb of data per domain and you have to set the expiry manually.

So, let’s look at localStorage, next.

{% codepen https://codepen.io/steinbring/pen/vYLMaZV %}

In the above localStorage example, we are creating a localStorage object that’s called “lsName”.  It has the benefit of never expiring and having a capacity of 5mb per domain.

So, what about sessionStorage?

{% codepen https://codepen.io/steinbring/pen/RwrOBMv %}

In the above sessionStorage example, we are creating an object called “ssName”.  Like localStorage, sessionStorage has a capacity of 5mb per domain.  Unlike localStorage, the object is only available on the tab where the object was created.  As soon as the tab is closed, the object expires.

Local storage and session storage are also referred to as web storage.  Really, the only reason to use cookies instead of web storage is if you are writing for an HTML4-based browser, which would be crazy.