teleren/devto huggingface dataset:
3. Create homepage of categories and products - Create a Commerce.js store with Svelte
Tags: javascript, svelte, sapper, commerce
Published: 2020-10-17 14:24:59

Let's first create an index page of all the data we need to build our store with Svelte.

---

{% youtube BZYCg4Rmlx8 %}

---

Inside `/src/routes/index.svelte` we'll doing the following:

- Fetch all merchant information using `commerce.merchants.about()`
- Fetch all categories using `commerce.categories.list()`
- Fetch all products using `commerce.products.list()`
- List our merchant business name
- List all categories, and products, with dynamic links to both

```js
<script context="module">
import commerce from "../lib/commerce.js";

export async function preload() {
  const merchant = await commerce.merchants.about();
  const { data: categories } = await commerce.categories.list();
  const { data: products } = await commerce.products.list();

  return {
    merchant,
    categories,
    products,
  };
}
</script>

<script>
export let merchant;
export let categories;
export let products;
</script>

<h1>{merchant.business_name}</h1>

<ul>
  {#each categories as category}
    <li>
      <a rel="prefetch" href="categories/{category.slug}">{category.name}</a>
    </li>
  {/each}
</ul>

<ul>
  {#each products as product}
    <li>
      <a rel="prefetch" href="products/{product.permalink}">{product.name}</a>
    </li>
  {/each}
</ul>
```
2. Create a Commerce.js instance - Create a Commerce.js store with Svelte
Tags: javascript, svelte, sapper, commerce
Published: 2020-10-17 14:24:20

Before we begin writing any code, let's first create an instance of Commerce.js we can share around our application to fetch products, categories, and merchant information.

---

{% youtube n_T5escg_Pg %}

---

Inside your terminal, install `@chec/commerce.js`:

```bash
npm install -E @chec/commerce.js
```

Now, inside `src`, create a new directory `lib`, and add the file `commerce.js`. We'll follow the [Commerce.js docs](https://commercejs.com/docs/api/#authentication) on instantiating the SDK, and export it as `client`.

```js
// src/lib/commerce.js
import CommerceSDK from "@chec/commerce.js";

const client = new CommerceSDK(
  "..." // Insert your Commerce.js Public API Key
);

export default client;
```

---

_If you don't want to create an account with Commerce.js to follow along with this tutorial, you can use the demo store public key pk_184625ed86f36703d7d233bcf6d519a4f9398f20048ec._
1. Initial setup - Create a Commerce.js store with Svelte
Tags: javascript, svelte, sapper, commerce
Published: 2020-10-17 14:23:50

Svelte describes itself as a radical new approach to building UIs. Svelte takes a unique approach of moving the heavy-lifting from the browser to the compiler at build time.

Svelte doesn't rely on a virtual DOM, but instead is intelligent at writing code to update the actual DOM when the state of your app changes.

Svelte is a great choice for commerce due to how small files are. Product pages that load quicker are great for conversions.

In this tutorial we will touch on some of the basic "before cart/checkout" APIs available from Commerce.js.

---

{% youtube mE6f1rlQX1o %}

---

Let's start by creating a new Svelte Sapper project using the `sapper-template` repository.

Don't forget to give your project a name by replacing `sapper-commercejs-example`:

```bash
npx degit "sveltejs/sapper-template#rollup" sapper-commercejs-example
```

Once it's cloned, `cd` into the directory, and install the dependencies.

```bash
cd sapper-commercejs-example
npm install
```

Now you're ready to go! 

If you make any changes to the `.svelte` route files you should see this reflected in the browser. Do `npm run dev` and head to `localhost:3000` 🚀

💡 _Feel free to remove any unwanted files, styles, or folders from the boilerplate._ I'll go ahead and remove all routes, and components.

In the next step we'll install the `@chec/commerce.js` dependency.
Ruby 3 introduces a new method 'name' on Symbol class
Tags: ruby, ruby3, rails
Published: 2020-10-17 14:20:03

One of the important aspects of Ruby 3.0 is optimization. The part of that optimization is the introduction of the 'name' method for Symbol. Read more at
https://blog.bigbinary.com/2020/10/12/ruby-3-adds-symbol-name.html
Git-Hub Commands that are useful for beginners who want to contribute to the Open Source!!!
Tags: github, opensource, beginners, computerscience
Published: 2020-10-17 14:11:14

Before going to that let us understand what is Git-hub. What is the difference between Git and Git-Hub, GIT is version control system which is used to track changes in the files where as Github is a software which enables you to manage your git repositories.
# Commands
 
When you want to store a folder that is present in your local computer to the git hub which is cloud based software you need to initialize a git repository first.
* git init: This Command is used to initialize repository in your local folder but it is invisible (stored as .git file)
If you want to contribute to any other repository, you should first fork that repository into your account. For that, you can directly click the fork symbol using the UI of Git-hub.
* git clone: To download your repository in your local machine.
You need to have a branch for each of the issue that you are solving so you need to create a branch.
Go to the file location using command prompt or git-bash.
* git branch : It displays all branches of that repository.
* git branch newb : Creates new branch names newb
* git checkout newb : Used to switch branch to newb
So now you can start modifying that repository in your local machine.
After you modify to check the status 
* git status: Used to check the untracked files or un committed files
Every time to you need to keep your local repository updated from where you forked because many developers will be working on same repository so you need to get updates that are merged to the repository. To do that 
* git remote add upstream `link of source repo`: which will add the repository from where you cloned as remote(remote is repo in which you want to contribute).
* git add . : It is used to add the files to the state which we want to track the changes
* git commit -m "Add a meaningful message which describes your changes" : It is used to add the changes to your local repository
* git push origin `branch name` : It is used to push your files into local repository.
Now you can create pull request by going to your repository in git Hub and the maintainers will be able to merge your branch if it doesn't have any conflicts. 
* git branch -d `branch name` : To delete a branch
Hacktoberfest 2020 - My Experience
Tags: hacktoberfest
Published: 2020-10-17 14:08:02

## What I Learned From Hacktoberfest

This was my second time participating in hacktoberfest. I was excited for all the great things to learn. At first I thought it might be difficult to contribute because I might make mistakes but the community is so great . I mean everyone is so kind and humble , everyone helps you grow and learn . This hacktoberfest was a great experience for me and the one that I will always remember.
help creating django REST API
Tags: help, django, python, discuss
Published: 2020-10-17 13:45:51

hello guys!

I need help with a particular project that I'm doing with django REST API framework. 

so in this project, I have access to a REST API (let's call it API # 1) 

and I'm asked to develop my own django API (API # 2)based on the API # 1


so I'm just confused. normally, I have a django project with all data inside database and I create API using data using product models. but in this case, I have no database, no models. the data is coming from API # 1. 


so how do I go about implementing this project?? 


thanks for your time.
My Hacktoberfest Story
Tags: hacktoberfest
Published: 2020-10-17 13:42:19

## What I Learned From Hacktoberfest

This Hacktoberfest, I learnt a lot of new things.
 I got introduced to most awesome open source community. 
The community that gave us lot of free libraries,Its time to give them back. 
I felt the most awesome feeling of helping others. 
Would love to keep contributing to open source community. 
Also I did made some new connections. 

PRs I raised in Hacktoberfest
https://github.com/haroldadmin/WhatTheStack/pull/15
https://github.com/haroldadmin/WhatTheStack/pull/17
https://github.com/AhmadTakkoush/Apple-Developer/pull/4
https://github.com/AhmadTakkoush/Apple-Developer/pull/5

My Github Profile:https://github.com/shivam21
Thanks Hacktoberfest.
How to become a data engineer? Complete learning path
Tags: beginners, career, python, datascience
Published: 2020-10-17 13:29:27

Becoming a data engineer is not an easy path.

There are so many different subjects to control, with knowledge dependency between them that is overwhelming for someone who isn't already proficient in the area.

When I got into the subject, I struggled with that too even though I'm a senior engineer in the Fullstack development area.

Where do I start? SQL is obvious. Then I need to know how to manage a data warehouse? How should the data look in there? OLAP schema design is a subject in and of itself?

That's why I create the site [awesome data engineering - learning path to become a data engineer](https://awesomedataengineering.com).

![Awesome data engineering screenshot](https://dev-to-uploads.s3.amazonaws.com/i/8asx5slxp0fvze1bbaqj.png)

The resources index is open source and up for community contribution!

The site makes it easy to see the different subjects, the complete learning path, and then to filter by the type of resources you prefer on each subject.

Hope you'll find this project useful (:
My First Experience with Open-Source 
Tags: hacktoberfest
Published: 2020-10-17 13:26:39

## **What I Learned From Hacktoberfest** 
*hacktoberfest is one of the most enlighting events that I have been a part of as it helped me make my first few contributions in Open-Source projects. I believe I got a great headstart by participating in this event. Also, It helped me realise that contributing to the Open-Source community is not as scary and difficult as it seems instead Its a great way to connect in a community of coders and share knowledge.*
Peace Negotiation, Alpha demo 
Published: 2020-10-17 13:18:15

---
title: Peace Negotiation, Alpha demo 
published: true
description: petproject, game, gamified negotiation 
tags: 
//cover_image: https://direct_url_to_image.jpg
---
#A Game to Edutain Us for Peace

I currently joined up a George Siedel course on Successful Negotiation at The University of Michigan, on coursera - again, to learn negotiation techniques for the purpose of creating a game that would teach you the tools of the trade.

Combines NVC, a lemmings like platform in a city setting, negotiation, tradecraft, espionage. Maybe even some emotology and gadgets thrown in for good measure.

There is notebook for design and planning I am filling up and there are a lot of plans for the game. If it seems like interesting... do join me please!
PS I'm using js and phaser with the http-server for example
the project is called PACEalpha and is in a demo phase still...
How to write leave application for school
Tags: leaveapplication
Published: 2020-10-17 12:53:01

At some point in time, we need to take leave from school or office. But we get the leave only if we write the leaving application letter mentioning the reason behind it to the concerned person. 

It is really essential to submit a leave application in the office and leave application in school when you are planning to go out for few days with family or friends, or if your health is not well and the doctor has advised you to take rest. 

Informing the administration about your leave will have a good impression on them and moreover, they would be able to manage the work with the other available employees.

so that you can refer - 
https://leaveapplication.online/one-day-leave-application-for-school/

In this type of situation students may need leave for one day, two day or more. This can help you in that situation.
balalaika IT newsletter #12
Tags: react, node, java, webdev
Published: 2020-10-17 12:49:00

---
title: balalaika IT newsletter #12
published: true
description: Curated IT newsletter. From Russia with love. Issue #12.
tags: #react #node #java #webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/7dwkz927sf2ausnqygq3.jpg
canonical_url: https://blog.balalaikait.com/balalaika-it-newsletter-12
---

**This is our 12th newsletter. It means we are exploring the world of web development together for half a year. Sad to say, but there will not be any new issues of the newsletter for a long while. This is not a goodbye, rather a see you later. In the meantime, feel free to subscribe to the personal blogs of our curators: https://medium.com/@apechkurov and https://blog.goncharov.page/. Let's stay in touch!**

# General
- [In this post](http://brandonharris.io/redshift-clickhouse-time-series/) Brandon Harris shows us how to synthesize billions of rows of true time series data with an autoregressive component, and then explore it with ClickHouse, a big data scale OLAP RDBMS, all on AWS.
- [DuckDB](https://duckdb.org/) - an embeddable database for analytical workloads. 
- Do you think mmap is faster than syscalls? Well, mmap could make your app run faster, but with strings attached. Sasha Fedorova gives us a [great in-depth explanation of how it works](https://medium.com/@sasha_f/why-mmap-is-faster-than-system-calls-24718e75ab37).
- Distributed transactions are hard to implement right. In fact, many modern databases do not even bother with supporting them. FaunaDB is not one of those, as it builds transactions on top of [Calvin](https://blog.acolyer.org/2019/03/29/calvin-fast-distributed-transactions-for-partitioned-database-systems/) algorithm.

# Java
- Tiered JIT compilation can be found in multiple modern runtimes and JVM is no difference. Some time ago Rafael Winterhalter gave a nice [talk](https://youtu.be/hjpzLXoUu1Y) on basic principles behind C2 compiler in HotSpot.
- `ForkJoinPool` is available since Java 7 and used in several places within standard library, like parallel streams. It embeds many good ideas, like queue per worker and work stealing. If you are not familiar with these details, you may find them in the original [paper](http://gee.cs.oswego.edu/dl/papers/fj.pdf) by Doug Lea.

# JavaScript
- Monomorphism is a very important definition for JIT compilation in JavaScript (and not only - see the above Rafael Winterhalter's talk). Several years ago, Vyacheslav Egorov wrote a brilliant [post](https://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html) to explain how V8's JIT compiler makes use of monomorphism.
- [esbuild](https://github.com/evanw/esbuild) - a new kid in the family of bundlers and minifiers. Written in Go. Claims to be extremely fast.
- NPM 7 is out. Lots of new goodies. Read more about them [here](https://dev.to/ruyadorno/announcing-npm7-16j0).
Completed Hacktobefest Challenge
Tags: hacktoberfest
Published: 2020-10-17 12:47:34

It was a great experience as open source is a great way to learn and give back to the community !
This was my first #hacktoberfest participation :)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/77xb05h5q47r7x4seoa8.png)
Install ElasticSearch,Logstash and kibana on Local System(windows) Part -02
Published: 2020-10-17 12:24:08

**Steps For Windows 10**

**1**.[Download ElasticSearch](https://www.elastic.co/downloads/elasticsearch)
[Download Logstash](https://www.elastic.co/downloads/logstash)
[Download Kibana](https://www.elastic.co/downloads/kibana) :- Download zip files from this link.

**2**.To start elastic search service
-Extract downloaded zip and open bin directory in command prompt(As Admin)
- Type command "elasticsearch.bat"

**3**. To start kibana service
-Extract downloaded zip and open bin directory in command prompt(As Admin)
- Type command "kibana.bat"

**4**. To start Logstash service
-Extract downloaded zip and open bin directory in command prompt(As Admin)
-create configuration file "logstash.conf" in configuration file you need to confgiure INPUT(from where you want to fetch data),OUTPUT(where you want to send data) in our example output will be elastic search (for example output{ elasticsearch { hosts =>["localhost:9200"] index => "indexForLogstash }} ,hosts in which port your elasticsearch service is running.
-Type command "logstash -f logstash.conf".

You can visualise your data in kibana using index which is in logstash configuration.
Amazing and exciting journey at the hacktoberfest in this monotonous pandemic. Yayy!!!
Tags: hacktoberfest
Published: 2020-10-17 12:13:25

Second attempt at this hacktoberfest challenge, but the end of year 2020 provided a bunch of happiness in this October month. It was a wonderful experience in successfully pulling 4 PRs and winning the Swag Tees. Never imagined this pandemic would bring some kind fun while sitting at home :P 


Thanks a lot DigitalOcean and the Hacktoberfest team for this amazing job !!!
My hacktoberfest 2020 ✨ 
Tags: hacktoberfest, opensource, portfolio
Published: 2020-10-17 12:13:09

---
title: My hacktoberfest 2020 ✨ 
published: true
tags: hacktoberfest, opensource, portfolio
---

This is my third time joining Hacktoberfest, and every time I take something else away from it. 
This year I came prepared for at least one PR! I don't remember exactly how and when I learned about Wes Bos' his uses page. Probably on the Syntax podcast. I was till working on my own portfolio website (and still am). But decided that Hacktober 2020 should be my deadline for that, and have at least that page up so I could add myself for this years Hacktoberfest. And I did! 
As I said, my site is not none yet, but isn't a portfolio website always under construction? 

Check out https://uses.tech/ and see if you can find me ;) 

Also you can add yourself of course, if it's not this year, get it ready for next year! 

Good luck everybody, and Happy Hacktoberfest!
Basic Setup for a Maze Scene with Physics with A-Frame
Tags: webvr, aframe, html, webdev
Published: 2020-10-17 12:00:07

{% youtube WtpUDDhqeQk %}

Quick video showing how to add basic physics to an A-Frame scene, in this example adding walls and demoing collisions between player and wall. This could be built on to create a larger 3D environment or maze , but gives you a start
Daily Developer Jokes - Saturday, Oct 17, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-10-17 12:00:06

---
title: "Daily Developer Jokes - Saturday, Oct 17, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Saturday%2C%20Oct%2017%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259ce87a7e.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What did the Network Administrator say when they caught a nasty virus?

___A:___ It hurts when IP
 -->
Completed Hacktobefest Challenge
Tags: hacktoberfest, opensource, github
Published: 2020-10-17 11:57:32

## What I Learned From Hacktoberfest

So, this year Hacktoberfest is quite adventurous for me. Right from being an organiser to a contributor. As we all know this year due to Covid19 we're not able to conduct or join any offline events so on keeping that in mind we had organised online session **Opensource 101** for newbies who were putting their feet first time in the opensource world. 

We had also created a project for them to contribute, the theme of the project is inspiring for me, the project's theme is Women Safety and the name of the project is [YouSafe](https://github.com/neil-dev/YouSafe) you must check out it's based on Flutter and Kotlin for now. So, in this project, I played the role of maintainer for this project.

Apart from this project I also contributed to a few other opensource projects of Organisations. Which was also a great experience for me. Now all thanks go to DigitalOcean, DEV.to, and other sponsors.

<!-- What did you learn that can help others contribute to the project you worked on? What did you learn that can help the users of that project?! -->
AWS Chatbot and AWS Budget with Slack, CDK + CF
Tags: aws, bots
Published: 2020-10-17 11:56:54

I recently wrote an article about AWS Budget and supplied a Github repo with CloudFormation to get up and running with Budgets nice and quick. But, the notifications for the budget alarms went via email which is kinda boring. This article builds on that to use AWS Chatbot to integrate with Slack to get notifications.

Full article for previous write up at https://www.talkncloud.com/aws-essential-setting-budget-and-alarms/

There are three key parts to this setup:

    1. Setup a Slack channel
    2. Setup AWS Chatbot and authenticate with Slack
    3. Deploy the stack via the Deploy Stack button or AWS CDK

####Slack Channel
Create a new Slack channel and grab the channel ID, you'll find the channel ID at the end of the url if you're in the channel after the last "/"

####AWS Chatbot
Login to the AWS console and head over to Chatbot. The welcome screen will ask you to configure a client, go ahead and configure a new slack client. If you're already authenticated you'll be presented with a permissions overview and request to "Allow" the proposed. Review and proceed.

When you return you should land on the chatbot screen, grab the workspace ID, we'll need it later.

####Slack App
Jump back into Slack and add the AWS app to your Slack channel, I setup a demo aws-chatops channel for this demo but you might have an existing chatops channel to use. It should appear in your apps and won't need to be authenticated from here.

####Deploy the stack
I've provided a "Deploy Stack" CloudFormation project ready to go. Head over to the Github repo page and hit the button. You'll need to enter the following parameters into AWS CloudFormation after hitting the button:

    1. Email
    2. Workspace ID
    3. Slack Channel ID
    4. Spend / Budget

Like the previous project, everything is available and open source. Please feel free to share, make edits, improve etc. I should also note the stack is written in AWS CDK, so you can totally customize it, remove the parameters and is a working example of Budget, SNS and Chatbot.

https://github.com/talkncloud/aws/tree/main/essential-billing-bot

####The end result
You'll end up with a pretty sweet setup, once your budget hits 80% you'll receive an email and also a notification in your slack channel which should flow nicely into any existing chatops workflows you have already.

####More details
If you want to get into more details I have a detailed write up on this setup and it outlines the costs associated with this deployment. You can check out the full write up on talkncloud - https://www.talkncloud.com/enter-the-bots-aws-budgets-with-bots/

If you have any questions please let me know, happy to help out!