teleren/devto huggingface dataset:
Migrate to discordgo v0.24.0 from v0.23.2
Tags: go, discord, discordgo
Published: 2022-03-08 16:44:20

---
title: Migrate to discordgo v0.24.0 from v0.23.2
published: true
description: If you are to migrate to discordgo v0.24.0 from v0.23.2, timestamp type is changed, but the changes are partial. When timestamp type is string, use RFC3339.
tags: go, discord, discordgo
//cover_image: https://direct_url_to_image.jpg
---

Recently, `discordgo` v0.24.0 is finally released! With this version, you can use threads or slash commands which is awesome.

In this release, type of Timestamp is changed to `string` to `time.Time`. 

https://github.com/bwmarrin/discordgo/commit/fccf6db03e622e339dcc1dab0dba2ff17bbaa7cb

My bot was blocked to upgrade due to this problem. So I inspected. 

In the [fix commit](https://github.com/bwmarrin/discordgo/commit/fccf6db03e622e339dcc1dab0dba2ff17bbaa7cb), `time.Parse(time.RFC3339, string(t))` is used, which implies Discord uses `RF3339` internally to express timestamp.

On the other hand, Go's default `time.Time.String()` returns `2006-01-02 15:04:05.999999999 -0700 MST` style, which is not `RFC3339`.

https://pkg.go.dev/time#Time.String

The problem is, the fix is not applied to all the timestamp in discordgo. Like https://pkg.go.dev/github.com/bwmarrin/discordgo#MessageEmbed , timestamp in string type remains.

Therefore, you have to use `time.Format(time.RFC3339)` to pass the timestamp to, for example `discordgo.MessageEmbed.Timestamp`.
Create Your Portfolio Using Next.js, Tailwind CSS, Stripe, and PayPal
Tags: frontend, webdev, javascript, react
Published: 2022-03-08 22:35:21

---
title: Create Your Portfolio Using Next.js, Tailwind CSS, Stripe, and PayPal
published: true
date: 2022-03-08 16:21:09 UTC
tags: frontenddevelopment,webdevelopment,javascript,react
canonical_url: https://betterprogramming.pub/create-your-portfolio-using-next-js-tailwind-css-stripe-and-paypal-80c723bb3fef
---

[![](https://cdn-images-1.medium.com/max/2600/0*Xfj9d2kM6j_t2qt6)](https://betterprogramming.pub/create-your-portfolio-using-next-js-tailwind-css-stripe-and-paypal-80c723bb3fef?source=rss-1282c85b5cbc------2)

Create a portfolio website using Next.js and Tailwind CSS with dark mode support, a donation page that integrates PayPal and Stripe

[Continue reading on Better Programming »](https://betterprogramming.pub/create-your-portfolio-using-next-js-tailwind-css-stripe-and-paypal-80c723bb3fef?source=rss-1282c85b5cbc------2)
React to Svelte Cheatsheet
Tags: svelte, react, javascript, webdev
Published: 2022-03-08 16:20:08

---
title: React to Svelte Cheatsheet
published: true
description: Map your React knowledge to Svelte
tags: svelte, react, javascript, webdev
---

Are you coming to **Svelte** from a **React** background?

Here is a cheat sheet that lists the **similarities** and **differences**:

[![Cheatsheet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ar2fed9ybg1jl9f6tjka.png)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ar2fed9ybg1jl9f6tjka.png)

<a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ar2fed9ybg1jl9f6tjka.png">Full size image</a>

<a href="https://drive.google.com/file/d/1Kjjp_Z0HcH-NxquV0bo6vu2IxkVmU0Dt/view">PDF Version</a>

# Want more?

If you'd like to learn more about Svelte, check out my [short video courses](https://joshuanussbaum.podia.com) ✨
Nevertheless, Aditi Coded in 2022
Tags: wecoded
Published: 2022-03-08 16:19:17

Hi, I'm Aditi and I'm here to share a bit about myself

**My biggest technical goals are…**

- Improve my skills and build my portfolio

- Attend more tech conferences and connect with like-minded people

- Contribute to open source

- Be more active in women tech communities and tech communities in general

** I pledge to break the bias in tech by…**

- Breaking the bias, women in coding do exist and we are amazing at what we do! 

- Let other fellow women know that we are awesome, and can achieve whatever we want.

**I pledge to support women, non-binary folks, and other minorities in tech by…**

Affriming to them that they are great and they can do it! 

Women you got this !!!! 

Happy International Women's Day
What I learned in February
Tags: python, django, react, javascript
Published: 2022-03-08 16:17:44

---
title: What I learned in February
published: true
description: Software development things I learned in Django, python, javascript
tags: python, Django, react, javascript
canonical_url: https://kachamukabe.com/what-i-learned-in-february
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nk1gr1evb9u8rz2no3d8.png
---


In my quest to catalog my developer journey here are a few things I have learned this month.

## React/Javascript

Local development of React applications with an express Api can have CORS errors. To solve this React has an option to serve the frontend on the same port as the backend. This is the proxy option that can be set in the React application's package.json file.

To do this open your react package.json file and add the following option:

```json
	"proxy": "http://localhost:<EXPRESS PORT>"
```

To read more on this read the React documentation [here](https://create-react-app.dev/docs/proxying-api-requests-in-development/).

## Python

Running a python module or a script has a subtle difference: -m. To run a python module add the "-m" tag.

So if you have a module like this:

```
hello/
	__init__.py
	__main__.py
	somescript.py
```

You can run it like this:

```bash
python -m <module-name>
python -m hello
```

As a note the module-name needs to be the name of the module not a string.

## Django

Using Sass with Django.

Install the following libraries

```bash
pip install lib sass django-compressor django-sass-processor
```

Add the Django sass processor to your installed apps in your Django settings. Whilst in the settings add the following static files settings.

```python
INSTALLED_APPS = [
	...,
	'sass_processor',
	...
]

STATICFILES_FINDERS = [
	'django.contrib.staticfiles.finders.AppDirectoriesFinder',
	'sass_processor.finders.CssFinder',
]

SASS_PROCESSOR_ROOT = os.path.join(BASE_DIR, 'static')
```

Pick your UI framework e.g. UIKit, Bootstrap, or Materialize. Copy the sass folder into your static files folder.

Create a main.scss file in the static files folder. This file is the primary way that the sass processor will interact with the sass framework.

In the base template add the following sass tags:

```html
<link href="{% sass_src 'main.scss' %}" rel="stylesheet" type="text/css">
```

### Django Deployment

Deploying an app to the Digital Ocean app platform with static files on digital ocean spaces. This will be a separate blog post.
Year after I left my job to become software developer
Tags: programming, career, motivation, wecoded
Published: 2022-03-08 16:15:11

On International Women's Day, I would like to share with you what positive changes I have made in my life in the last year. :blush:

Back in 2020, I was working as a financial controller. Some of my responsibilities were creating many financial reports, conducting optimization meetings, and implementing KPIs. While creating yet another similar report, I was constantly thinking about automating my work.:robot: The words "optimization" and "automation" were constantly on my mind. I wanted to improve and speed up everything. So I went to VBA training in Excel to be able to do some things faster and more automated way. 

And then I started to think about programming more and more. I found it extremely interesting and magical. Probably for many beginners - programming is magic. I am writing something line by line and suddenly... WOW so much has happened! :fire::sunglasses: When you can see the results of your work, it gives a lot of satisfaction.

A great inspiration for me is my wonderful husband who is an experienced programmer. Seeing my enthusiasm for the field of programming, he offered to teach me JavaScript. And that's how I started learning. Soon after I left my job and entered this beautiful and magical world of software development. :magic_wand:

I am very satisfied with this decision for many reasons.
- First of all, I am fulfilling myself. Programming is a very developing activity. It requires concentration, logical thinking, and constant training, which translates into maintaining a good condition of the brain. 
- Programming gives a lot of satisfaction - when the code works, of course, and teaches a great deal of patience - when the code does not work. :smile:
- Thanks to working as a software developer, I can also work remotely, from anywhere in the world. During last year, I saw many beautiful places that I had only heard about before. :green_heart: When I want to visit my family, I don't have to take a break. I can take my laptop and work from my family home, spending the afternoons with my loved ones. This freedom of life and development stimulates creativity and gives me a lot of joy personally. 
- Moreover, I believe programming is the future. Thanks to programming, we can change the world for the better. 

I would still call myself a novice programmer, but today on International Women's Day I wish myself that in the future I will create beautiful things with code. :green_heart: :four_leaf_clover:

I am also very curious about your stories (not only of women)? What professions did you give up to change your life? And are you satisfied with these changes? :blush:

And finally, all the best, my dear women, fulfill yourselves and do not be afraid of changes, because only changes can improve something in our lives! Kisses!:kiss:
Setup SSH from chromebook to home desktop
Tags: linux
Published: 2022-03-08 16:11:18

---
canonical_url: https://waylonwalker.com/til/open-ssh-setup/
published: true
tags:
- linux
series: til
title: Setup SSH from chromebook to home desktop
---

I write many of these posts from a 10 year old desktop that sits in my office these days.  It does a very fine job running all of the things I need it to for my side work, but sometimes I want a mobile setup.  I don't really want to spend the $$ on a new laptop just for the few times I want to be somewhere else in the house.  What I do have though is a chromebook.

I've tried to get the chromebook into my workflow in the past, but have failed.  Much because by the time I got all of my tools up and running in the linux vm it was taking up quite a bit of space on the device and made it harder for others to use as a chromebook.

Today I am giving it a second try, but this time with ssh.

## Checking for existing sshd

Before doing anything I checked to see if sshd is already running. Using the following command.

``` bash
sudo service ssh status
# or
pgrep -l sshd
```

Both returned nothing so I know that its not running.

## setting up sshd

_just apt install it_

Next install the openssh-client and openssh-server

``` bash
sudo apt install openssh-client -y sudo apt install openssh-server -y
```

After this I can see that its now running by checking its status once again.


``` bash
sudo service ssh status
```

Gives me the result.

``` bash
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-03-08 08:17:05 CST; 12min ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 181185 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 181189 (sshd)
      Tasks: 1 (limit: 19119)
     Memory: 2.8M
        CPU: 96ms
     CGroup: /system.slice/ssh.service
             └─181189 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
```

## Accessing the desktop

I have already enabled the Linux terminal on my chromebook, so I just opened the terminal, and ran the following.

``` bash
ssh <username>@<ip-address>
```

It prompted for my password and I was in.  I had all of my vim, tmux, and zsh comforts that I enjoy without installing anything.  It worked so well that this whole post was written from my chromebook.

## Limitations

This does limit me to being on the same network as my desktop, which these days is almost always true.

## ssh keys

Out of the box I am just using passwords to get in, but if this were public I would lock down to requiring an ssh key to enter.  I'll likey do this in a future post.
Hot Reload using Air in golang
Published: 2022-03-08 16:05:16

Hot reloading is the important and most frequently used feature. We play and change different messages, logic inside our code. There is an easy way to implement it.

At first let us create a http server on golang: 

Create a file named “server.go” inside which copy the below code:


```
package main

import (
	"fmt"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("Hello, Golang Dev"))
	})

	PORT := "5000"

	fmt.Println("Serverr running on port:", PORT)

	http.ListenAndServe(":" + PORT, nil)

}

```
This will create a http-server hosted on port “5000”. To run server 


```go run server.go```
You can see the message : “Server running on port: 5000”. To verify it go to the browser and hit the url : http://localhost:5000/ . You can see “Hello, Golang Dev” as response. Its working right ??

Now if you want to change that message to “Hello World” . You need to restart server which is time consuming. There are many ways to hot reload. Here will talk about the “Air”.

 

Air  is a command-line utility that provides live reloading for Go applications. To install it 


```go get -u github.com/cosmtrek/air```
Next create .air.conf on the root directory

```
# .air.conf
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format

# Working directory
# . or absolute path, please note that the directories following must be under root.
root = "." 
tmp_dir = "tmp"

[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -o ./tmp/main ."
# Binary file yields from `cmd`.
bin = "tmp/main"
# Customize binary.
full_bin = "APP_ENV=dev APP_USER=air ./tmp/main"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html"]
# Ignore these filename extensions or directories.
exclude_dir = ["assets", "tmp", "vendor", "frontend/node_modules"]
# Watch these directories if you specified.
include_dir = []
# Exclude files.
exclude_file = []
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 1000 # ms
# Stop to run old binary when build errors occur.
stop_on_error = true
# This log file places in your tmp_dir.
log = "air_errors.log"

[log]
# Show log time
time = false

[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"

[misc]
# Delete tmp directory on exit
clean_on_exit = true
```

First check air is install properly or not.


```air -v```
If it works yo are ready to go. Else you need to setup for path for “air”


`sudo mv ~/go/bin/air /usr/local/bin`
Recheck 


`air -v`
Finally, instead of running our Go application with the usual “go run server.go” command, use the “air” command.


`air`
Hope it works.

Happy Coding
#3 Python Series..
Tags: python
Published: 2022-03-08 16:00:29

Control Flow:


IF - Else : 

If a person wants ride a roller coaster the height must be 120cm.
if we want computer to check the height then we have to write a logic in a language which computer understand.

Here is an example:
if(height>120)
     print("Can ride")
else
     print("Can't ride")

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

Comparison Operators
">"  Greater than
"<"  Less then 
">=" Greater than or equal to
"<=" Less than or equal to


Nested If Statement:

wanted to check another condition that visitor age is above 18 then ticket price 12$ or less than 18 and greater then 12 ticket price 7$. less than 12 then 5$ per ticket.
If condition:
   if another condition:  
      do this
   else:
      do this
else:
   do this

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9h49bwfval2ygedrya6v.png)
 
if year%4 == 0:
    if year%100 == 0:
        if year%400 == 0:
            print("Not Leap year.")
        else:
            print("Leap year")
    else:
        print("Leap year")
        
else:
    print("Not leap year.")


Logical operator..
And   
Or    
Not  

# 🚨 Don't change the code below 👇
print("Welcome to the Love Calculator!")
name1 = input("What is your name? \n")
name2 = input("What is their name? \n")
# 🚨 Don't change the code above 👆

#Write your code below this line 👇
combined_string = name1+name2
lower_case_string = combined_string.lower()

print(lower_case_string)

t = lower_case_string.count("t")
r = lower_case_string.count("r")
u = lower_case_string.count("u")
e = lower_case_string.count("e")

true = t+r+u+e

print(true)

l = lower_case_string.count("l")
o = lower_case_string.count("o")
v = lower_case_string.count("v")
e = lower_case_string.count("e")

love = l+o+v+e

love_score = int(str(true)+str(love))

if (love_score < 10) or (love_score > 90):
    print(f"Your score is {love_score}, you go together like coke and mentos.")
elif(love_score >= 40) and (love_score <= 50):
    print(f"Your score is {love_score}, you are alright together.")
else :
    print(f"Your score is {love_score}.")
BankChain.wc
Tags: codepen, blockchain, algorithms
Published: 2022-03-08 15:59:50


<center><b>Internal Banking Arbitrage Interactions</b></center>
This is a table of the 7 types of Banking using the 49 static interactions that can occur within a banking contract. The definition of redundancy is completed through the "sponsorship" type of banking. There is a hierarchy within banking contracts that evolves around each specific transaction. The static interactions listed below are types of "transactions" that can take place. There is even a banking definition of transaction.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8hb6rzyjazwlsqtlb5zh.jpg)
Image by <a href="https://pixabay.com/users/quincecreative-1031690/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2889046" class="keychainify-checked">3D Animation Production Company</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2889046" class="keychainify-checked">Pixabay</a>
<p>
BankChain.wc is a concept owned by Jason L. Davis Enterprises
{% codepen https://codepen.io/J2A2K4E/pen/ZEawGQO %}
</p>
Cover Image by <a href="https://pixabay.com/users/thedigitalartist-202249/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=3212312" class="keychainify-checked steem-keychain-checked">Pete Linforth</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=3212312" class="keychainify-checked steem-keychain-checked">Pixabay</a>
Nevertheless, Ruth Coded in 2022
Tags: wecoded
Published: 2022-03-08 15:57:02

---
title: Nevertheless, Ruth Coded in 2022
published: true
tags: shecoded
---

This _shecoded_ I want to advocate for myself by setting some goals. It's been a tough couple of years for the planet, and even a little can go a long way.

### 🥂 Celebrate others
I will cheer & give feedback to encourage others, especially to those who have made some impact in _breaking the bias_ for women and non-binary people in tech.

### 📚 Boost with books
Applying my learning at work is a strength. I will read more and share what I learn through my own lens.

### 🧑‍💻 Prioritise self-care
This IWD a colleague encouraged having the confidence to do what makes you happy. I will prioritise my self-care so that I might have the confidence to be bold and do what really makes me happy.
Finding Cuda Errors
Published: 2023-01-05 22:23:36

---
title: Finding Cuda Errors
published: true
date: 2022-03-08 15:53:43 UTC
tags: 
canonical_url: https://brandonrozek.com/blog/finding-cuda-errors/
---

When cuda fails, it fails silently. To combat this, I have gotten into a habit of checking for a failed status for every cuda memory allocation, kernel execution etc. The following is a C++ macro I wrote that checks if a previous cuda call has failed and then prints the current line and file of the macro.

```
#define checkCudaError() { if (cudaGetLastError() != cudaSuccess) { printf("[%s:%d] A previous CUDA call failed.\n", __FILE__ , __LINE__ ); }

```

I recommend using this macro after every cuda call. For example,

```
cudaMemcpy(dst, src, size, cudaMemcpyHostToDevice); checkCudaError();

```

During runtime if the call failed, then you will see:

```
[example.cu:14] A previous CUDA call failed.

```

Note that it states whether or not a previous cuda call has failed and not where it has failed at. By putting the macro after every cuda call, you can narrow down which call causes the failure to occur.
Css Best Practices Part : 01 
Tags: css, webdev, tutorial, html
Published: 2022-03-08 15:42:17

## CSS BEST PRACTICES


**1- Avoid Code Duplication** : Keeping Your **CSS** Code Dry Will Help You Minimizing The Amount Of Edits To Make Change To A component 

![Css Code](https://mdn.mozillademos.org/files/12189/css-as-authored.png)

**2- Don't Use Absolute Lengths** :  Use Relative Units For Scallable Size On Larger & Smaller Viewports 

![Css Lengths](https://miro.medium.com/max/1400/1*ow8NIyXnfM1LmlF9-vuTdg.png)

**Example :**

```
font-size : 24px
```
 
Use :


```
font-size : 75%
```

**3- Use Inheritance** :  Use Inheritance To Copy A Specific Parameter From The Parent Element 

![Css Inheritance](https://i.ytimg.com/vi/aOScN7hzzBQ/maxresdefault.jpg)

Example : 

```
input , select , button { font:inherit; }
```

**4- Use Viewport Relative Units** :  Use Viewport Relative Units , To Reduce The Amount Of Media Queries For Every Viewport And Keep Your Code Clean 

![Css Viewport Units](https://ishadeed.com/assets/viewport-units/intro-2.png)

Example : 

```
vh (viewHeight) vw(viewWidth) vmin , vmax
```

**4- Set max-width For Replaced Elements** : Set Max Width For Replaced Elements Such As : **img** - **object** - **video** - **iframe**

![Css Max Width](https://i.stack.imgur.com/k9vLo.png)

**Hit The Like Button If You Like The Content** 
Thanks For Reading
#66 Days of Data
Tags: python, datascience, 100daysofcode, ankitgupta
Published: 2022-03-08 15:41:27

## **Learning Python**  👨‍💻

D 24 of #66daysofdata 📈

Today I have learnt - Modules, Comments, Pip & Docstring in Python ✌️

I'll be glad to connect & learn with similar goal centric people on 
👇👇👇

**Github** @ [MrAnkitGupta](https://github.com/mrankitgupta)

**Twitter** @ [Mr_AnkitGupta01](https://twitter.com/Mr_AnkitGupta01)