teleren/devto huggingface dataset:
Building a Stripe Webhook Server in Typescript with AWS CDK - Part 2
Tags: aws, cdk, typescript
Published: 2020-11-24 08:53:36

---
title: Building a Stripe Webhook Server in Typescript with AWS CDK - Part 2
published: true
description: In this series of posts I am going to walk you through the steps I took to create a Stripe webhook endpoint in AWS.
tags: aws,cdk,typescript
cover_image: https://cdn.substack.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9ca45ba-4727-4065-94e2-24128fddc877_2240x1260.png
---

Apologies for not taking the time to convert these into Dev.to friendly markup. Please head over to my substack for the full articles. 

Part 1 - Describing the stack
https://awscloudsa.substack.com/p/building-a-stripe-webhook-server
Part 2 - Implementation, configuration and deployment
https://awscloudsa.substack.com/p/building-a-stripe-webhook-server-d12
Svelte: change API URLs during Development and Build
Tags: svelte, javascript, rollup
Published: 2020-11-24 08:45:03

This is a frequent question that is asked how to detect whether the environment is either development or production also this is significantly helpful when apps are being frequently published and the client-side app needs API that may be different URL for local/development and during production builds.


#### Solution

Svelte's most adopted bundler is Rollup and the default rollup plugin config looks like this

```js

	plugins: [
		svelte({
			dev: !production,
			css: css => {
				css.write('bundle.css');
			},
			preprocess: sveltePreprocess(),
		}),
		resolve({
			browser: true,
			dedupe: ['svelte']
		}),
		commonjs(),
		typescript({
			sourceMap: !production,
			inlineSources: !production
		}),
		!production && serve(),
		!production && livereload('public'),
		production && terser()
	],
```
<center> <h6> I have stripped out the comments</h6> </center>

We need to add `@rollup/plugin-replace` as a dev dependency. 

```
npm i -D @rollup/plugin-replace
```

General usage and more info check out the [github](https://github.com/rollup/rollup-plugin-replace#usage)

Now, this plugin is going to look for occurrence(s) of `MYURL` and destructively replace it. So consider having an unique string to be replaced.

For easier explanation here is a quick example.

```js
import replace from 'rollup-plugin-replace';

export default {
	// ...
	plugins: [
		replace({
		'MYURL':production?'http://myhost:3000':'http://localhost:3000'
		})
	]
};
```

Example App.svelte 
```html

<script>
  let url = "MYURL";
  let api = "/myendpoint";
  url += api;
  
//your normal fetch logic.

/* async function fetchData() {
		const response = await fetch(url)
		result = await response.json()
		return result
}
*/
</script>

<!--
check URL using your template to verify 
when your svelte app is run in dev mode your URL will be http://localhost:3000/myendpoint
when your svelte app is served after the build (production) your URL will be http://myhost:3000/myendpoint
-->


<p> {url} <p> 

<!-- template logic
{#await fetchData()}
   ...
{/await}
-->

```

#### Advantage of letting rollup replace the URLs.

Good news, we are not exposing the dev and prod API endpoints on the client-side app. We are leveraging the capabilities of rollup during the build process this makes sure that you not only have the URLs securely in your `.env` and has only one file you need to change the base URLs. Take a look [here](https://linguinecode.com/post/how-to-add-environment-variables-to-your-svelte-js-app) how to identify dev or prod the article also achieves using `rollup-plugin-replace`
Behold! The Almighty Code Completion You’ve Been Searching: TabNine 
Tags: programming, productivity
Published: 2020-11-24 08:28:05

Written by Ali


I imagine that you all wish there were a tool that could give you enough insight into what you are doing; context-specific and helpful, which eases your pain and makes you a better craftsman in your career! If you are a developer, that may sound familiar since you are working daily with tons of things with many contexts, making it hard to keep in your head.


The Answer Is Already In Your Code
Have you ever wondered what if a tool could understand your code and tell you what you need to do next or at least give you a hint?

If you think the answer to that question already lives in your code, you already wrote a similar function that looks similar to the new one? Did you get many errors that were telling the same thing? Yes! They are resting in your logs somewhere. Or how about if someone else has done something similar to what you are doing now, and it could be helpful if you could easily have insight about it or a guideline towards it.


A Whole New World
Guess what, we are not alone! In 2012 Gary Bernhardt gave a talk at Strange Loop called “A Whole New World.” He mentioned that he built a tool that is not an IDE or giant lines of codes or a debugger. It uses layers that continuously monitor your code’s context and give you insight into what you are doing, from optimizing your SQL queries to referring to a line that might cause a bug.

 

Sadly there is no such a tool yet, but you could check out Gary’s video and his terrific ideas that, if ever happens, can change the way we are working now.

TabNine — The World’s Most Dangerous AI
Here is a tool being developing for a while called “TabNine” to give you some good news. At first, I just thought it just another fancy tool that machine learning engineers built to show off how cool they are. After I used it for a while, I can tell this tool is not a joke. It freaks me out a bit since it understands what you are doing and gives insight simul while you are doing it.

Do you guys believe this? I just opened my editor and went straight to a line that parses an HTML page and extracts some information from it, and after I wanted to write another query, it gave me precisely what need to write.


Conclusion
As you can see, I do not even have the gopls, which is a Go language server set up yet, but it still gives me a score about what would do next.

If you want to get faster, type less code, and deliver more, you can go to the TabNine website and download TabNine. They provide integration for all kinds of editors and IDEs. Do not hesitate and give it a try.

Become indistractable and get more done by doing less.
The User Won't Notice
Tags: ux
Published: 2020-11-24 08:26:13

A lot of times when building software, you are faced with a product manager, team lead, UX engineer, etc breathing down your neck and asking you to fix a bug or user experience fault you ordinarily know the user won't notice. Sometimes it might not even be a bug requiring a fix, it might just be the person asking you to dedicate some extra time and energy to improve user experience. Then you get stressed and yell, could be under your breath if you value your job or loudly '**The User won't even notice!**' 


![Destressing](https://dev-to-uploads.s3.amazonaws.com/i/d369vv618f4zuquf72bx.gif)

You could even come up with a valid argument that you didn't notice how buggy a lot of software we interact with daily are until you started building software. 

So, this is what happens. Users might never notice the bugs and user experience flaws in your software but they will surely take a toll on the users. The users will just know that they do not enjoy using the software. They might not be able to point out the reason but they'd just know😁, then they want to spend less time using the software and eventually, they just stop using it. That is really bad for you.

Next time before you yell due to the stress, you could just take some time to de-stress and listen to those guys. They are right most of the time.

You are welcome!
Framework & Phases of Project Management in the IT Industry
Tags: framework, management, process, technology
Published: 2020-11-24 08:15:54

Have you noticed? Framework is on every project management job description. Everyone wants you to know how to develop software applications, but not without a framework.

So what is a framework?
Framework is the process of getting through the initiation, requirements collection, design, implementation, testing and deployment stages of a project to produce an application or service.

So, why do you need to understand Framework?

Understanding of Framework makes the process of project management efficient. But there’s a real problem here, with so many different project management approaches, the framework is confusing.

We will give you more clarity on this topic that you will find in every project phase to build a framework for managing the project.
Let’s get started!

Read more: https://www.terralogic.com/framework-phases-of-project-management-in-the-it-industry/
How to choose the right BPO provider for your business
Tags: business, outsourcing, bpo, technology
Published: 2020-11-24 08:13:11

One thing all business people need to learn is – you can’t do it all! Firms run at high efficiency, trying to achieve multiple goals at the same time, putting their resources under a lot of pressure and ultimately, reducing productivity. For a business to thrive, it is critical that a smooth and manageable, maintainable workflow completes all essential tasks. So the question is how can you make better use of your time and resources?

The solution is a BPO service. This means delegating the executable work to another company that is able to perform better than yours. One of the biggest advantages of a BPO is that you will be able to streamline a number of different business processes at the same time. In the past, you may have to conduct extensive in-house training to help your employees better understand the new duties. But with BPO outsourcing, you’ll be able to work with a team of qualified professionals who are already proficient with all the tasks that need to be performed. This way, you can eliminate large volumes of time-consuming work from your internal staff.

Read more: https://www.terralogic.com/how-to-choose-the-right-bpo-provider-for-your-business/
What would you have done?
Tags: book, opensource, python, discuss
Published: 2020-11-24 08:10:55

## About me

Hi, my name is Otu Michael and a backend developer. I have been advised to say that I am a backend engineer but I do not mind. Anyway, While I was in school, I had to interview for a parttime job as a programming tutor - Introducing a group of Higher primary and junior high school kids to computer programming using the python programming language.

I decided to put together my own material from experience and also other tutorials and python documentation.

## Materials

Well, this is a link to the material and its accompanying practicals. You may check it out and give me your feedback and critics. I am still working on it though.

- [swift-python]
- [swift-python-practicals]

## Concerns and legality

Now my concerns:

- How to publish it
- Where to publish it (I was considering GitHub and making it open-source)
- Should it be sold (I really hope not but monetize videos on youtube)

Bear in mind that I have seen a lot of books hosted/published on GitHub and that was what I intended but eventually got confused when I read the [README.md of ydkjs] then [README.md of understandinges6].

#

[swift-python]: https://github.com/Otumian-empire/swift-python
[swift-python-practicals]: https://github.com/Otumian-empire/swift-python-practicals
[readme.md of ydkjs]: https://github.com/getify/You-Dont-Know-JS
[readme.md of understandinges6]: https://github.com/nzakas/understandinges6
5 Reasons why digital products fail?
Tags: products, business, startup, failures
Published: 2020-11-24 08:10:08

According to Harvard Business School there are over 30,000 new products introduced every year (physical and digital), and 95% fail. That’s a disturbing thought for every organization, especially the Startups who run thin on capital. This statistic is an enormous deterrent for all those who aspire to create their dream product one day. That brings us to the main question, why do products fail? And by product failure, we don’t just mean a dull financial return, poor user adaptability and feedback are equally important parameters.

Reason #1: Fixing a Problem that doesn’t exist
The origin of every solution comes from a problem. A Product in today’s competitive market is considered irrelevant if it doesn’t solve a problem that users are troubled with. Such a product eventually disappears from the marketplace and from the user’s mind. To avoid this frequent issue and to thus increase your chances of building a triumphant product, we advocate a strong shot of self-doubt.

Read more: https://www.terralogic.com/reasons-why-digital-products-fail/
7 IoT Trends For 2020
Tags: iot
Published: 2020-11-24 08:07:01

IoT is now an unfamiliar word in all industries. In 2020, perhaps people will not refer to IoT as a hotspot, but we will still see a change compared to the past. Through this article, let’s learn about the 2020 trends of IoT!

The IoT ecosystem allows organizations to connect, control, and use IoT devices. In this ecosystem, an organization can use devices such as smartphones, tablets, etc. to send signals, or access information from another network of IoT devices. In case of signaling, the receiving device will perform the designed work, collect data for quick access and analysis.

Currently, there are four main drivers of the IoT market: ever-expanding Internet connectivity, mobile devices, and sensor devices with lower and lower costs, great investments are pouring into the IoT. In addition, there are four notable barriers to the growth of the IoT market: concerns about cybersecurity, privacy, application process issues, and public advancement. technology is still dispersing.

Read more: https://www.terralogic.com/2020-iot-trends/
YouTube Video | ReactJS Tutorial for Beginners -7
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 08:03:31

In this video, we will first learn about passing data from children to parent component. Then we will learn about the four ways by which we can conditional render a part of the code.

{% youtube TNx5k2z6hPo %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -6
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 08:01:54

In this video, we will learn about destructuring, event handling and binding event handling.

{% youtube BO4RjMaoFJA %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -5
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 08:00:28

In this video, we will learn about state.

{% youtube lh1uDeNR_Xk %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -4
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 07:57:28

In this video, we will learn about JSX and props in this part.

{% youtube t2tcpf2XV0M %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
Why do we Estimate Stories?
Tags: agile, productivity, scrum, culture
Published: 2020-11-24 07:26:36

There are two reasons we estimate stories: (1) To understand scope and (2) then to communicate that size of that scope to others.

# (1) Understanding Scope of Tasks
In order to be effective at anything we do in life, it’s best to step back and understand what it is exactly that we want to accomplish.
```
* How hard is it?
* How complex is it?
* Are there unknowns?
* How long might it take?
* How well do we understand it?
* Are there other tasks that need to be done first?
```

As an individual we ponder these things ourselves. As a team we discuss it together to refine our shared understanding. Asking these questions takes[...] [Continue Reading](https://blog.jstassen.com/2020/09/why-do-we-estimate-stories/)
YouTube Video | ReactJS Tutorial for Beginners -3
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 07:56:04

In this video, we will learn about the biggest building block in React and that are component.

{% youtube XDwpqAC_6qc %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -2
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 07:54:22

Welcome to a new series in which i will go through all of ReactJS- from classes to hooks. In this video we will learn what is ReactJS and why is it used.

{% youtube lt3_3KYQYWo %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | ReactJS Tutorial for Beginners -1
Tags: youtube, react, webdev, showdev
Published: 2020-11-24 07:51:55

Welcome to a new series in which i will go through all of ReactJS- from classes to hooks. In this video we will learn what is ReactJS and why is it used.

{% youtube qvo4LN276WE %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
OpenWrt & Python - a tale from a maintainer (part 2)
Tags: python, openwrt
Published: 2020-11-24 07:47:21

Because **[I wrote a part1 here](https://dev.to/commodo/openwrt-python-a-tale-from-a-maintainer-part-1-28k1)**, I wanted to follow up with a part2 (this article).

In the first part, I touched on CPython's size (when packaging), but now I want to mention speed.
And I never considered speed being so critical with Python (especially CPython) but on some embedded it sure makes a difference.

If you've run Python more than a few times, you've noticed those **.pyc** files it generates. Those are byte-compiled cache files that are loaded into the Python interpreter.
Usually, Python will look if there's a **.pyc** file and if the timestamp (of that file) is newer than the ***.py* file, it will run that **.pyc**.
Otherwise, the file gets re-generated, and then run.

And I never cared about them, but when you're a package maintainer, and you need to save on space on things like OpenWrt (and other embedded things), you'll notice that the Python source file is about the same size as the **.pyc** file.
Debian (for example) seems to ship both these files.

Initially, I packaged just the source files, because deploying Python source files makes sense for humans. You can see the source and you know exactly what you're getting with CPython and the libraries.

Of course, to prevent people from running out of storage flash on their devices when running Python code, byte-compiled caches have been disabled.
That means, that starting a Python program would involve re-generating those cache files every time you'd run a Python script.

It seems that the generation of those **.pyc** is expensive.
There was a report saying that a "Hello World" script in Python would take 500 milliseconds to start (on some slow machines).
When compiling it to **.pyc** and running that, it would take 70 milliseconds.
So definitely an improvement.

Now, what happened was that we switched from shipping Python packages with source (**.py**) files, to shipping/packaging Python packages with byte-compiled (**.pyc**) files.
Also, each Python package would get it' own **python-xxxx-src** version. So users that want the Python sources can choose to install them separately.
It is the best compromise here, to:
* keep the Python packages as small as possible
* have some speed (well, not make it worse)

For reference, I did find some of the old discussions on Github about some of these.
They have some historical meaning for me.
One is dating from 2014, around when I started: https://github.com/openwrt/packages/issues/474

And one about Debian's reproduce-able builds, which relates to all these **.pyc** files: https://github.com/openwrt/packages/issues/5278

Maybe it's a good time to re-spin the old reproduce-able builds effort for OpenWrt :)
Everything you need to know about Winter of Code
Published: 2020-11-24 07:39:56

This is a small writeup from Vishwajeet Raj (https://github.com/vishwajeetraj11) a core team member of DSC NSEC, which organizes Winter of Code to encourage student participation in open source and to gear them up for Google Summer of Code! 

Winter of Code is a program aimed to increase participation for the Google Summer of Code program among students in colleges and universities.
Well, I am actually a 2019 participant of Winter of code. For me, that time of the year thing was pretty tight and I didn’t even want to participate.
why?
I had doubts, my code will be judged.
I didn't have much technical experience. To be precisely honest it was just HTML, CSS, JavaScript.
I had conversations with other participating members and they had so much to contribute.
Participation is important you'll never know how you would have performed unless you actually performed.
But I participated anyway. I had great mentors. It was an amazing experience. I learned a lot of stuff. From knowing nothing about Open Source or Git to knowing concepts like Making PR (Pull Request) to a Git repository, Branching, Keeping your fork in sync, etc. Almost all the basic to intermediate things about Git and Github. Until then I believed there was no difference between Git and Github 😅.
I structured my proposal.
Index Page where at the top I wrote Project Proposal : (Project Name) followed by the index of contents of my proposal (Example: Contact Information, Project Proposal Brief, About Me, Previous Experience — I would suggest include only those experiences that are related to the projects you are applying for).
Contact Information Section included basic details like Phone no, Email, College, and Degree.
Projects Proposal Brief included EACH AND EVERY DETAILED step of actions that I was going to take if I get selected. Every Issue that I was going to fix.
About Me, Section included a link to my Resume a brief introduction which could include all your involvements about tech clubs, your projects and the rest depends on you what you want to put up there. In the end, I put my social profiles.
Previous Experience Section: I didn’t have any experience working on any internships, or organizations. So, I wrote about my projects and how the first one laid out the foundation for the second one. I had only two projects by then.
Timeline Section: (I missed it ). It's important to lay out what time you will be taking to complete one subtask and layout every subtask and the time you will be taking to complete them in a routine.
Well, the basic idea behind Winter of code is making students ready for GSOC so rarely anybody gets rejected but you definitely need to present the proposal like you would have if you were applying for GSOC. Just so that you have some prior experience before you apply for GSOC.
All communication with mentors happened on Slack in 2019.
As a part of Winter of code, they shipped some awesome swags. 

Thanks for reading.
Winter of code invites participation.