teleren/devto huggingface dataset:
CRUD in JSON
Tags: javascript, json
Published: 2020-10-16 02:39:36

---
title: CRUD in JSON
published: true
description: 
tags: JavaScript, json
//cover_image: https://direct_url_to_image.jpg
---

```javascript
data = [
 {
  "id": 0.63773,
  "nama": "Zen",
  "asal": "Samarinda"
 },
 {
  "id": 0.5262,
  "nama": "Yogi",
  "asal": "Loa Janan"
 }
]

// create
// tambah data

data.push({
 id: Math.random(),
 nama: "Maryam",
 asal: "Buah hati"
})

// read
// ambil data tertentu

x = data.filter(x => x.id == 0.5262)

// update

n = data.findIndex(x => x.id == 0.5262)
data[n].nama = "Anggi"

// delete

x = data.filter(x => x.id != 0.5262)
```
Github Action for build Svelte
Tags: svelte, javascript
Published: 2020-10-16 01:14:27

---
title: Github Action for build Svelte
published: true
description: 
tags: svelte, javascript
//cover_image: https://direct_url_to_image.jpg
---

```yaml
name: Deploy

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
          
      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: "14.x"

      - name: Cache dependencies Node
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: ${{ runner.os }}-node-

      - name: Install
        run: npm i

      - name: Build Svelte
        run: npm run build

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./public
```
Getting ready to launch DFTW publically 
Tags: webdev, html, css, javascript
Published: 2020-10-16 01:12:42

## You're most likely - already a developer... 

But people ask us all the time 

> "How do I learn programming... or web design... or _What is web design_?..." etc... 

and they probably ask you that too.

## There are sooo many ways to learn 

but this is the one _we built_ and we're really proud of it - and we really do think it's the best way to learn / so, check it out. Maybe you know someone who is in the market.

## **D**esign **f**or _**T**he **W**eb_ is a 6-month online mentorship program that teaches the entire web design and development process from idea to completion. 

It's not really like a boot camp... it's _different_. We're an open book. Feel free to ask us anything about it. We have free open time-slots to give people education or career advice too. No strings attached.

We're probably not going to do any traditional advertising - so, we figured we'd just give money to the people who help us find good matches.

Is that you? [perpetual.education/get-paid-to-match-students/](https://perpetual.education/get-paid-to-match-students/)

Anyway - _you heard it here first!_

: )

{% vimeo 469890807 %}
Herencia múltiple en Java? No, interfaces(Explicado con Cerveza)
Tags: java, oop
Published: 2020-10-16 00:33:13

Uno de los problemas o mejor dicho soluciones que implementó Java para persistir de la herencia múltiple fueron las interfaces. Pero expliquemos, ¿Por qué lo hicieron? Bueno, primero algo de WikiBlogging:

- Herencia múltiple: capacidad para heredar métodos de dos o más clases.

Bien ya sabemos que podemos heredar métodos múltiples por lo que vamos a fabricar nuestro propio vaso robótico que sirve contenido solo y que se llama VasoComun, y por una simple razón queremos que en este vaso tenga la capacidad de servir cerveza y servir agua,  así  que heradamos los metodos de VasoDeAgua y VasoDeCerveza. Venimos de un largo día de trabajo y queremos tomar cerveza y escuchar un poco de música, entonces procedemos a servir en nuestro vaso:

vasoComun.servir();

ESPERÁ, como VasoComun hereda los métodos de VasoDeCerveza y VasoDeAgua, los dos tienen la funcionalidad para poder servirnos, pero VasoDeaAgua.servir(); nos sirve agua y VasoDeCerveza.servir(); nos sirve cerveza.

Exacto, ese es uno de los problemas con la herencia múltiple, de este modo nuestro vaso robótico no va a saber a cuál método recurrir para poder servirnos el contenido, ya que las dos clases tienen el mismo método con el mismo nombre.


A esto se lo conoce como problema del diamante, y paso a mostrarlo en una explicación gráfica(graphic design is my passion):

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



¿Como resuelve esto Java? Gracias a la creación de las interfaces:

>Una interfaz en Java es una colección de métodos abstractos y propiedades constantes.

>En las interfaces se especifica qué se debe hacer pero no su implementación. Serán las clases que implementen estas interfaces las que describen la lógica del comportamiento de los métodos.

Si nosotros creamos una interface para cada vaso

```java
public interface VasoCerveza {
	public String servir(String bebida);
}
```

```java
public interface VasoAgua {
	public String servir(String bebida);
}
```

Al momento de elegir que tipo de contenido queremos en nuestro vaso, podemos elegir si queremos que nos sirva cerveza o agua:

```java
package proyecto.vaso;

public class VasoComun implements VasoCerveza, VasoAgua {
        @Override
	public String servir(bebida){
           return "Te acabo de servir" + bebida;
        }
	

}	
```

De esta forma estaremos reescribiendo el método servir() así que si queremos tomar cerveza vasoComun.servir(cerveza) y ya podemos tomar cerveza, pero si queremos tomar cualquier otra cosa también podemos vasoComun.servir(jugo)

Por si tienen preguntas sobre @Override:

>La anotación @Override simplemente se utiliza, para forzar al compilador a comprobar en tiempo de compilación que estás sobrescribiendo correctamente un método, y de este modo evitar errores en tiempo de ejecución, los cuales serían mucho más difíciles de detectar.

Espero que ayude :P
[Webinar] Integrate PayNow using maesh.js
Tags: javascript, tutorial, payments, webinar
Published: 2020-10-16 00:09:03

[Maesh](https://maesh.io) is happy to announce it's first webinar, **Integrate PayNow using maesh.js**

Want to integrate PayNow into your online store and could not find an easy and hassle-free way? Well, brace yourselves, because we’re going to show you everything you need to do to that. Introducing [Maesh.js](https://maesh.io/docs/maesh-js), a browser-side JavaScript library that lets you integrate Maesh into your platform.

[Register here](https://zoom.us/webinar/register/8916028024617/WN_tnpqk-v8Q1GBTQNKCe60gw) to attend the webinar.

Attend this webinar to accept PayNow payments on your online store with low transaction fees and great customer experience. What are you waiting for?

In just 1 hour, you’ll learn:

- What is Maesh?
- How Maesh.js works?
- How to get started and integrate Maesh into your platform?
- Live coding session of the integration
-‍ PLUS, we’ll be doing a live Q&A session

### Topic
Integrate PayNow using Maesh.js

### When and Where
Date: Thursday October 22nd, 2020
Time: 2-3PM SGT (GMT+8)
[Register here](https://zoom.us/webinar/register/8916028024617/WN_tnpqk-v8Q1GBTQNKCe60gw)

### Speaker
[Aditya Gannavarapu](https://aditya-67.github.io)
Creator of maesh.js


Can’t attend live? Just [register](https://zoom.us/webinar/register/8916028024617/WN_tnpqk-v8Q1GBTQNKCe60gw) and we’ll send out the recording of the webinar after the event.

### About Maesh

[Maesh](https://maesh.io) is an online payment gateway in Singapore facilitating real-time payments (a.k.a. PayNow/FAST) from a consumer's bank account to a merchant's bank account. Our mission is to lower transaction fees for merchants using banking APIs while turning the consumer checkout experience into a breeze.
String Class Java
Tags: java
Published: 2020-10-16 00:02:22

#**Strings**

Strings are variables used in Java for storing text. They are immutable which means they cannot be changed.

There are two different ways to create strings:

String literal
`String s1= "John";`

Using the *new* keyword
`String s2 = new String("Tim");`

##**Commonly Used String Methods**

indexOf()- returns the position of the first occurrence of a specified string as an integer. 
`System.out.println(s1.indexOf("o"));`
`1`

length()-returns the length of the string as an integer.
`System.out.println(s2.length());`
`3`

substring()-returns characters from a string from a specified beginning to a specified end point.
`System.out.println(s1.substring(1,3));`
`oh` 


toLowerCase()/toUpperCase()- converts the string to uppercase or lowercase.
`System.out.println(s1.toUpperCase());`
`JOHN`





###**References**

https://www.geeksforgeeks.org/strings-in-java/

https://www.w3schools.com/java/java_strings.asp

https://www.w3schools.com/java/java_ref_string.asp
How to save current code changes without committing the changes in Git?
Tags: git
Published: 2020-10-16 00:00:00

---
  title: How to save current code changes without committing the changes in Git?
  published: true
  tags: Git
  date: Fri Oct 16 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/save-code-without-committing-changes-in-git
  cover_image: https://melvingeorge.me/_next/static/images/main-878c7b18d11962d2360534cf7151560c.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/save-code-without-committing-changes-in-git)
  
To save the code changes on a branch without committing in Git, First you need to add all the files so that any new files will be included if there is any. It can be done like this,

```bash
git add .
```

Then you can use the

```bash
git stash
```

command.

Now all the uncommitted code will be saved to the Git Stash and all the uncommitted code will be removed from the files too but that doesn't mean it's gone, it's saved 😃.

After doing this operation, you can perform any operation in Git including, changing branches, creating new commits, etc.

To get back the saved code from the stash, you can use the

```bash
git stash pop
```

command.

Now the uncommitted code which was in the stash is added again to the files.

Nifty Trick. Right 🌟. I use this all the time when I have uncommitted code and want to save them but not commit it when switching between branches.

### Meaning of [Stash according to Cambridge Dictionary](https://dictionary.cambridge.org/dictionary/english/stash) **_to store or hide something, especially a large amount: _**

### Feel free to share if you found this useful 😃.

---
Object destructuring for the newbie
Published: 2020-10-15 23:54:10

Many of you will know this - but its something I have been using a lot lately and find to be very useful. so I thought I would share...

ES6 has introduced a new way of declaring variables from objects 

  consider this object:
 ```
    const merchant = {
      firstName: 'John',
      lastName: 'Smith',
      vendorAssignedID: '123456'
    };
```


You could access these as: 
```
  const firstName = merchant.firstName; // would assign a variable (firstName) to have the value of "John";
  const lastName = merchant.lastName; // would assign a variable (lastName) to have the value of "Smith";
  const vendorAssignedID = merchant.vendorAssignedID; // would assign a variable (vendorAssignedID) to have the value of "12345";
```

This causes repetition of the property name and is very verbose - that’s where the object destructuring syntax is useful: you can read a property and assign its value to a variable without duplicating the property name. More than that, you can read multiple properties from the same object in just one statement!


To refactor the above script and apply the object destructuring to access the properties names :

```
  const {  firstName, lastName, vendorAssignedID  } = merchant;
  
    console.log(firstName); // 'John'
    console.log(lastName); // 'Smith'
    console.log(vendorAssignedID); // '123456'
```
 
This statement defines the variables and assigns to them the values of the matching properties of the object.
 
You can alias the variables if the property name is too long for easy use

```
  const { firstName, lastName, vendorAssignedID: ID } = merchant;
  
    console.log(firstName); // 'John'
    console.log(lastName); // 'Smith'
    console.log(ID); // '123456'
```

You can add a default value if the property name does not exist in the object

```
  const { firstName, lastName, vendorAssignedID: ID = '123456' } = merchant;
  
    console.log(firstName); // 'John'
    console.log(lastName); // 'GRiffith'
    console.log(ID); // '123456'
```

There is much more to discuss with what you can do with object destructuring - here are some links from a quick google search

  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
  https://dmitripavlutin.com/javascript-object-destructuring/
  https://javascript.info/destructuring-assignment
  https://codeburst.io/es6-destructuring-the-complete-guide-7f842d08b98f
  https://www.javascripttutorial.net/es6/javascript-object-destructuring/
Como fazer deploy da sua aplicação Angular com GitHub Pages sem bibliotecas externas
Tags: github, angular, githubpages
Published: 2020-10-15 23:46:14

**O que é o GitHub Pages e para que serve?**
É uma ferramenta que permite fazer deploy dos seus repositórios no GitHub em websites de forma gratuita.

**Primeiro passo: habilitar GitHub Pages nas configurações do seu repositório**
Acesse os setting de seu projeto:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t201wjk828z2tlhcltkj.png)
Vá até a sessão Github Pages e configure uma branch e um folder onde ficarão seus arquivos após a build. Pode ser a main ou uma nova branch para isso. Aqui vou dar um exemplo criando a pasta /docs na raiz do projeto.

**Segundo passo: Altere seu arquivo angular.json**
Altere a seguinte linha do seu arquivo angular.json para a nova pasta em que vamos direcionar os arquivos da build.

    "outputPath": "docs/"

**Terceiro passo: Execute a build**
Execute o seguinte comando prestando atenção ao baseHref, substitua username pelo seu usuário no GitHub e seu-repo pelo nome do seu repositório.

    ng build --prod --baseHref=” https://username.github.io/seu-repo/”

**Quarto passo: Página 404.html**
Quando a build estiver completa faça uma cópia da página index.html e renomeie ela para 404.html. É uma página para caso de erro, mas como o GitHub Pages por enquanto não tem uma solução para lidar com rotas, essa alteração faz com que elas funcionem! Mas ainda assim é um hack e a página ainda é servida com status code de 404.
E agora é só commitar!

    git add .
    git commit -m "generated deployables"
    git push -u origin master

**Erro com as imagens?**
Provavelmente você está usando o caminho relativo, prefira utilizar da seguinte forma:

    './assets/images/image.png'
Hacking Our Growth Marketing Software
Tags: hacktoberfest
Published: 2020-10-15 23:33:01

We're halfway through and we just launched our [Growth Marketing Software](https://www.hellomellows.com/) called Hello Mellows!

This gives us plenty of time to do some user testing and really make sure what we're building is as valuable as possible 🙌

The main learnings so far are:

 - Launch as soon as you can, because there is a big difference between what you think people want and what they actually want
 - Talk to as many users as possible
 - Remember to have fun! Often we got carried away trying to do as much as we could we forgot that we should be enjoying the process 😂
 - Finally, we learned that we can do way more than we originally thought! 

Thanks team so far for this opportunity!
I hit ⚡️ 15k ⚡️ commits through Open Source contributions and it broke Github.
Tags: github, hacktoberfest, codenewbie, opensource
Published: 2020-10-15 23:14:26

## ✨ humble beginnings 

Since I made a career change, I knew that contributing to Open Source would be one of my free-time priorities as I deeply believe in collectivism and equity. Feeling a very strong presence of impostor syndrome, I initially contributed in the form of docs, tutorials or code-along lessons to various Open Source projects, mainly coding curricula. Writing has been always easier for me and years in formal and non-formal education helped me develop a sense of how to break complex issues down for newbies. 

## 🌪 picking up speed

My first Open Source contribution was to [girls.js](girls.js) curriculum for girls and women in Poland. Since then, I started enhancing the curriculum of my work place, Flatiron School. I care deeply about [web accessibility](https://dev.to/sylwiavargas/checklist-web-accessibility-3abl) and [diversity and representation](https://dev.to/sylwiavargas/nevertheless-sylwia-vargas-coded-4fn) in tech and so I'd not only add new material, amend old one or fix code to be more a11y-friendly, I'd also add more diverse set of characters in the covert curriculum. Each of such commits would the waterfall down onto many children of the main repo. I wrote about it in April:

![A tweet: "My number of commits has been quite high since I’ve started actively contributing to an open source curriculum where every change avalanches down to all forks. PS. 10100 is really just 20 in binary." Underneath, a screenshot of the github contribution chart with 10,100 commits marked](https://dev-to-uploads.s3.amazonaws.com/i/k8pq9p8l7t0a8jm6qgo2.png)

## 💥 contribution implosion

Three months later (all during long hours of lockdown), I was getting close to 15k contributions. My github profile was hardly ever visible. Here's the last time I was able to load it: 

![A screenshot of the contribution graph showing 14,8k contributions](https://dev-to-uploads.s3.amazonaws.com/i/096rt4t88b8t0zyp1h1l.png)

A month later, in late July, I was not able to access my profile ever. The course I was co-teaching at Yale was ending and I was worried that my malfunctioning github account would impact my chances of catching a recruiter's eye. 

## 🌟 happy resolution

I reached out to Github support and they did confirm that this number of commits is resulting in a timeout error:

![A screenshot of the Github Support email](https://dev-to-uploads.s3.amazonaws.com/i/obizznw4zfg8f85hbyvu.png)

The only solution was to change the settings of my contribution chart from showing all possible contributions to only those made on my own repos:

![A screenshot of the contributions graph showing 583 commits](https://dev-to-uploads.s3.amazonaws.com/i/x0h3vvcaonz255awxl8f.png)

This, of course, did not stop me from contributing — ✨ **I am giddily participating in Hacktoberfest both as a participant and as a maintainer** ✨ 
——
📷 cover photo by [Engin Akyurt](https://www.pexels.com/@enginakyurt) from [pexels](pexels.com)
Microsoft Ignite 2020: All Around Azure Re-cap
Tags: azure, database
Published: 2020-10-15 22:51:44

 📺 000 - Melody Zacharias 🎙️ Frank Boucher & Jason Hand

{% youtube Qx2HkBtJZic %}


In this *special* episode Frank invites Microsoft RD, [Melody Zacharias](https://mvp.microsoft.com/en-us/PublicProfile/5001973?fullName=Melody%20Zacharias) to the show to discuss higlights of from this year's Microsoft Ignite. Melody spends a little time showing off some of the new functionality in Azure Synapse Analytics and answers questions from the live audience on [Twitch](https://twitch.tv/microsoftdeveloper). 

Later in the episode, Jason Hand joins to host a live Kahoot game pitting Frank and Melody against the audience in a game of Azure trivia.

### Useful Links

🔗 [Microsoft Ignite](https://myignite.microsoft.com/home/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Microsoft Ignite News](https://news.microsoft.com/ignite2020/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Sessions on demand](https://myignite.microsoft.com/sessions/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Azure Synapse Analytics](https://azure.microsoft.com/en-us/services/synapse-analytics/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Azure Synapse Analytics Documentation](https://docs.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/?WT.mc_id=allaroundazure-blog-jahand)

### MS Learn links

🔗 [Work with Relational Data in Azure: Learn Module](https://docs.microsoft.com/en-us/learn/paths/work-with-relational-data-in-azure?WT.mc_id=allaroundazure-blog-jahand/)

🔗 [Learn Collection: Azure Synapse](https://docs.microsoft.com/en-us/users/jasonhand/collections/3gyec8611o2ej5/?WT.mc_id=allaroundazure-blog-jahand)

![](https://blog.allaroundazure.com/images/IgniteRecapQuizShow.png)

### Learn more about Melody Zacharias

[Melody Zacharias - Microsoft MVP / RD](https://mvp.microsoft.com/en-us/PublicProfile/5001973?fullName=Melody%20Zacharias)

🔗 [@SQLMelody](https://twitter.com/SQLMelody)


### Find Us On

📺 [Twitch](https://www.twitch.tv/microsoftdeveloper)

🔗 [Twitter](https://twitter.com/allaroundazure)

☁️
All Around Azure Unplugged (Special Episode)
Published: 2020-10-15 22:51:22


#### 📺 040 - Jason Hand 🎙️ Frank Boucher

{% youtube 8fxKquyocdA %}

In the 40th episode of All Around Azure, Frank and Jason pause to discuss previous episodes as well as answer questions with the audience.


### Useful Links

🔗 [Free Azure Account](https://azure.microsoft.com/account/free?WT.mc_id=allaroundazure-blog-jahand)

🔗 [General Learn](https://docs.microsoft.com/en-us/learn/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Exam](https://docs.microsoft.com/en-us/learn/certifications/exams/az-900?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Sonia's blog](https://techcommunity.microsoft.com/t5/itops-talk-blog/exam-review-az-900-microsoft-azure-fundamentals/ba-p/565041?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Learn Module](https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Cloud Skills Challenge (until Oct 15)](https://csc.docs.microsoft.com/ignite/registration/?WT.mc_id=allaroundazure-blog-jahand)

🔗 [Franky's notes](http://www.frankysnotes.com/2018/09/what-happen-when-you-mix-aspnet-core.html)

🔗 [AAA w/ Erik](https://blog.allaroundazure.com/post/2020-07-27-lets-get-started-with-containers-on-azure/)

🔗 [AAA w/ Jay](https://blog.allaroundazure.com/post/2020-08-10-three-ways-to-deploy-on-azure/)

🔗 [Bicep](https://github.com/Azure/bicep)

🔗 [Migration tool](https://appmigration.microsoft.com/)

🔗 [API Mgmt](https://azure.microsoft.com/en-us/services/api-management/?WT.mc_id=allaroundazure-blog-jahand)


### Learn more about Jason Hand and Frank Boucher

🔗 [@jasonhand](https://twitter.com/jasonhand)

🔗 [@fboucheros](https://twitter.com/fboucheros)

### Find Us On

📺 [Twitch](https://www.twitch.tv/microsoftdeveloper)

🔗 [Twitter](https://twitter.com/allaroundazure)

☁️
October 15th, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-10-15 22:50:45

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![Yoda wooping someone's butt](https://media.giphy.com/media/yDYAHbqe5DfyM/giphy.gif)
</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/devteam/what-was-your-win-this-week-550b %}

<center>

![Little kid making a fist as if to say "Yes!"](https://media.giphy.com/media/6brH8dM3zeMyA/giphy.gif)
</center>