teleren/devto huggingface dataset:
Preview: customer lifecycle management with no-code
Tags: tutorial, payments, stripe
Published: 2022-11-13 16:56:46

{% youtube https://www.youtube.com/watch?v=gA2Fla6mvWQ %}


## What you’ll learn

In this episode, you'll learn how to set up a Payment Link and the new no-code customer portal (beta) to build a SaaS with no-code. With only these two links that fit in a Tweet, you can build a working recurring SaaS business. 

## Who this video is for

This video guide is primarily for developers and no-coders who are curious about building a business that accepts recurring payments. 

## How to follow along

If you want to work alongside the video, you’ll need a [Stripe account](https://dashboard.stripe.com/register) and access to the beta program for the no-code customer portal. Please email us if you would like to participate in the beta program for the no-code portal: customer-portal-beta@stripe.com. 

## Resources
- [Documentation for integrating the customer portal](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal)
- [Payment Links documentation](https://stripe.com/docs/payments/payment-links)

## What to watch next
- [Introducing the embeddable pricing table for SaaS businesses](https://www.youtube.com/watch?v=tY8fVEoPHIc)


## Stay connected

**You can stay up to date with Stripe** **Developer updates** **in a few ways:**

- 📣Follow [@StripeDev](https://twitter.com/stripedev) and [our team](https://twitter.com/i/lists/1459720002567868418) on [Twitter](https://twitter.com/StripeDev)
- 📺 Subscribe to our [Youtube channel](https://www.youtube.com/StripeDevelopers)
- 💬 Join the official [Discord server](https://discord.com/invite/RuJnSBXrQn)
- 📧 Sign up for the [Dev Digest](https://go.stripe.global/dev-digest)
Spice up your Ubuntu terminal (Using zsh and powerlevel10k repo.)
Tags: ubuntu, linux, vscode, github
Published: 2022-11-13 16:42:46



# Install zsh

First install zsh using 

```bash
sudo apt install zsh
```

now set zsh as your shell

```bash
chsh /bin/zsh
```

now restart your machine and open your terminal 

if you see some option just press (2)

now check if your using the zsh by running the following command 

```bash
echo $0
```

# Install oh my zsh.

now install oh my zsh 

using 

```bash
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```

here you will see something like this 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0umjep1ykms3simj8uav.png)

now add your fonts 

you can skip this step if you want 

First install gnome tweaks

```bash
sudo apt install gnome-tweaks
```

if you want to add custom fonts just create a folder and name it ( .fonts ) and add all your fonts init

now open gnome tweaks

then int the font option change the monospace text to the fonts you want to use.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hlcl9x855r0f3t4j5pkh.png)

# Powerlevel10k Repo.

Now you can install the power level 10k repo

```bash
**git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k**
```

now open .zshrc

```bash
gedit ~/.zshrc
```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjhbaqm4htp1ork3tdit.png)

now change the roggyrussell to powerlevel10k/powerlevel10k and restart the terminal.

Now customize it to your liking and by any chance if your not happy with your customization you can restart from the beginning.

here’s what i did.

and here’s the final result.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5cgyct3ay2tkqq6jb1p9.png)
Hullo Mastodon
Published: 2022-11-13 16:37:12

I was going to start with "you may notice some changes on this site..." but then I realized that literally no one reads this hahaha...😭

Since the worst person in the world has well and truly sunk his claws into Twitter, I've decided to migrate off of it and fully commit to Mastodon. My account on [this instance](https://anarchism.space) has been sitting around for 4 years and I've finally dusted it off to go explore.

I like it!

It seems less incendiary, people don't seem to rush to 'gotchas' and 'takes', and with the way federated social networks work, you do have more control over your own timeline.

I am cautiously optimistic.

Find me [here ](https://anarchism.space/web/accounts/53213).
List comprehensions in python
Tags: webdev, python, lis, shuhaib
Published: 2022-11-13 15:37:14

**List in python**

Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuples, Set, and Dictionary, all with different qualities and usage.

##How to mutate the value and set the new value in list?

```
nums = [1,2,3,4]

## we can double this value with 2 ( num *2 ) 

doubled = [x * 2 for x in nums ]

## output is : [2, 4, 6, 8]
```

**How it worked?**
each iteration the x will be stored as calculated with 2 


##How to filter the list?

```
nums = [1,2,3,4]

## we can double this value with 2 ( num *2 ) 

filtered = [x  for x in nums if x > 2]

## output is : [3, 4]
```

**How it worked?**
each iteration the x will be checked with the condition and stored

##How to filter the List of dictionaries?

```
names = [
{"name":"abil"}, {"name":"john"},{"name":"willing"},{"name":"sam"}
]

## we can double this value with 2 ( num *2 ) 

filtered_names = [item  for item in names if item.startswith("s")]

## output is : [{"name":"sam"}]
```

**How it worked?**
each iteration the x will be checked with the condition and stored
Progress on Open Source DVB-S2 FPGA Encoder
Tags: opensource, fpga, vhdl
Published: 2022-11-13 16:12:40


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/srsz0ymifpnpud5uwcvg.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mcru263j2a2g33wvkgex.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/alumtokelo3rjk920q2n.png)
EKS Blueprints - easier and faster way to adopt Kubernetes
Tags: aws, eks, terraform, iac
Published: 2022-11-13 15:59:48

In the microservices world, a considerable amount of containerized applications are run on Kubernetes. It's one of the best open-source projects of all time. However, adopting it is a different story. Due to the complexity and lack of inadequate IT resources, many organizations find it challenging. 

In this journey, if we think about the pain points which are holding the development teams back.

* Developer wait time. It takes weeks to provision the infrastructure and then configure it with the required add-ons.
* Difficulty in tracking infrastructure changes over time.
* Lack of Automation. Software is manually deployed on an ad-hoc basis.
* Tooling and configuration inconsistencies across teams and environments.
* Ensure the security best practices on cluster and application levels.

Imagine if we could have a template that helps us to address all these pain points and accelerate time to market. EKS Blueprints offers all of it. 

## What is EKS Blueprints

It's a set of Infrastructures as Code scripts organized as a template that helps you provision EKS clusters, bootstrapped with all required add-ons to deploy and operate workloads in the cluster. Once a template is configured, you can use it as a blueprint to spawn consistent environments across multiple AWS accounts and regions.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bw7yjnrtp9c54pn9m2vo.png)

## Benefits
Once we adopt EKS Blueprints with GitOps to manage the application delivery, we can eliminate the end-to-end manual processes. Create any number of  Well-Architected environments, and destroy them at will. Then, recreate them quickly or revert them to any point in time. Also can manage teams, namespaces, and access control from the same git repo where you define the infrastructure. This means you can iterate rapidly. Consistency is another significant benefit we can achieve with IaC. It also allows the entire infra to be version controlled and updated using proper review and approval processes.

## Live Demo

{% embed https://youtu.be/AavVfkZQp4k %}


## Repos

### Repos used for the live demo.
https://github.com/lkravi/eks_blueprints
https://github.com/lkravi/eks_blueprints_workloads
https://github.com/lkravi/eks_blueprints_demo_app

### AWS EKS BluePrint for Terraform Repo
https://github.com/aws-ia/terraform-aws-eks-blueprints

Finally I would like to thank awesome AWS containers team for initiating this Open source repo and making our life easier. [Apoorva_Kulkarni](https://www.linkedin.com/in/askulkarni84/), [Kevin_Coleman](https://www.linkedin.com/in/kevin-coleman-a3737326/), [Mikhail_Shapirov](https://www.linkedin.com/in/mikhail-shapirov-41968612/), [Vara_Bonthu](https://www.linkedin.com/in/varaprofile/), [Zvika Nadav](https://www.linkedin.com/in/zvika-nadav/)
Career planning in chaotic markets
Tags: career, codenewbie, computerscience, motivation
Published: 2022-11-13 15:49:03

The recent chaos in with the layoffs must be part of your news feeds for a while now. Apart from the humane aspect of feeling bad about the ones affected one also needs to realize there are close to [120K more competitors](https://layoffs.fyi) for fewer number of jobs in the market. 

From my personal experience of 3 recessions (2001,2008,2020) I can safely tell you the branding forces have already dispatched ripples in you career path. There are much larger forces at play and feeling overwhelmed by the news is understandable.

You can choose to do the following things which are in your control and leave the rest to the market forces.

1. Up-skill in the stack you already know. Don't prepare for interviews blindly in hope.
2. Don't invest in certifications immediately.
3. Focus on fundamentals of programming like database internals, networking, compilers, performance etc.
4. Learn about personal finance.
5. Understand software as a business beyond coding.
6. Tune your networks to get rid of noisy connections that add no value just spam the feed.

Based on my 17+ years of experience across engineering and research I have created courses that should help you navigate such situations for the rest of your career. 

### **Discount coupons for the courses.** 

**[Highest Rated]** [Software Engineering Career Bootcamp: From intern to CXO] (https://www.udemy.com/course/software-career-planning-bootcamp/?couponCode=NOV-DEAL)

**[Highest Rated]** [Software Roles, Responsibilities, IT Recruitment Masterclass](https://www.udemy.com/course/rookie-coders/?couponCode=NOV-DEAL)

[Debugging Bootcamp: Debugging software by first principles](https://www.udemy.com/course/system-debugging-essentials-beyond-debuggers/?couponCode=NOV-DEAL)

[Cracking the Coding Interview: Think beyond FAANG, Leetcode]
(https://www.udemy.com/course/system-design-interview-upskill-career/?couponCode=NOV-DEAL)

[Personal Finance Fundamentals: Finance for long-term goals]
(https://www.udemy.com/course/financial-awareness-for-students-and-professionals/?couponCode=NOV-DEAL)

[Computer Science & Management tools: Software career growth]
(https://www.udemy.com/course/fundamentals-software-programmer-career-engineering/?couponCode=NOV-DEAL)

[Thriving in a Hybrid Work Environment: Practical Techniques]
(https://www.udemy.com/course/thriving-in-a-hybrid-work-environment/?couponCode=NOV-DEAL)

{% embed https://youtu.be/4xRY5XUflQI %}
Progress bar to show content read/remaining.
Tags: react, css, html, javascript
Published: 2022-11-13 15:37:10

I found [this](https://flexiple.com/react/introduction-to-higher-order-components-in-react-by-example/) website where a progress bar is shown which helps users to know how much content they have read or is still remaining.

I tried to recreate that in react and it is easy and involves a bit of maths!


## How to get the percentage? 


![Mathematical explanation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idaa4c1adamm8822ducu.png)


Simple maths :)

## Code: 

{% embed https://gist.github.com/SagarTrimukhe/942f08d1ab4308b79a33fe4e5ff1f3b0 %}


## Demo:

![Progress_bar_demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwmuszmgkap27uisc9q4.gif)
Express Sessions with a SQLite Backend
Tags: javascript, webdev, node, beginners
Published: 2022-11-13 15:32:56

The default in memory store that is used in express-sessions results in memory leaks and isn't recommended for production. However we can use postgres or sqlite as a session backend very easily.

These notes follow:

https://nivethan.dev/devlog/express-sessions.html

This will be the notes for the sqlite one and my pg notes can be found at:

https://nivethan.dev/devlog/setting-up-authentication-in-node.html

The first step as always:

```
npm install better-sqlite3
npm install better-sqlite3-session-store
```

I need to install better-sqlite3 first because I use the sqlite3 package with sequelize for my orm. This does mean that I have 2 libraries that both handle sqlite. The better one is indeed better but not yet supported in sequelize.

The second step, as always is to update app.js.

```
var sqlite = require("better-sqlite3");
var SqliteStore = require("better-sqlite3-session-store")(session)
var sessionsDB = new sqlite("sessions.db");

var app = express();

app.use(session({
    proxy: process.env.ENV === 'production',
    store: new SqliteStore({
        client: sessionsDB,
    }),
    secret: process.env.SECRET,
    resave: true,
    saveUninitialized: false,
    cookie: {},
}));
```

Voila! We are done! Now sessions will be set and persisted through sessions.db. This file will be created at the app.js level.
Express Sessions
Tags: express, javascript, node, beginners
Published: 2022-11-13 15:30:03

This is my notes for the express-sessions library. This is middleware for express that adds support for sessions. The default uses an in memory store that leaks memory. However it is quite easy to set up a different backend.

The first step:

```
npm install express-sessions
```

The second step as always, is to update app.js:

```
var session = require('express-session')

var app = express();

app.use(session({
    proxy: process.env.ENV === 'production',
    secret: process.env.SECRET,
    resave: true,
    saveUninitialized: false,
    cookie: {},
}));
```

The proxy flag sets it so express trusts cookies sent to it by a reverse proxy like nginx. This is needed when the cookie is in secure mode which it should be in production. This would require https but if you use a reverse proxy, this https is already handled at that level and the request is simply passed to node.

Now we are ready to use sessions!

This is what a very bad user login system would look like.

```
var express = require('express');
var router = express.Router();

router.get('/login', function(req, res, next) {
    res.render("login", {});
});

router.post('/login', function(req, res, next) {
    if (req.body.username !== "nivethan") {
        return res.send("Invalid username.");
    }
    if (req.body.password !== "123") {
        return res.send("Invalid password.");
    }

    req.session.loggedIn = true;

    res.redirect("/");
});

router.get('/logout', function(req, res, next) {
    req.session.destroy();
    return res.redirect("/");
});

module.exports = router;
```

When a user logs in we set the loggedIn flag on the session.

We can then use add our own session middleware to check for a valid session.

This would be routes/validateAdmin.js:

```
module.exports = (req, res, next) => req.session && req.session.loggedIn
    ? next()
    : res.redirect("/login");
```

This will check for a session before handling the request. If the session doesn't exist it will redirect back to the login page.

Now we can do the following:

```
var express = require('express');
var router = express.Router();

var validateAccess = require("./validateAccess");

router.get('/admin/', validateAdmin, async function(req, res, next) {
    res.render("admin", {});
});
```

Voila! We have used sessions to enable logging in.
🔧 Using git with a local ssh server
Published: 2022-11-13 15:06:16

---
title: 🔧 Using git with a local ssh server
published: true
description: Have two computers at home or you don't feel like sharing the project you're working on to github/gitlab just yet? Use git + ssh to keep those two projects in sync and its super easy!
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Let's say you're ripping on a project and maybe have two computers at home or you don't feel like sharing the project you're working on to github/gitlab just yet.

You can use git + ssh to keep those two projects in sync and its super easy.

This is also a good way to work projects across computers without having to rsync or scp files.

Assuming you have a git project and a ssh connection already, you are pretty much all set. Just follow these instructions:

```bash
# on the remote server copy down what git you do have _or_
# create a new folder/git to sync it to
ssh user@host "git init --bare /mnt/foo/bar/my-project.git"

# then add that remote server
git remote add origin ssh://user@host/mnt/foo/bar/my-project.git

# and finally, push to it!
git push origin master
```

Keep in mind, if you already have an origin, you can rename that to something like "local-server", then you have a "git push local-server" for local testing or "git push origin" for when its time to really deploy.

Happy coding!
6 months
Published: 2022-11-13 15:06:04

---
series: progress
---
Once upon a time, 6 months of intense focus changed my life. I was happy, productive and appreciative of everything that happened to me. It felt like a magical place to live in.

Somewhere along the way I lost my momentum. Now, I've reached a very dark place. This will make me a stronger person. Sometimes to find the light, we must first touch the darkness.

I want my every shot to hit the bull's eye again. I've done it before and can do it again.

So this is me documenting my journey to become a stronger person by May 15 2023. That's 26 weeks.

## Goals
```
1. self-driven, confident and making good progress on own project
2. visible progress - PRs, reviews, blogs
3. in depth knowledge
4. healthy body and mind
5. gratitude
6. independent
```

I'm excited.

See you on the other side,
celeana
Poll Percentages in JavaScropt
Tags: javascript, percentage, poll, webdev
Published: 2022-11-13 15:03:40

Its a simple poll app in Js. where user vote count and percentages will change accordingly. But the problem i am facing is the percentages are not updated, lets say total vote is 5 and yes vote is 3 among them so yes vote percentage should be updates as the no votes comes along but it not been updated automatically.

HTML 

```
> <!DOCTYPE html>
> <html lang="en">
> <head>
>   <meta charset="UTF-8">
>   <meta http-equiv="X-UA-Compatible" content="IE=edge">
>   <meta name="viewport" content="width=device-width, initial-scale=1.0">
>   <title>Document</title>
> </head>
> <body>
>   <fieldset>
>     <legend>do you like pizza</legend>
>     <div id="count"> 0</div>
>     <button id="btn">yes</button>
>     <br></br>
>     <div id="ncount"> 0</div>
>     <button id="Nbtn">no</button>
>     <br></br>
>     <div id="per"></div>
>   </fieldset>
>   <script src="main.js"></script>
> </body>
> </html>

```
JS

```
let count = document.getElementById('count')
let ncount = document.getElementById('ncount')

let num = 0;
let nnum = 0;

document.getElementById('btn').addEventListener('click', () => {
  let nper = document.getElementById('per')
  num++

  let total = num + nnum

  let totalPercentages = num / total * 100

  count.innerHTML = num + " " + "percentages" + totalPercentages + '%'


  nper.innerHTML = nnum + num + '<div></div>' + "total vote cast"
})

document.getElementById('Nbtn').addEventListener('click', () => {
  let per = document.getElementById('per')
  nnum++
  let total = num + nnum
  let totalPercentages = nnum / total * 100
  ncount.innerHTML = nnum + " " + totalPercentages + '%'
  per.innerHTML = num + nnum + '<div></div>' + "total vote cast"
})
```
📦 Set up minio w/ Laravel (Local S3)
Tags: laravel, aws, s3, selfhosted
Published: 2022-11-13 15:02:57

---
title: 📦 Set up minio w/ Laravel (Local S3)
published: true
description: Ever wanted all the benefits of S3 without the cost? Or maybe want to run your own local S3? Learn how.
tags: laravel, aws, s3, selfhosted
//cover_image: https://direct_url_to_image.jpg
---

# Example docker-compose.yml for development
```yaml
version: "3.9"
services:
  web:
    build:
      context: .
      dockerfile: Dockerfile.web
    volumes:
      - ./:/app
    ports:
      - "8000:8000"
  storage:
      hostname: minio
      image: quay.io/minio/minio
      command: server /data --console-address :9001
      environment:
          MINIO_ROOT_USER: minio
          MINIO_ROOT_PASSWORD: minio123
      healthcheck:
          test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
          interval: 30s
          timeout: 20s
          retries: 3
      volumes:
          - ./storage/data:/data
      ports:
          - "9005:9000"
          - "9006:9001"
```

Now with that in place, setup a `.env`

```bash
AWS_ACCESS_KEY_ID=minio
AWS_SECRET_ACCESS_KEY=minio123
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=testbucket
AWS_USE_PATH_STYLE_ENDPOINT=true
AWS_ENDPOINT=http://minio:9000
```

And that is it! You are ready to rock. Just remember to set
```bash
FILESYSTEM_DRIVER=s3
```

And let it eat!

```php
Route::get('/',function(){
    return Storage::files();
});
```

Stick around and later we'll learn how to upload files there!
button event dispatch action on second click
Published: 2022-11-13 15:02:43

i'm trying to build a fake authentication react app with redux toolkits.

the problem is the button works only on second click.
the first click only checks the validation form, i had to click second one to pass to the action and change the redux state

this is my create account function:

```
 const createAccount = (event) => {
    const form = event.currentTarget;
    if (form.checkValidity() === false) {
      event.preventDefault();
      event.stopPropagation();
    }

    setValidated(true);

    const findUser = userList.find((user) => user.email === email);
    // console.log(typeof findUser);
    if (validated) {
      if (findUser) {
        alert("this user already exist, login?");
      } else {
        dispatch(signup(newAccount));
      }
      navigate("/signin", { replace: true });
    }
  };
```
Pulumi Challenge 03
Tags: pulumi, aws, challenge
Published: 2022-11-13 14:56:46

I did the [Pulumi Challenge 03](https://www.pulumi.com/challenge/deployments/), and I published my code on [this](https://github.com/ninefyi/pulumi-challenge-03).

What did I learn from Pulumi Challenge 03?

- It is easy to use Pulumi deployment because it will link to GitHub. When you push code to GitHub, Pulumi deployment will automatically build your code.
- I learnt how to use AWS CLI to get a session token from an MFA account using the below command.

## Display MFA devices
```shell
aws iam list-mfa-devices
```
## Create a temporary session token
```shell
ws sts get-session-token --serial-number [SerialNumber] --token-code [Token from MFA device] --duration-seconds 86400
```

## After I push the code to GitHub, the Pulumi deployment will run immediately.
![Pulumi deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlquzieqg57mt1g17r7k.png)


![Python Lambda](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zstpckmkegsgp54362tg.png)

The pulumi is the one tool that I should learn :).