teleren/devto huggingface dataset:
What is Dandelion?
Tags: devjournal
Published: 2022-12-16 00:34:46

I'm going to write a series of posts about a project I'm working on called Dandelion. 

The purpose of this post is to give an overview of what Dandelion is so I can reference it as context in other posts.

Dandelion is: 

## A mobile web application for collaboratively helping people who need things.

Specifically, it was originally developed for a group of people (volunteers) who visit people who are living outside (residents) and offer help. Residents ask for things like batteries, tents, boots, propane stoves, etc.

When a resident tells a volunteer that they need something, the volunteer can record the request on Dandelion. Currently, in the code, we refer to this recorded request as an **AidRequest**. Volunteer can mark themselves as working on an aid request, mark it as complete, comment on it, tag other volunteers, and more. In a future post, I'll describe the features in more detail.

The app hasn't been used by actual volunteers since about October 2022, and I'm not actively promoting it for real-life use as of 12/15/22. In the future, when the app supports more features, this may change.

For now, I'm using the app as a pet software project to which I can apply new concepts that I learn.

Here's a non-exhaustive list of things I'm considering learning by applying them to Dandelion:

1. [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
2. Different authentication methods, e.g., sign in with Google, email a magic link
3. Multi-Factor Authentication
4. Protection from DDOS
5. Protection from XSS
6. Serving static assets through a CDN
7. Using spritesheets
8. Adapting the app to be open to the public, rather than allowlist-only
9. Unit testing under Clean Architecture, using a test API
10. React testing
11. Using different kinds of databases (it currently only supports MongoDB)

I don't know if anyone is going to read this, but if you do, feel free to comment other things I could try learning with this project :)

In my next post, I'll describe the existing features of Dandelion and some features I want to add to it next. After that, I'll dive into my current project, which is refactoring the backend to use Clean Architecture. 

All my posts will be on [GitHub](https://github.com/chloe-glowy/blog/tree/main/dandelion) and my [DEV page](https://dev.to/chloeglowy). The source code for this post is on GitHub [here](https://github.com/chloe-glowy/blog/blob/main/dandelion/what-is-dandelion.md). 

The source code for Dandelion is on GitHub [here](https://github.com/chloe-glowy/dandelion).

Demo Video:

![Demo Video](https://github.com/chloe-glowy/blog/blob/main/dandelion/assets/ezgif-2-d00a0ad6da.gif?raw=true)
Generating GPG keys with Windows 11 and WSL
Published: 2022-12-16 00:32:08

---
title: Generating GPG keys with Windows 11 and WSL
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-16 00:24 +0000
---

Are you encountering an issue where the pinentry prompt for a GPG key generation in Windows Subsystem for Linux (WSL) is stuck in a loop. Is it doing this regardless of the `DISPLAY` you set, or the `pinentry-` programs you try and install? Good news. While you still have hair (or sanity, if you are already bald), you can generate the GPG keys on the Windows side and copy them over. 

Steps:

* Run the generation command in a git bash terminal
* Copy the `.gnupg` directory from your Windows user directory, to your WSL user directory, using the WSL entry in the Windows Explorer. You can safely skip any conflicts.
* Success!
Create a simple Node Server Skeleton.
Tags: javascript, typescript, webdev, node
Published: 2022-12-16 00:15:50

## Introduction
_This tutorial is quite useful for quick start for many simple projects which doesn't need complex functionalities or projects which are for tutorial purpose._

If you want to build a more complex Node Server with **express, routers, controllers, databases, Redis** and etc. You can ahead to my another article.

---


## Code

### Set up environment

> 
First, you would need to install the necessary dependencies. In your terminal, navigate to the root directory of your project and run the following command to initialize packages:

```
npm init
```


>
Install express and necessary packages with **npm**

```
npm install express cors dotenv
```
or install packages with **yarn**

```
yarn add express cors dotenv
```

>
If you are using **TypeScript**, you must also install the following packages
```
npm install @types/express @types/cors
```
or install packages with **yarn**

```
yarn add @types/express @types/cors
```

### Server.js (JavaScript)

> 
Once express is installed, you can create the server file. In your project directory, create a file called **server.js** and add the following code:

```javascript
import express from "express";
import cors from 'cors';
import dotenv from "dotenv";

// Get environment variables
dotenv.config()

// Create the express server and configure it to use json
const app = express();
app.use(express.json());

// Configure cors policy
app.use(cors())

// Set up a API call with GET method
app.get('/data', (req, res) => {
  // Return some sample data as the response
  res.json({
    message: 'Hello, world!'
  });
});

// Start the server on port configured in .env (recommend port 8000)
app.listen(process.env.PORT, () => {
  console.log(`SERVER IS RUNNING AT PORT ${process.env.PORT}`);
});
```

### Server.ts (TypeScript)

> 
the only different between Server.js and Server.ts is showed below:

```javascript
// You need to classify the type of variable
const app: Application = express()
```

---
# Common Errors
> SyntaxError: Cannot use import statement outside a module
Solution: Add below line to your Package.json

```json
"type": "module",
```
---
## Conclusion
In conclusion, creating a simple Node server skeleton is a straightforward process that involves setting up a new Node project, installing the necessary dependencies, and configuring the basic server structure.
Custom Cloudflare domain and www redirect
Tags: blog
Published: 2023-04-18 18:15:45

---
title: Custom Cloudflare domain and www redirect
published: true
date: 2022-12-16 00:00:00 UTC
tags: blog
canonical_url: https://tinygame.dev/posts/Custom-Cloudflare-domain-and-www-redirect/
---

## Why doesn't www work for my domain?

Cloudflare can serve as an excellent static site host, [I use it](https://tinygame.dev/) for my blog. It's also simple to register a custom domain and have it auto-setup, but unfortunately the www subdomain doesn't automatically redirect as expected. By default `https://mysite.com` will work, but `www.mysite.com` won't. Here's how we fix it.

1. In your Cloudflare dashboard, go to Websites > your website > DNS. Add a new CNAME entry with the name `www` and `mysite.com` as target,
and make sure you turn on the proxy.
2. Go to Rules > Page Rules and set up a new redirect rule. Set the URL to `www.mysite.com/*`, pick the `Forwarding URL` setting,
and the `301` status code. Set the destination URL to `https://mysite.com/$1`.

And we're done, www should now redirect to you domain as expected.
News: Perl Advent Calendar 2022
Tags: perl, beginners, programming, news
Published: 2022-12-15 23:38:32

Perl Advent Calendar 2022 is announced at <a href="https://www.reddit.com/r/perl/comments/zmn7oi/perl_advent_calendar_2022_day_15_create/">reddit</a>.

<a href="https://perladvent.org/2022/2022-12-15.html">Perl Advent Calendar 2022</a>

## For Programming Beginners

Advent Calendars are engineer's events to write technical articles The Year-End.

Perl Advent Calendar is the one of them.

## See Also

<a href="https://qiita.com/advent-calendar/2022/perl">Perl Advent Calendar 2022 in Japan</a>
SPVM 0.9666 is released
Tags: perl, spvm, programming, beginners
Published: 2022-12-15 23:31:40

<a href="https://metacpan.org/pod/SPVM">SPVM</a> 0.9666 is released.

## New Features and Enhancement

<a href="https://github.com/yuki-kimoto/SPVM/blob/master/Changes">Changes</a>

```
0.9666 2022-12-16
  [Bug Fix]
    * Fixed the bug that SPVM don't work on Windows Server 2020/2022.
  [Prerequirement Changes]
    * SPVM needs ExtUtils::CBuilder 0.280236+.
  [New Features]
    * The string in the config mode allow "-"
      Foo.my_mode-azAZ09.config
  [Changes]
    * Added --no-build-spvm-modules option to Makefile.PL that is generated by the spvmdist command.
    * Added --meta option to Makefile.PL that is generated by the spvmdist command.
    * Changed the Name, Usage, Description that is generated by the spvmdist command.
    
      =head1 Name

      SPVM::$class_name - foo

      =head1 Description

      C<SPVM::$class_name> is the L<SPVM>'s C<$class_name> class.

      =head1 Usage

        use $class_name;
    * Removed cpanm from MANIFEST.skip that is generated by the spvmdist command.
  [Build Process Improvement]
    * Added --no-build-spvm-modules option to Makefile.PL.
    * Added --no-precompile-tests option to Makefile.PL.
    * Added --meta option to Makefile.PL.
  [Test Improvement]
    * Solo tests use spvmcc command.

```

## For Programming Beginners

### What Is SPVM?

SPVM is a static typed programming language that can be installed from Perl/CPAN.

### How potential dose SPVM have?

Growth is expected in the fields of Bio Tech, AI/ML, Apple/iPhone/iPad Apps, Google/Android Apps, IoT Device, Connected Car, Smart Device, Smart Home, etc.

This is because SPVM can produce an executable file that supports cross platforms and make easy to calculate arrays and bind C/C++
Custom Radio button Using react component and Material UI
Tags: webdev, react, javascript, beginners
Published: 2022-12-15 23:06:08


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



Here is an example of how you can do this:

```
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Radio from '@material-ui/core/Radio';

const useStyles = makeStyles({
  root: {
    // Customize the styling of the root element
  },
  checked: {
    // Customize the styling of the checked state
  },
});

const CustomRadio = (props) => {
  const classes = useStyles();

  return (
    <Radio
      className={classes.root}
      checkedClassName={classes.checked}
      // Other props here
      {...props}
    />
  );
};
```

In this example, the CustomRadio component is using the makeStyles hook from Material-UI to create a custom styles object. The styles object contains two entries: **root** and **checked**. These styles are applied to the **root** element and the **checked** state of the **Radio** component, respectively.

You can customize the styles of the **Radio** component by modifying the styles in the **useStyles** hook. For example, you could change the colors of the **Radio** component using the **color** property in the **root** and **checked** styles:

```
const useStyles = makeStyles({
  root: {
    color: '#f00', // Red color
  },
  checked: {
    color: '#0f0', // Green color
  },
});

```

In addition to styling the **Radio** component, you can also customize its behavior by passing props to it. For example, you could add an **onChange** prop to handle changes to the **Radio** component's value:

```
const handleChange = (event) => {
  // Handle the change event here
};

const CustomRadio = (props) => {
  // The rest of the component code here

  return (
    <Radio
      onChange={handleChange}
      // Other props here
      {...props}
    />
  );
};

```

In the end, remember there is always a different way to build any code or components. I hope this helps you to create a simple React component using Radio MUI
Perl: load_file:Invalid access to memory location on Windows Server 2020/2022
Tags: perl, beginners, programming, mingw
Published: 2022-12-15 23:01:05

I got this error on Windows Server 2020/2022 to load DLLs that is generated by <a href="https://metacpan.org/pod/ExtUtils::CBuilder">ExtUtils::CBuilder</a>. 

```
Can't load dynamic_lib file "D:\a\SPVM\SPVM\SPVM-0.9665\blib\lib/SPVM/Format__precompile.xs.dll": load_file:Invalid access to memory location at D:\a\SPVM\SPVM\SPVM-0.9665\blib\lib/SPVM/Builder.pm line 262.
```

This is fixed in the latest ExtUtils::CBuilder.

<a href="https://metacpan.org/dist/ExtUtils-CBuilder/changes">Changes</a>

```
Revision history for Perl extension ExtUtils::CBuilder.
 
0.280236 - 2021-02-12
 
  Fix:
 
  - Remove image-base generation on Win32/gcc and instead use GCC's built-in
    `--enable-auto-image-base` linker option.
```

## For Programming Beginners

ExtUtils::CBuilder is a Perl module to generate shared libraries on Linux/Mac or Dynamic link libraries on Windows.

This is a wrapper of C<gcc> or C<clang> or C<MinGW>.

They are compilers and linkers to compile C/C++ source codes and link them to output an executable file or a shared library.
Optimizing Node.js Code with "lodash.memoize"
Tags: node, javascript, webdev, programming
Published: 2022-12-15 23:00:58

Node.js is a popular and powerful runtime for building server-side applications. However, as your codebase grows, you may find that your Node.js app is running slower than you would like. In this tutorial, we will look at one way to improve the performance of your Node.js app using the `lodash.memoize` function.

## What is `lodash.memoize`?

`lodash.memoize` is a function from the popular `lodash` utility library that allows you to create a memoized version of a given function. A memoized function is one that will cache the results of the function and return the cached result if the function is called with the same arguments again. This can be a useful optimization technique if you have a function that is slow and expensive to run, and you know that the function will be called many times with the same arguments.

## Using `lodash.memoize` in Node.js

To use the `lodash.memoize` function in your Node.js code, you will need to first install the `lodash` library. You can do this using the `npm` package manager:

```
npm install lodash
```

Once you have installed `lodash`, you can import the `memoize` function into your Node.js code like this:

```javascript
const _ = require('lodash');
```

Now, let's say you have a function in your Node.js code that is slow and expensive to run, and you want to optimize it using `lodash.memoize`. The function might look something like this:

```javascript
function slowFunction(arg1, arg2) {
  // Do some complex calculations here
  return result;
}
```

To create a memoized version of this function, you can use the `lodash.memoize` function like this:

```javascript
const memoizedSlowFunction = _.memoize(slowFunction);
```

Now, when you call the `memoizedSlowFunction`, it will behave just like the `slowFunction`, but it will also cache the results of the function and return the cached result if the function is called with the same arguments again. This can greatly improve the performance of your code, especially if the function is called many times with the same arguments.

Here is an example of how you might use the `memoizedSlowFunction` in your Node.js code:

```javascript
memoizedSlowFunction(arg1, arg2);
```

That's it! By using the `lodash.memoize` function, you can easily optimize your Node.js code and improve its performance.

## Conclusion 

In this tutorial, we learned how to use the `lodash.memoize `function to optimize your Node.js code. By creating a memoized version of a slow and expensive function, you can greatly improve the performance of your Node.js app, especially if the function is called many times with the same arguments. Give it a try and see how it can improve your code!
How I configured XDebug 3.x with PHP 7.3, 7.4, 8.0, 8.1, and 8.2 using Valet on Mac
Tags: php, xdebug, laravel, tutorial
Published: 2022-12-15 22:51:34

{% youtube 4mFKKMguSbk %}

In this video I cover that (and why) I'm moving back to [Laravel Valet](https://laravel.com/docs/9.x/valet) (with PHP [isolation](https://laravel.com/docs/9.x/valet#per-site-php-versions)) and how I configured XDebug 3.x in PHP 7.3, 7.4, 8.0, 8.1, and 8.2 easily with a symlinked `99-xdebug.ini` ([source](https://github.com/aubreypwd/vcsh/blob/main/Sites/xdebug.ini)) file in `conf.d/`.
Day 664 : Source Code
Tags: hiphop, code, coding, lifelongdev
Published: 2022-12-15 22:43:27

_liner notes_:
- Professional : Pretty chill day. Had 2 meetings with my team. A lot of folks have already taken off for the holidays. Worked on making Web Components.

- Personal : Last night, I went through some of the Svelte tutorial on their site since the new framework dropped. Even though I've used Svelte before, I wanted to get a refresher and see if there's anything I missed. Did that and got up to the point of the new framework. I went through some tracks for the radio show. Then I ended the night watching the latest episode of "Mob Psycho".

![View of the Crete, Greece coast with mountains leading into the sea under blue skies with large clouds.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f34dvc17dwfyfruhuh6w.jpg)

Going to finish up the SvelteKit tutorial, then finalize design for the front page for my next side project and maybe start a blank SvelteKit project and go through the source code. Also want to get some work done for the radio show this week. Not sure if there are any anime I missed. Going to eat dinner.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube feRv16m4uME %}
It’s Not Open Source, It’s You. Where Open Source Risk Comes From
Tags: opensource, programming, podcast, devops
Published: 2022-12-15 22:03:46

Picture this: an auto manufacturer with no clue what parts are in its supply chain, where those parts come from and no ability to recall those parts if vulnerabilities are discovered.

That’s not a reality consumers would accept. So why do organizations (and manufacturers!) tolerate it when it comes to software? 

On this week’s episode of Dev Interrupted, Brian Fox, co-founder & CTO, and Stephen Magill, VP of Product Innovation, join us to talk about [Sonatype’s State of the Software Supply Chain Report](https://www.sonatype.com/state-of-the-software-supply-chain/introduction). 

Listen as Brian and Stephen explain the ins and outs of open source risk management, how companies that aren’t open source maintainers can do a better job protecting themselves and why cybercrime is like “VC funds for the bad guys.” 

{% spotify spotify:episode:4lVu1ywabsduTvdszTXkU1 %}

## Episode Highlights:
* (1:48) Brian's and Stephen's background
* (5:21) [State of the Software Supply Chain Report](https://www.sonatype.com/state-of-the-software-supply-chain/introduction)
* (9:53) 4 practices of secure teams
* (12:43) What eng leaders need to know about their software supply chain
* (22:20) Cybercrime is like "VC funds invested into the bad guys"
* (28:38) Security issues gap between management and ICs

***While you’re here, check out this video from our [YouTube channel](https://www.youtube.com/c/DevInterrupted?sub_confirmation=1), and be sure to like and [subscribe](https://www.youtube.com/c/DevInterrupted?sub_confirmation=1) when you do!*** 

{% youtube iRoemGDY7nY %}

### Want to cut code-review time by up to 40%? Add estimated review time to pull requests automatically!
*gitStream is the free dev tool from LinearB that eliminates the No. 1 bottleneck in your team’s workflow: pull requests and code reviews. After reviewing the work of 2,000 dev teams, LinearB’s engineers and data scientists found that pickup times and code review were lasting 4 to 5 days longer than they should be.* 

*The good news is that they found these delays could be eliminated largely by adding estimated review time to pull requests!*

### Learn more about how gitStream is making coding better [HERE](https://linearb.io/blog/why-estimated-review-time-improves-pull-requests-and-reduces-cycle-time/?utm_source=Substack%2FMedium%2FDev.to&utm_medium=referral&utm_campaign=gitStream%20-%20Referral%20-%20Distribution%20Footers).

![Start using gitstream today!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg1l6hxt134px501bf7d.png)
PostgreSQL Foreign Key
Tags: postgres, database, dbforge
Published: 2022-12-15 21:51:11

---
title: PostgreSQL Foreign Key
published: true
description: The basics PostgreSQL Foreign Keys
tags: #postgresql #databases #dbforge
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-15 21:48 +0000
---
This article covers the basics of PostgreSQL foreign keys, shows you how to create, delete, and manage foreign keys with real examples, and introduces you to one of the most user-friendly GUI Postgres tools on the market - https://blog.devart.com/postgresql-foreign-key.html
![PostgreSQL Foreign Keys](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ak4j6tnam9ktraenx7yx.png)
Learn Test Driven Development with Django - Part 11 Password Reset
Tags: django, tdd, python, webdev
Published: 2022-12-15 21:36:32

In this video, we will show you how to easily reset a password for a Django user. We will start by demonstrating how to set up the password reset functionality in your Django project, using the built-in password reset views and forms. Then, we will show you how to trigger the password reset process for a specific user, and how to handle the password reset form on the frontend. By the end of this video, you will have a working password reset feature in your Django application.

{%youtube PqD78_p7RIw%}
Learn Test Driven Development with Django - Part 10 Logging Out
Tags: tdd, django, python, webdev
Published: 2022-12-15 21:33:32

In this video, we will learn how to use test-driven development (TDD) to build a logout feature in Django. We will start by writing tests to specify the behavior of our logout function, including the authentication and session management it should handle. Then, we will implement the code to make the tests pass and see how the logout feature works in practice. This is a great way to learn about authentication and logout in Django and how to use TDD to ensure that your code is working as expected.

{%youtube MkXm3t1f7jE%}
Learn Test Driven Development with Django - Part 9 User Login
Tags: django, python, testing, tdd
Published: 2022-12-15 21:30:05

In this video, I show you how to use a test-driven approach with Django's AuthenticationForm to create a login system for your Django application. I demonstrate how to use Django's built-in testing tools to write tests for your login system, including tests for form validation and handling of user credentials. I show you how to use the AuthenticationForm and how to customize it to fit your application's needs. This video is perfect for anyone who is new to using a test-driven approach with Django's AuthenticationForm or who wants to learn how to use it to create a login system for their application
{%youtube Zor6pwYetAc%}
Building Georgy.Design #0
Tags: webdev, design, webflow, buildinpublic
Published: 2022-12-15 21:20:05


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

**Preview of my business site design — building with Figma, Webflow, and Relume Library 👨🏻‍💻**

Two blocks represent my projects and stack — cursors highlight interactions. Planning to connect them to #WebflowCMS, though, might make ‘em static.

_P.S: the design is WIP_