teleren/devto huggingface dataset:
Who stole the cookies from the...
Tags: opensource, programming
Published: 2023-03-27 14:01:59

## Last week in Starchart

In the last week I was a part of a few extra meetings alongside the regular team stand ups for our open source project [Starchart](https://github.com/DevelopingSpace/starchart), a meeting at the start of the week to discuss the new SLO implementation with David where we arrived at a neater solution for the SLO cookie and made it strict and restricted it to the logout route. At the same time we made the session cookie strict, I had forgotten what I had seen when looking at [telescope's](https://github.com/Seneca-CDOT/telescope) cookies. We also made some UI changes to the logout prompt making a less prominent button that would initiate SLO and a more vibrant red one that would just redirect you to sign in having only invalidated the session cookie with the starchart website. In any case, I was able to land the new SLO flow at the beginning of this week after some discussion and then demonstrated in a consequent mid-week meeting with the team [PR #366](https://github.com/DevelopingSpace/starchart/pull/366).

I also did a few reviews, although here I will only mention one of them since I felt I added a bit more to this PR than others [PR #414](https://github.com/DevelopingSpace/starchart/pull/414).

## Cookie problems

Here we have the impromptu bug that refreshed my memory on one of the problems with cookies when doing SSO. When my SLO change was incorporated into staging it seemingly broke something when signing in, making it so that a user would have to sign in twice to be authenticated to Starchart. My first instinct was to check the networking tab and to take a look at the cookies because I remembered we set the session cookie to strict and lo and behold the session cookie was being rejected since the browser claimed it set as a result of a cross-site request. The browser was of course correct, the session cookie is set on our login callback as a result of a request from our IDP which is a different origin and indeed cross-site, since we set the session cookie to be strict it would not be set by any cross-site requests at all. The simple solution here was to set the cookie to lax instead of strict and allow it to be set as a result of a cross-site request and this seems to be the general consensus when it comes to SSO seeing as session cookies are very often set as a result of a callback from an entity separate from our website. We did however keep the SLO cookie as strict since it really only exists and needs to be used within the one logout route that I have written within our own application. In any case here is the one word PR that fixed our double login issue [PR #427](https://github.com/DevelopingSpace/starchart/pull/427)

## Next Steps

Next I need to take a look at allowing admins to impersonate users in Starchart which I should do by adding information to the session, an "effective user" field that will come empty for admins so that they can set it to who they would want to impersonate and that would come forcibly filled with a regular user's own username so they can not in fact impersonate anyone else.
Revolutionizing Banking: How Cobranded Cards and BaaS Are Changing the Game
Tags: finance, bankingasaservice, technology, fintechstartups
Published: 2023-10-31 23:59:43

---
title: Revolutionizing Banking: How Cobranded Cards and BaaS Are Changing the Game
published: true
date: 2023-03-27 13:55:12 UTC
tags: finance,bankingasaservice,technology,fintechstartups
canonical_url: https://omacy.medium.com/revolutionizing-banking-how-cobranded-cards-and-baas-are-changing-the-game-7219a3492477
---

![](https://cdn-images-1.medium.com/max/1024/1*l-T27AWNhGRhBpOVAHqtyQ.png)

Banking as a Service (BaaS) is a relatively new concept in the banking industry that allows non-bank companies to offer banking services to their customers using the infrastructure of a partnering bank. One of the strategies to increase the banking portfolio and boost partner retail transaction turnover is the issuance of cobranded cards that offer a hybrid of bank loyalty and merchant loyalty programs.

The issuance of cobranded cards was one of the strategies used to increase the bank’s portfolio and partner transaction volume. It was not always an easy task, especially when it came to creating two balances. However, I recently read about a product launched by a FinTech company Sudo that allows retailers working with the company to have their own branded cards. These cards can be used for online and offline payments, with the ability to set limits and monitor expenses.

![](https://cdn-images-1.medium.com/max/1024/1*KmUaxpzZWqrMDzX-2zidLQ.png)

Thanks to embedded finance technology, customers can create virtual and physical cards in just a few clicks. Sellers can offer customization options, such as a unique design to connect with their brand or environmentally friendly materials like biodegradable plastic. For retailers, the Sudo card is marketed as a way to save on acquiring fees and earn more by receiving a percentage of card payments. By partnering with fintech companies like

Sudo, retailers can expand their financial services offerings, provide a better customer experience, and increase customer loyalty. Meanwhile, partnering banks benefit from new revenue streams and the opportunity to tap into the fintech market.

Overall, BaaS and cobranded cards have the potential to transform the banking industry and provide new opportunities for both banks and non-bank companies.
TCP vs. UDP: The Need for Speed vs. Reliable Delivery
Tags: programming, codenewbie, computerscience
Published: 2023-03-27 13:49:46

When it comes to transmitting data over the internet, there are two main protocols: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). Both protocols have their own advantages and disadvantages, and understanding these differences can help you choose the right one for your specific needs.

## What is TCP?

TCP is a reliable protocol that provides error-free data transmission by establishing a connection between two devices before sending data. TCP sends data in small packets called segments, and each segment requires an acknowledgement from the receiving device before it can send the next segment. This ensures that data is delivered in the correct order and without errors. However, the overhead associated with establishing a connection and error checking can slow down data transmission speeds.

Some pros and cons of TCP include:

**Pros:** Reliable data transmission, error correction, ordered data delivery
**Cons:** Slower speeds due to connection establishment, higher overhead

## What about UDP?

UDP, on the other hand, is a faster and more efficient protocol that does not establish a connection before sending data. Instead, it simply sends packets of data, or datagrams, to the recipient. UDP does not perform error checking or retransmission of lost packets, making it less reliable than TCP but faster for real-time applications such as gaming or video streaming.

Some pros and cons of UDP include:

**Pros:** Fast data transmission, low overhead, suitable for real-time applications
**Cons:** Unreliable data transmission, no error correction or recovery, unordered data delivery

So which protocol should you use? It depends on your specific use case. If you need reliable data transmission, such as for file transfers or email, then TCP is the way to go. If you prioritize speed over reliability, such as for online gaming or video streaming, then UDP may be a better choice.

## Conclusion

TCP and UDP have their own pros and cons, and choosing the right protocol depends on your specific data transmission needs. Understanding the differences between these two protocols can help you make better decisions for your application.
The Future of Digital Asset Ownership: Exploring dNFTs
Tags: blockchain, dnft, dynamicnft, onchain
Published: 2023-03-27 13:43:07



**Introduction**
As the world shifts toward digitalization, the need for secure and transparent asset ownership is greater than ever before. Blockchain technology offers a unique solution to this challenge, and in the world of gaming, the advent of digital non-fungible tokens (dNFTs) is changing the game.



**What are dNFTs?**
dNFTs are unique digital assets that are stored on a blockchain network, providing players with true ownership and control over their in-game assets. Unlike traditional in-game items, dNFTs can be bought, sold, and traded independently of the game environment, creating a new market for gamers to exchange their virtual goods.



**The Benefits of dNFTs**
One of the key benefits of dNFTs is the transparency and fairness they bring to the gaming industry. With traditional in-game items, players have no guarantee that their items will retain their value or even remain in the game. With dNFTs, players have complete ownership of their assets and can be sure that their value will not be impacted by changes to the game environment.

Another benefit of dNFTs is their interoperability. Players can use their dNFTs across multiple games and platforms, allowing for greater flexibility and freedom in their gaming experience. This interoperability also creates a new market for dNFTs, as players can sell their assets to other players and potentially even profit from their in-game investments.



**The Future of Gaming with dNFTs**
As the gaming industry continues to grow and evolve, dNFTs are poised to play an increasingly important role in the future of gaming. With the power of blockchain technology behind them, dNFTs offer a secure, transparent, and interoperable solution for digital asset ownership that has the potential to revolutionize the way we think about virtual goods.

At Galaxia Studios, we are committed to building on-chain games using dNFTs. We believe that by providing players with true ownership and transparency, we can create a more fair and inclusive gaming experience that is accessible to all.



**Conclusion**
dNFTs represent the future of digital asset ownership in the gaming industry, offering players a new level of control and flexibility over their virtual goods. As the industry continues to evolve, we believe that dNFTs will become an increasingly important part of the gaming experience, providing players with a more secure, transparent, and interoperable way to own and exchange their in-game assets.
Why You Should Use Node.js in Your Business
Tags: node, developer
Published: 2023-03-27 13:26:49

The last few decades have seen a significant amount of transformation driven by technology. Since the invention of the first computer program, humanity has come a long way to create the extremely sophisticated programs we take for granted today. Yet none of that would have been possible if Node.js hadn't been a fast and flexible runtime environment.

**What Exactly Is Node.js?**

One of the most well-known open-source runtime environments, Node.js, has existed since 2009. Some of the first companies to make use of the Node.js runtime environment included Microsoft, PayPal, and IBM. Node.js engineers are well-versed professionals from both the client and server sides because it is used to write JavaScript on both of these platforms.

**Why Should Businesses Use Node.js?**

Companies must contend with the intense rivalry that only appears to be getting stronger every day in this highly digitalized corporate world. Businesses must therefore take the required steps to differentiate their offers.

There are numerous features available in the Node.js framework that can aid organizations in improving the performance of their products. Among them are the following:

1. Speed Has Always Been a Strong Suit For Node.js
2. Unmatched Control Over Scaling And Memory Use Capabilities 
3. Creating Real-Time Web Applications Couldn’t Get Any Simpler With Node.js
4. Node.js Can Handle High-Traffic Websites 
5. Node.js Helps Enhance Productivity

Over the past ten years, Node.js has grown to be among the most widely used programming languages. Its popularity is being fueled by a number of obvious aspects, including the scalability, usability, and speed of the framework. In addition, the framework is ideal for both inexperienced and experienced developers. [Read this article](https://nancy-rubin.com/2023/02/28/why-you-should-use-node-js-in-your-business/) to find the Node.js use in Your Business.
Demo Project News.AI
Published: 2023-03-27 13:22:35

Welcome to the official video description for Project News AI, a PHP project that revolutionizes the way we consume news!

In this video, I'll be taking a closer look at Project News AI and how it works. Project News AI is an innovative news aggregator that uses artificial intelligence to curate news articles from various sources and present them in a user-friendly interface.

With Project News AI, you no longer need to scour multiple news websites to get the latest updates. Our AI algorithms carefully analyze news articles from various sources and categorize them based on their topics, relevance, and importance. This ensures that you get the most relevant news articles at your fingertips.

In addition, Project News AI is built on PHP, one of the most popular server-side programming languages in the world. This makes it highly scalable, efficient, and easy to maintain. Our team of experienced PHP developers has worked tirelessly to ensure that the codebase is robust, secure, and optimized for performance.

Whether you're a news junkie, a journalist, or just someone who wants to stay informed, Project News AI is the perfect tool for you. With its intuitive interface, personalized recommendations, and real-time updates, you can be sure that you're always up-to-date with the latest news.

So why wait? Try Project News AI today and experience the future of news aggregation!

https://www.youtube.com/watch?v=OOLcYr0YSd0

Project is open source and can be found at

https://github.com/Cornatul/news.ai created by @Cornatul on 2023-03-27 13:22:09 https://lzomedia.com #developers #opensource #laravel #php #social #medium #twitter #github created by [Software Developer](https://lzomedia.com)
Selectors' Fight
Tags: showdev, css, html, joke
Published: 2023-03-27 13:19:41

---
title: Selectors' Fight
published: true
description: comiCSS cartoon for March 27, 2023
tags: showdev,css,html,joke
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/te3in5pyacnyopngc19k.png
canonical_url: https://medium.com/comi-css/selectors-fight-f63ab38b0181
---


![Cartoon with a CSS class selector telling an id selector: “you have no class”. The Id selector replies “and you need to be more specific”](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t6o029f3f0jx9zxwl5jc.png)


This cartoon was inspired by a joke that [Jorge Baumann](https://twitter.com/baumannzone) shared on Twitter (in Spanish), and that I modified/expanded a little:

{% twitter https://twitter.com/baumannzone/status/1634239453374890004 %}

I should have written an article about CSS Specificity to accompany this cartoon… but last week was especially hectic at work and wasn’t able to carve some time to write it (I will write it, I just haven’t yet).

## Links

- Permalink: https://comicss.art/?id=81
- Image: https://comicss.art/comics/81/selectors-fight.png
- Source code: https://comicss.art/comics/81/selectors-fight.html

## Spanish version

I also started translating the cartoons into Spanish. Not all have an equivalent, but this one worked just fine:

![Cómic con un selector CSS de clase diciéndole a un selector de id: “no tienes ninguna clase”. El selector de id responde “tienes que ser más específico”](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4nprfnl0h9km2wx4kg0j.png)
Collection VS Array
Tags: laravel, array, beginners, collection
Published: 2023-03-27 13:10:12

**Collection VS Array & When To Use Which**

In Laravel, Arrays and Collections are both used for storing and manipulating sets of data. However, they have some key differences in terms of functionality and performance. Here's a brief overview of arrays and collections in Laravel, along with some examples of when to use each one:

**Arrays:**

- An array is a basic data structure that stores a set of values, indexed by a numeric key.
- Laravel provides a number of helper functions for working with arrays, including `array_map()`, `array_filter()`, and `array_reduce()`.
- Arrays are generally faster and use less memory than collections, especially for small datasets.

**When to use**: 
              Arrays are a good choice when you have a simple dataset that you need to iterate over quickly. For example, if you're working with a small set of numeric values, you might use an array to store them.

Example:

```
$numbers = [1, 2, 3, 4, 5];
$filtered_numbers = array_filter($numbers, function($num) {
    return $num % 2 == 0;
});
```

**Collections:**

- A collection is an object-oriented version of an array, with additional methods and functionality for working with the data.
- Laravel's collection class provides a wide range of helper methods for filtering, transforming, and sorting data, such as `map()`, `filter()`, and `sortBy()`.
- Collections are generally slower and use more memory than arrays, especially for large datasets. However, they provide more functionality and flexibility.

**When to use:**
              Collections are a good choice when you need to work with more complex datasets that require filtering, sorting, or transformation. For example, if you're working with a collection of database records, you might use a collection to filter the records by certain criteria and then sort them by date. Collections are also useful when you need to chain multiple operations together, as the fluent interface makes it easy to do so.

Example:

```
$users = App\Models\User::all();
$admins = $users->filter(function ($user) {
    return $user->isAdmin();
});
$names = $admins->map(function ($user) {
    return $user->name;
});
```
Paracetamol.js💊| #209: Explica este código JavaScript
Tags: javascript, webdev, spanish, programming
Published: 2023-03-27 13:06:01

## **<center>Explica este código JavaScript</center>**
#### <center>**Dificultad:** <mark>Intermedio</mark></center>

```js
const isPromise = (promise) => promise instanceof Promise

console.log(isPromise(fetch()))
console.log(isPromise(Promise.reject("bye bye")))
console.log(isPromise([]))
```

- A. `true`, `true`, `true`
- B. `false`, `false`, `false`
- C. `true`, `true`, `false`
- D. `true`, `false`, `false`  


Respuesta en el primer comentario.

---
Calling Deepl's API from the Crystal language
Tags: crystal, deepl
Published: 2023-03-27 12:56:07

As the title suggests, recently, ChatGPT is becoming popular. However, ChatGPT is more accurate in responding when asked in English rather than in Japanese. Therefore, there are times when you want to quickly translate from Japanese to English to ask questions to ChatGPT.

## Snippet to call DeepL translation from Crystsal language

By giving reference code and reference documents to ChatGPT from Crystal language, a language to call DeepL's API was written. An API Key is required for use.

```crystal
require "http/client"
require "json"

module Deepl
  class ApiKeyError < Exception; end
  class RequestError < Exception; end

  class Translator
    API_ENDPOINT = "https://api-free.deepl.com/v2/translate"

    @http_headers : HTTP::Headers

    def initialize
      @http_headers = build_http_headers
    end

    def build_http_headers
      HTTP::Headers{
        "Authorization" => "DeepL-Auth-Key #{get_api_key}",
        "Content-Type"  => "application/x-www-form-urlencoded",
      }
    end

    def get_api_key
      if ENV.has_key?("DEEPL_API_KEY")
        ENV["DEEPL_API_KEY"]
      else
        raise ApiKeyError.new
      end
    end

    def request_translation(text : String, target_lang : String)
      request_payload = "text=#{URI.encode_www_form(text)}&target_lang=#{URI.encode_www_form(target_lang)}"
      send_post_request(request_payload)
    end

    def send_post_request(request_data : String)
      HTTP::Client.post(API_ENDPOINT, body: request_data, headers: @http_headers)
    rescue error
      raise RequestError.new("Error: #{error} #{error.message}")
    end

    def translate(text, target_lang)
      response = request_translation(text, target_lang)
      parsed_response = JSON.parse(response.body)
      parsed_response.dig("translations", 0, "text")
    end
  end
end
```

The Example Response looks like this:

```
{
  "translations": [
    {
      "detected_source_language": "EN",
      "text": "Hallo, Welt!"
    }
  ]
}
```

You can use it like this:

```crystal
input_text = ARGV[0]
target_lang = "ZH"

translator = Deepl::Translator.new
translated_text = translator.translate(input_text, target_lang)

puts translated_text
```

```
./deepl Hello.
你好。
```

That's all. Have a nice day.
{minimize: false} MongoDB
Published: 2023-03-27 12:55:25

## Explanation

In Mongoose, when creating a schema, the { minimize: false } option is used to prevent the schema from automatically removing empty objects and arrays from the document before saving it to the database.

By default, Mongoose will remove any object or array from the document that has no keys or elements. This behavior is useful in many cases as it helps to keep the database tidy by removing unnecessary empty data.

However, in some situations, you may want to store empty objects or arrays in the database. For example, you may want to store a user profile with an empty address field that will be filled in later. In this case, you can use the { minimize: false } option when defining your schema to prevent Mongoose from removing the empty field.

Here is an example of how to use { minimize: false } in a Mongoose schema:


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

In this example, the address field is defined as an object, and the { minimize: false } option is used to prevent Mongoose from removing it if it is empty. Note that the default option is also used to set the address field to an empty object by default.
useEffect, what you don't know
Tags: react, webdev, javascript, beginners
Published: 2023-03-27 12:50:30

`useEffect` in react is used to handle **asynchronous** code. what does this mean, **asynchronous** tasks means things you have to wait for, such as fetching data from an API.

Here are a few things to note about `useEffect`

**1** It will run only at load time, if the dependency array is empty.

**2** It will run everytime the component re-renders if you do not include a dependency array.

**3** It will run everytime the dependency array changes.

**4** **Clean up function**:This runs everytime the component un-mounts. The callback of `useEffect` returns a clean-up function which ou can use for various things such as `clearIntervals`, cancel API request.

<a href="https://www.buymeacoffee.com/ifeanyichima" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>


**Thank you, Please follow me**

[![HTML](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://linkedin.com/ifeanyi-thankgod-chima)&nbsp;[![GitHub](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/masterifeanyi)