teleren/devto huggingface dataset:
Un opérateur RXJS pour debugger avec élégance ?
Tags: rxjs, operator, angular
Published: 2023-09-27 17:26:29

---
title: Un opérateur RXJS pour debugger avec élégance ?
published: true
description: Un opérateur RxJS personnalisé pour le débogage plus pratique et plus élégant.
tags: rxjs, operator, angular
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9i7s24ivo3grqxfv65cc.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-09-27 16:50 +0000
---

Tous les développeurs utilisant RXJS qui ont voulu déboguer ont déjà fait :
```jsx
obs$.pipe(tap((v) => console.log("data", v)))
// ou pour les plus malins.
obs$.pipe(tap(console.log)) 
```

C'est pas très fun. Pour y remédier, on va créer un opérateur personnalisé qui nous permettra d'avoir : 

![rxjs operateur debug output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obleiosnd6c5bnpj1fdi.png)

Plus sympa comme logs non ? 
Pour l'utiliser, il suffit de le passer dans le pipe :

```jsx
import { debug } from './custom.operators.ts'

obs$.pipe(debug("data"));
```

Côté implémentation, c’est simple : 

```jsx
export function debug<T>(tag = 'Untitled') {
  if (environment.production) {
    return tap<T>();
  }

  const t = tag[0].toUpperCase() + tag.slice(1);

  return tap<T>({
    next(value: T) {
      console.log(
        `%c[${t}: Next]`,
        'background: #84cc16; color: #fff; padding: 3px; font-size: 9px; font-weight: 500;',
        value
      );
    },
    error(error) {
      console.log(
        `%[${t}: Error]`,
        'background: #ef4444; color: #fff; padding: 3px; font-size: 9px; font-weight: 500;',
        error
      );
    },
    complete() {
      console.log(
        `%c[${t}]: Complete`,
        'background: #6b7280; color: #fff; padding: 3px; font-size: 9px; font-weight: 500;'
      );
    },
  });
}
```

En bonus, j'ai ajouté une petite ligne en haut pour ne pas logger en production.

Voilà :) Happy coding !
Thinking of humanity as a good thing and your code expanding the horizons of humanity #discuss
Published: 2023-09-27 17:07:42

Me after I get like 30 k a week profit from high ticket item shopify or other dropshipping stores I am gonna work on my passion projects like my public deindoctrination app that gamfiys everyday tasks with the goal of seeding humanitys empire through out the know solar system and beyond.
Adding an AI chatbot to Your Portfolio Site
Tags: portfolio, website, chatgpt, webdev
Published: 2023-09-27 17:07:04

Hey guys! 👋

With all the recent hype about AI chatbots being embedded in every business nowadays. I had a crazy thought: 

**Why aren't there AI chatbots for personal portfolio websites?**

**What kind of questions would visitors even ask it?**

**And How would it improve someone's portfolio site?**

These questions led me to build [chatfolio.org](https://chatfolio.org), a free to use AI chatbot for your portfolio site that's trained on your resume.


![Chatfolio.org chatbot example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4rcjgudf11rk3jkmv4ca.gif)

 

I'd love to hear your guy's thoughts on this idea. Do you think an AI chatbot would be a good addition to a portfolio site? Why or why not?
Join Our Hacktoberfest Celebration and Contribute to Our Programming Blog!
Tags: hack23maintainer, hacktoberfest23, hacktoberfest, opensource
Published: 2023-09-27 17:05:10

Hello there, tech enthusiasts, developers, and writers! We're excited to invite you to our Hacktoberfest celebration. 🎉 It's that time of the year when open-source enthusiasts come together to contribute, learn, and grow. Whether you're a seasoned developer or someone passionate about tech who's new to coding, we have a special place for you.

**What is Hacktoberfest?**
Hacktoberfest is an annual event where the global open-source community collaborates on open-source projects. It's an opportunity for individuals of all skill levels to contribute to the world of open source.

I'm Abhay, and I'm excited to share my Hacktoberfest 2023 journey as a maintainer. This isn't my first Hacktoberfest rodeo; I've had the privilege of Contributing in previous years, but this year is truly special, as I am a maintainer for a repo. You can find me on GitHub [here](https://github.com/darkbits018).

**Our Open Source Programming Blog**
We're proud to introduce our open-source programming blog repository hosted on GitHub. Our blog covers a wide range of programming topics, tutorials, best practices, and insights. We believe in the power of sharing knowledge and building a supportive community.

Our blog is built using Jekyll, a static site generator, which means you don't need extensive coding skills to contribute. We welcome writers, tech enthusiasts, and anyone passionate about programming.

**What contributions are we looking for ?**
My goal for this year is to focus on getting as much as Low-Code and Non-Code contributions. So a blog that covers how-to's, tutorials, guides, and technical writing is a great way I believe. The blog topics will be the issues, pick any, and one of our maintainers will assign it and you can start contributing. Refer to [Contribution Guidelines](https://github.com/Grimm-s-Alchemy-Chamber/hackers_hive/blob/main/CONTRIBUTING.md).

[Hacker's Hive GitHub](https://github.com/Grimm-s-Alchemy-Chamber/hackers_hive).

[Hacker's Hive](https://hackershive.tech/).

I'm Still configuring the Discord server but feel free to stop by [Join Our Discord Server](https://discord.gg/ZsNGUK84yk)
A Universal Terminal alias for bun, pnpm, npm, and yarn.
Tags: productivity, react, webdev, coding
Published: 2023-09-27 16:59:11

I've typed npm for the last time.

As JavaScript developers, we have four package managers to choose from. And between personal, work, and open source projects, I use every last one of them. This is a problem because typing the wrong command costs time and irritation.

Below is zsh function that I've used to eliminate package manager context switching heartache — typing npm start when we meant bun start or npm when I mean ::shudders:: yarn.

```
p() {
  if [[ -f bun.lockb ]]; then
    command bun "$@"
  elif [[ -f pnpm-lock.yaml ]]; then
    command pnpm "$@"
  elif [[ -f yarn.lock ]]; then
    command yarn "$@"
  elif [[ -f package-lock.json ]]; then
    command npm "$@"
  else
    command pnpm "$@"
  fi
}
```

## What this command does

zsh functions can be used like fancy aliases with the addition of a runtime check. This function checks for the existence of a lock file and runs the stated command with the correct package manager.

## What this command does not do

This function does not create a universal interface around the varied package managers. I don't find universal interfaces helpful.

And I enjoy utilizing the subtleties in each package manager. My problem is the muscle memory around common commands (start, install, and test) and those actions inadvertently spawn confusion.

## Learn more

Check out these references if you want to learn more about zsh functions.

[Intro to zsh functions](https://zsh.sourceforge.io/Intro/intro_4.html)
[How to define and load your own shell function in zsh](https://unix.stackexchange.com/questions/33255/how-to-define-and-load-your-own-shell-function-in-zsh)
@Postconstruct and @Predestroy
Tags: javascript, tutorial, typescript
Published: 2023-09-27 16:41:35

(https://javatute.com/spring-boot/postconstruct-and-predestroy/#google_vignette
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88kb4y4djjh9o3tnzcm4.jpg))
Accessing Local Storage variables from Javascript
Published: 2023-09-27 16:35:10

ok.... I can read and write local storage variables via javascript with no problem as follows:

localStorage.set("testvariable", "3");
testvar = localStorage.get("testvariable);

And I can even verify these statements work from Developer Tools in Mozilla, Chrome, and Edge (They are ubiquitious).....

#BUT

I write variables from my sso (sso.acme.com), and from my webroot (acme.com)

I need to write one function which can retrieve testvariable.sso.acme.com and testvariable.acme.com which are shown separately in the browser debug. (Yes I know cookies work too but I dont want to use that method for different reasons).

It appears there is a way to set your context to sso.acme.com before I call local.storage.get?

I wanna write something like.....
function parser()
{
setcontext(sso.acme.com); (this function doesnt exist??)
a = localStorage.getItem("testvariable);
setcontext(acme.com);
b = localStorage.getItem("testvariable);
c = a + b;
alert (c);
}
Pocket Kotlin-C# Dictionary. D
Tags: kotlin, csharp
Published: 2023-09-27 16:32:17

## D

| Kotlin | C# |
| --- | --- |
| **data**<br> **Data class** is a class designed to hold data, it has some automatically created methods like value-based equals() and so on [Learn more](https://kotlinlang.org/docs/data-classes.html). **Data object** a singleton with few automatically created methods [Learn more](https://kotlinlang.org/docs/object-declarations.html#data-objects) | **record**, which is a synonym for **record class**, is an equivalent to Kotlin **data class**. C# doesn't have built-in support for singletons, so the nearest equivalent to the **data object** is an explicitly coded singleton of **record class** [Learn more](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record) |
| **@delegate**<br> Annotation target that specifies that annotation is related to delegate automatically created by **by** [Learn more](https://kotlinlang.org/docs/annotations.html#annotation-use-site-targets) | C# does not have built-in language support for delegation pattern. One can code pattern classes manually and set annotating attributes everywhere he wants |
| **do**<br> Do-while loop (loop with postcondition) [Learn more](https://kotlinlang.org/docs/control-flow.html#while-loops) | **do**<br> Do-while loop (loop with postcondition) [Learn more](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-do-statement) |
| **dynamic**<br> Turns-off type-checker to to interoperate with untyped or loosely typed environments, such as the JavaScript ecosystem. Not supported in code targeting the JVM [Learn more](https://kotlinlang.org/docs/js-project-setup.html) | No such thing. C# code is always statically-typed (types are checked by compiler) |
client rate limit exceeded
Published: 2023-09-27 16:25:12


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/giwal5bu2juiyag8zklz.png)
does any one could help me out from this error 
I'm reading a book "bootstrapping-microservices-with-docker-kubernetes-and-terraform-a-project-based-guide" and I have stuck at chapter-7-example-3 
we are deploying the video microservice to the azure cloud and creating a loadbalancer to access it
javassist.CannotCompileException: [source error] Field capabilities in org.openqa.selenium.remote.RemoteWebDriver is private
Published: 2023-09-27 16:13:15

This error message: "javassist.CannotCompileException: [source error] Field capabilities in org.openqa.selenium.remote.RemoteWebDriver is private," suggests that you are trying to access or modify a private field in the RemoteWebDriver class, which is part of the Selenium WebDriver library. Accessing or modifying private fields directly is not supported and can lead to unexpected behavior and errors.

To set Appium capabilities for your WebDriver, you should not attempt to modify the private capabilities field directly. 


Instead, you should use the provided methods or constructors to set the desired capabilities. 

Here's an example of how to set Appium capabilities using the Java client for Appium:

```
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

public class AppiumExample {
    public static void main(String[] args) {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "your_device_name");
        capabilities.setCapability(MobileCapabilityType.APP, "path_to_your_app.apk");

        // Add more capabilities as needed

        AndroidDriver driver = new AndroidDriver("http://appium_server_url:port/wd/hub", capabilities);

        // Perform your automation tasks here

        driver.quit();
    }
}

```

In the code above, we create an instance of DesiredCapabilities and set the desired capabilities using the appropriate setters. Then, we pass the capabilities object to the constructor of AndroidDriver (assuming you're working with Android) to initialize the driver with the desired capabilities.

Make sure you have the Appium server running and the necessary dependencies set up in your project to work with the Appium Java client.

If you have a specific scenario or code snippet that you are encountering the error with, please provide more details so that I can offer more targeted assistance.
HTML, CSS Layouts-simple Home page
Tags: css, html, webdev
Published: 2023-09-27 16:03:45

## Website templates
Hello Aliens in this post I would like to show you all how easy to
make a website only by knowing simple HTML and CSS, can't able to believe than you all can visit  my [Code-pen](https://codepen.io/Black-ninja) 

if you are thinking about web development, and want to make your own personal web page then stay connected with me.

I will be going to share all my mistakes and all my achievements while I'm learning HTML and CSS.

If you are a #beginner or college student from any background feel free to learn to programming, not only web development but also many more technologies because the virtual world is growing very rapidly

stay connected with me for web development is an easy way.
![Normal Layout with CSS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7m8vwiduyfa6073oei2o.png)  

Thank you..
TESTING in Laravel
Tags: laravel, testing, php, programming
Published: 2023-09-27 15:58:52

## Understanding Testing in Laravel

Testing is an integral part of any robust software project. As your project grows in complexity, the importance of identifying and rectifying potential issues and edge cases cannot be overstated. Writing tests is not only a best practice but also a way to ensure the efficiency and reliability of your system.

In the world of Laravel, testing is made seamless through a powerful framework built on PHPUnit and seamlessly integrated with Artisan. Laravel categorizes tests into two main types: Unit tests and Feature tests.

## Unit Tests

Unit tests are the foundation of your testing suite. They focus on testing individual parts of your code in isolation. This means that you can isolate specific functions, methods, or classes and thoroughly test their behavior.

## Feature Tests
Feature tests, on the other hand, are designed to test the overall behavior of your application. They simulate user interactions with your application, making sure that all the components work together harmoniously.

For more hands-on examples and detailed explanations, check out the "testing" branch in the [Laravel Hands-On GitHub repository](https://github.com/mazimez/laravel-hands-on/tree/testing).
Rails 7.1 adds *_deliver callbacks to Action Mailer
Tags: rails, webdev, backend, ruby
Published: 2023-09-27 15:56:40

Exciting news for Rails developers! 🚀

Rails 7.1 has introduced *_deliver callbacks to Action Mailer, making email handling smoother and more efficient. 📧 ✨

Say goodbye to complex workarounds and hello to cleaner, more maintainable code. 👋

Learn more in this insightful blog post. 👇

https://www.bigbinary.com/blog/rails-7-1-adds-_-deliver-callbacks-to-action-mailer
gitea doctl
Published: 2023-09-27 15:44:54

---
title: gitea doctl
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-09-22 07:48 +0000
---

    alias ks=kubectl # not to be confused with kube alias k
    alias k9=k9s      # handy terminal user interface (HTUI)

> OOR aka. Open On Request vs. OSS aka. Open Source Software

> At the moment of writing this - and this symptomatic ADHD behavior -X is about a side project, and, a side note on this side project. So to tell the cat house is willing to produce cat memes and cat NFTs of course! That is finally need to be layered under security measures so that you are the only owner of the data being publicly available but ciphered in a way you remain the only one to be able to manage it (revoke access to others, grant access to others, etc.)

    ks port-forward svc/gitea-http 3000

_Ikagai The Kingdom of Heaven is Witihin_

And what you were waiting for was this `helm` gist:

    # if you never had the chance to get the repo yet
    helm repo add gitea-charts https://dl.gitea.com/charts/ 
    helm repo update
    
    # saving precious resources 🔌🤑
    # simple install (no ha for postgres and no redis) and you can save resources 
    helm install \
        gitea \
        gitea-charts/gitea \ 
        --set=postgresql-ha.enabled=false \
        --set=redis-cluster.enabled=false

See also

> https://gitea.com/gitea/helm-chart#user-content-minimal-configuration
Optimize Performance with Memoization
Tags: javascript, tutorial, programming
Published: 2023-09-27 15:30:00

Memoization is an advanced technique used to optimize the performance of functions by caching the results of expensive or time-consuming computations. By storing previously calculated results, you can avoid redundant calculations and improve the efficiency of your code.

Here's a basic example of memoization:

```javascript
// Without memoization
function fibonacci(n) {
    if (n <= 1) return n;
    return fibonacci(n - 1) + fibonacci(n - 2);
}
var startTime = performance.now();
console.log(fibonacci(45)); // 1134903170
var endTime = performance.now();
var executionTime = endTime - startTime;
console.log(executionTime); // Around 15000 ms

// With memoization
const memo = {};
function fibonacciWithMemoization(n) {
    if (n <= 1) return n;
    if (memo[n]) return memo[n];
    memo[n] = fibonacciWithMemoization(n - 1) + fibonacciWithMemoization(n - 2);
    return memo[n];
}

startTime = performance.now();
console.log(fibonacciWithMemoization(45)); // 1134903170
endTime = performance.now();
executionTime = endTime - startTime;
console.log(executionTime); // Around 0.5 ms
```

In this example, the `fibonacciWithMemoization` function caches the results of Fibonacci calculations in the `memo` object, which prevents redundant calculations.

Key points about memoization:

1. **Caching Results:** Memoization stores computed results in memory, allowing the function to return those results when the same inputs are encountered again.

2. **Pure Functions:** Memoization is most effective with pure functions, which produce the same output for the same input. This property ensures that cached results remain valid.

3. **Efficiency:** Memoization can significantly improve functions' performance involving expensive computations, recursive algorithms, or complex calculations.

4. **Memory Usage:** Be mindful of memory usage, especially when memoizing functions with many possible inputs. You may need to implement mechanisms to limit the cache size or use libraries like `lru-cache` to manage it.

5. **Function Composition:** You can compose memoized functions to build more complex, efficient operations. This is especially useful in functional programming.

Memoization is a powerful technique for optimizing the performance of your JavaScript applications, particularly in situations where you need to compute values that are expensive to calculate or are repeatedly requested with the same inputs. However, it's essential to use it judiciously, as excessive caching can lead to increased memory usage.
AGE: Coexistence of Graph and Relational Databases
Published: 2023-09-27 15:22:51

##Introduction
AGE acts as a link between two different worlds contained within a same database system. This blog examines the intriguing qualities of AGE and how it can transform the way we manage and get meaning from intricate data interactions. With AGE, you can combine the comfort of relational databases with the strength of graph databases to provide a unified and flexible solution for your data management needs.

AGE was created to give PostgreSQL, one of the most popular relational database management systems (RDBMS), access to graph databases' features. Lets see how we can use full power of AGE and Postgres to make a database which can handle both relational tables and graphs at the same time.

##Unified Data Management

Through the usage of openCypher, a widely used graph query language, and ANSI SQL for structured data, users of AGE are able to quickly manage both relational and graph data models within a single database. These two technologies are seamlessly merged into a single database.

##The Strength of PostgreSQL

AGE is based on the robust PostgreSQL architecture and benefits from its power and feature set. This includes support for multi-version concurrency control (MVCC), stored procedures, triggers, restrictions, and more. ACID (Atomicity, Consistency, Isolation, Durability) transactions are also included. To guarantee data confidentiality and integrity, AGE makes use of PostgreSQL's well-established dependability.

##Effortless Integration

Making the switch to AGE is simple, especially for users who are accustomed to relational databases. No major reconfiguration or difficult data migrations are required. A hassle-free deployment of graph database capabilities is made possible by AGE, which effortlessly incorporates graph data analytics into your current PostgreSQL system.

## Conclusion

Inshort not only can you use AGE for converting postgres into a graph database you can also use the full funcionality of postgreSQL without compromising any database or relations.
Best Diplomats
Published: 2023-09-27 15:19:12


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z2i1vkertd59xya5kpyl.png)
Best Diplomats is committed to nurturing the next generation of diplomats and advocates. Our platform offers a unique opportunity for young leaders to exchange ideas, enhance their critical thinking, and embrace United Nations values. Join us in building a more inclusive and effective multilateralism.
Best Diplomats is on a mission to advance diplomacy as a force for positive change. By organizing Diplomatic Simulations, we create a dynamic space for aspiring leaders to learn the art of diplomacy, develop lobbying skills, and address pressing global issues. Together, we're working towards a more sustainable and interconnected world.
[bestdiplomats.org](https://bestdiplomats.org/)