teleren/devto huggingface dataset:
Onboarding plan for your Newcommers
Tags: beginners, webdev, productivity, career
Published: 2024-04-13 15:24:25

## Before newcommers first day

- The best choice for the first working day is the first day of the week.
- Create the corporate email for the new employee.
- Create all other accounts (Slack, GitHub, etc.).
- Prepare the workplace (laptop, monitor, keyboard, mouse, etc.).
- Prepare the access to the office.
- Send invites to the necessary systems.
- Schedule the meetings for the first week.
- Prepare goals and KPIs for the first month.
- Create an onboarding plan.
- Prepare video records (Product Overview, Codebase Overview, etc.). - this
 will help to avoid unforeseen matters, situations on the day of onboarding 
 on your part - the new employee will know what to do at any time.
- Prepare all the technologies / approached documentation that might be new or important to the employee.

## Onboarding plan (just an example)

| Task/Day | Mon                                                                          | Tue                                | Wed | Thu | Fri |
| -------- | ---------------------------------------------------------------------------- | ---------------------------------- | --- | --- | --- |
| 1.       | Checkup Email, accept all the invitations, create all the necessary accounts | (Meet): Daily              |     |     |     |
| 2.       | (Meet): Daily                                                                | (Video): Testing Workshop          |     |     |     |
| 3.       | (Video): Engineering Playbook Overview                                       | (Meet): Q&A Session                |     |     |     |
| 4.       | Engineering Playbook Reading                                                 | Set up and run project(s) locally  |     |     |     |
| 5.       | (Video): Product Overview: figma, env, and storybook                         | Play with codebase, investigate it |     |     |     |
| 6.       | (Video): Jira Overview                                                       | (Meet): Q&A Session                |     |     |     |
| 7.       | (Video): Project Overview (codebase)                                         |                                    |     |     |     |
| 8.       | (Video): Swagger Overview                                                    |                                    |     |     |     |

## Read More
- [Runespoor Engineering Playbook](https://runespoor-engineering.github.io/runespoorstack/docs/engineering-playbook/engineering-playbook-checklist)
- Tap the Star on the [Runespoor Stack](https://github.com/runespoor-engineering/runespoorstack) repository to support us.
Enhancing Search Experience with AI: LLM Open Search on Cloudflare Workers
Tags: cloudflarechallenge, devchallenge, ai, serverless
Published: 2024-04-13 15:23:31

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

**LLM Open Search** is a serverless AI app deployed on Cloudflare Workers, designed to elevate the search experience by providing intelligent responses, relevant questions, and chat completions. It leverages Cloudflare's Workers AI and a couple of models from the Cloudflare catalog to analyze and respond to user queries effectively.

## Demo

Explore the capabilities of LLM Open Search through this live demonstration: [LLM Open Search](https://llm-open-search.pages.dev/)

![LLM Open Search in action](https://cdn.loom.com/sessions/thumbnails/d21687daed7d4f19900c7aa957387ea4-with-play.gif)

[Open Search - Powering insights with AI - 13 April 2024 - Watch Video
](https://www.loom.com/share/d21687daed7d4f19900c7aa957387ea4)

## My Code

Dive into the code and setup for LLM Open Search on GitHub: [GitHub Repository - LLM Open Search](https://github.com/jacksonkasi1/open-search)

You'll find a comprehensive README file that details installation and running the project, ensuring easy replication and local setup.

## Journey

Throughout the development of LLM Open Search, I focused on utilizing Cloudflare’s AI models to enhance text-based search functionalities:

- **Text Generation with @cf/meta/llama-2-7b-chat-int8**: Used for generating relevant follow-up questions based on the initial search results.
- **Chat Completion with @cf/meta/llama-2-7b-chat-fp16**: Applied to refine search results into coherent and contextually relevant responses.

This application solely utilizes AI for text manipulation and generation, demonstrating a focused application of AI technology in enhancing search experiences.

## Innovation and Creativity

LLM Open Search integrates Cloudflare’s AI models in a unique way, focusing on enhancing the depth and relevance of search engine responses. The system effectively parses user queries to deliver not only direct answers but also thoughtful follow-up questions, enriching user interaction.

## What’s Next? 🚀

Moving forward, I plan to introduce features like personalized search histories and the ability to group searches into collections. These features aim to provide users with a more tailored and efficient search experience.

## Submitting for Multiple Models and/or Triple Task Types

I want to mention that this project does not qualify for the additional prize categories, as it strategically focuses on utilizing two AI models to perform sophisticated text generation tasks efficiently. However, if I implement my upcoming features in this project with any other AI model, I will update it here.

Thank you for considering LLM Open Search in this challenge.😊
** Rapper name generator:
Tags: webdev, javascript, beginners, programming
Published: 2024-04-13 15:23:02


**The Caffeinated CX app offers a range of powerful features to streamline tasks across various domains. With AI Translator and Writing Assistant functionalities powered by Jarvis, users experience improved translation accuracy, seamless communication, and enhanced writing assistance across platforms like Gmail and Google Docs.  [Rapper name generator](https://jarvis.cx/help/usecase/rap-lyrics-generator/rapper-name-generator) The app's All-in-one Sidebar Chat feature enables uninterrupted conversations with virtual assistants like ChatGPT and Claude, while Jarvis Copilot boosts coding efficiency and automates tasks within Jira Cloud, enhancing productivity across the board.
Don't write queries inside serializers in Django!
Published: 2024-04-13 14:36:06


![Don't Do it](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nmsuy89phhworxbdjdc.png)


Why?

- It should focus data conversion and validations only. Don't write database logic on this.

- Not efficient and bad performance. It will create lots of queries

- You can not reuse it

- Very hard to test

- Readability is gone


I can share the alternatives if you want! Let me know
Daily Challenge #88 - Recursive Ninjas
Tags: challenge
Published: 2019-10-11 14:12:27

---
title: Daily Challenge #88 - Recursive Ninjas
published: true
series: Daily Challenge
description: Write a recursively so ninjas can signal in code. 
tags: challenge
---

Ninjas frequently need to signal each other in code. They often employ natural sounds as cover. Our ninja will chirp like a bird, with different amounts of chirps signifying different messages.

<pre>
 chirp(4);
  //output would be chirp-chirp-chirp-chirp.
</pre>

Consider `String.prototype.repeat`,`String.prototype.padStart`, and `String.prototype.padEnd` disabled for this challenge, you'll have to think recursively to avoid detection. 

Good luck!

***
_This challenge comes from nodesolomon on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Vortex - A simple and fast web application built with Next.js
Tags: apps, nextjs
Published: 2024-05-15 14:28:41

---
title: Vortex - A simple and fast web application built with Next.js
published: true
date: 2024-04-13 14:12:19 UTC
tags: Apps,Nextjs
canonical_url: https://reactjsexample.com/vortex-a-simple-and-fast-web-application-built-with-next-js/
---

## Vortex
 ![Vortex - A simple and fast web application built with Next.js](https://reactjsexample.com/content/images/2024/04/Code_2024-04_22-11-45.jpg)

Vortex is a simple and fast web application. It is built with Next.js, Tailwind CSS, and Prisma.

![Vortex - A simple and fast web application built with Next.js](https://reactjsexample.com/content/images/2024/04/server.png)

[View Demo](https://vort.me/)[View Github](https://github.com/jarvis2f/vortex)

## Acknowledgments

T3 Stack  
Next.js  
NextAuth.js  
Tailwind CSS  
Prisma  
Umami

## License

Vortex is open source software licensed as MIT.
LOST FUNDS RECOVERY
Published: 2024-04-13 13:57:15

Nowadays, bitcoin investors invest their money through different platforms offered by exchanges, that’s all well and good for the time being, but to the Average person the system can be a little confusing and intimidating, not to worry no more here’s a tip , most financial investors have been giving compliments to this experts ,that’s a client job I guess who’s well comfortable with the technical skills and support this experts rendered. you can reach them on this platform ( jeff silbert 39 gmalL c0m ) With the help of this experts , I’ve been able to regulate my expenses towards my financial struggles which I’m overcoming gradually. it’s important to have a well-diversified portfolio selected to match your investment goals, however this experts helps in the progress towards your financial success. If you have any issue regarding bitcoin why not send them an email and save yourself the stress,
Sample code on Service-to-Service Authentication in Google Cloud Run for Production and Local environments
Tags: googlecloud, cloudrun, javascript, python
Published: 2024-04-13 13:48:12

When using Google Cloud Run, securing communications between services is crucial. If your system architecture utilizes multiple services, it's likely that these services will need to communicate with each other either synchronously or asynchronously. Some of these services may be private and require authentication credentials for access.

It's often not easy to find sample code for setting it up for production and local environments and working with both scenarios with a good developer experience. The goal of this blog post is to provide sample code for the aforementioned scenarios for Python and Node/Javascript.

## Javascript

set up libraries and functions:
```
import { execSync } from "child_process";
import { GoogleAuth } from "google-auth-library";

function exec(command: string): string {
  return execSync(command).toString().trim();
}
```

get id token for local env:
```
function getLocalIdToken(): string {
  return exec("gcloud auth print-identity-token");
}
```

get id token for production:
```
async function getProductionIdToken(url: string) {
  const auth = new GoogleAuth();
  const targetAudience = `https://${url}`;
  const client = await auth.getIdTokenClient(targetAudience);
  return await client.idTokenProvider.fetchIdToken(targetAudience);
}
```

suggested approach to use an env variable to switch it:
```
const idToken = process.env.NODE_ENV === "production" ? 
await getProductionIdToken(url)) : getLocalIdToken();
// add your additional logic here that uses the idToken in the Rest or GRPC call.
```

## Python

set up libraries and functions:
```
import google.auth.transport.requests
import google.oauth2.id_token
from google import auth
```

get id token for local env:
```
def get_local_id_token() -> str:
    creds, _ = auth.default(
        scopes=["https://www.googleapis.com/auth/cloud-platform"],
    )
    request = google.auth.transport.requests.Request()
    creds.refresh(request)
    return creds.id_token
```

get id token for production:
```
def get_production_id_token(url: str) -> str:
    auth_request = google.auth.transport.requests.Request()
    audience = f"https://{url}"
    return google.oauth2.id_token.fetch_id_token(auth_request, audience=audience)
```

suggested approach to use an env variable to switch it:
```
def get_id_token(url: str, env: str) -> str:
    if env == "production":
        return get_production_id_token(url)

    return get_local_id_token()

// add your additional logic here that uses the idToken in the Rest or GRPC call.
```

At the time of writing this blog post, it was not yet possible to use the exact same code for both strategies. Therefore, I recommend switching the presented logic using an environment or configuration variable. I hope this helps!
Project Reactor: Tips (1)
Tags: java, reactiveprogramming, projectreactor
Published: 2024-04-13 13:45:31

# Don't know to use which operators

In [Reactor 3 Reference Guide](https://projectreactor.io/docs/core/release/reference/#which-operator), there is some use case may to use directly.

# To check if subscriber is attached

Nothing is printed after executed following statement.

```java
Flux<Integer> f = Flux.just(1, 2, 3, 4).map(v -> {
    LOGGER.debug("value received in map(): {}", v);
    return v * v;
});
```

Remember to attach a subscriber, or blocking function at the end of the operator chain, otherwise nothing happened. Following is the possible function

- subscribe()
- blockFirst() (blocking)
- blockLast() (blocking)
- toIterable() (blocking)
- toStream() (blocking)

# About time of class instantiation of just()

```java
Flux<Integer> f = Flux.just(new Car("Mercedes-Benz"), new Car("Toyoto"));   // (1)
f.subscribe();  // (2)
```
Class Car will be instantiated when executing (1). If want to defer the class instantiation on (2), please wrap just() by defer()/deferContextual().

```java
Flux<Integer> f = Flux.defer(() -> Flux.just(new Car("Mercedes-Benz"), new Car("Toyoto")));   // (1)
f.subscribe();  // (2)
```
Embracing Learning: Rediscovery and Self-Actualisation ✨
Tags: webdev, beginners, programming, career
Published: 2024-04-13 13:44:01

Once upon a time, after 15 long years since obtaining a university degree merely for the sake of it, I found myself diving into the depths of learning once again. This time, however, it was different. The subject matter that captivated my attention was not merely a requirement but a genuine interest that sparked a newfound enthusiasm within me.

As I delved into this new realm of knowledge, I realised that this was the first time in my life that I was truly engaged in learning something of actual interest. The sense of fulfillment and excitement that coursed through me was palpable, a stark contrast to the disinterest that overshadowed my university days.

With each discovery and each lesson absorbed, I felt a renewed sense of purpose and direction. This was not just about acquiring knowledge; it was about personal growth, self-discovery, and charting a path that resonated with my aspirations and dreams.

As I raised a toast to the future that lay ahead, I knew that this journey of learning, self-discovery, and personal growth was not just a momentary pursuit but a commitment to shaping my life and my destiny. Here's to the rest of my future, filled with endless possibilities and the joy of pursuing what truly matters. Cheers to new beginnings and the exciting adventures that await on this path of self-discovery!
Building a serverless AI App on Cloudflare Workers
Tags: cloudflarechallenge, devchallenge, ai, javascript
Published: 2024-04-13 13:34:13

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  // Parse the incoming request to get the input data
  const data = await request.json();
  
  // Here you would typically call an AI model with the input data
  // For example, using Cloudflare's Open Models (replace with actual model endpoint and API key)
  const aiModelUrl = 'https://api.cloudflare.com/client/v4/models/YOUR_MODEL_ID';
  const aiResponse = await fetch(aiModelUrl, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ input: data.input })
  });
  
  // Get the AI response and format it as needed
  const aiResult = await aiResponse.json();
  
  // Return the AI result as the response from the Worker
  return new Response(JSON.stringify(aiResult), {
    headers: { 'content-type': 'application/json' },
  });
}
Setup path aliases in React + Vite + TS Project 🤓
Tags: webdev, javascript, beginners, react
Published: 2024-04-13 13:34:06

Out of the box, vite doesn't provide an "@" path alias for src, but you can define your own aliases. I assume you are using the Vite preset for react-ts.

The steps to set this up:

### Step 1:

install devDependencies @types/node // so that __dirname can be recognized

```jsx
npm i -D @types/node
```

in vite.config.ts:

```jsx
// ...
import * as path from 'path'

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
  },
})
```

This will inform Vite of his alias.

if you want to have many aliases you can make it like this:

```jsx
// ...
import * as path from 'path'

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: [
      { find: '@', replacement: path.resolve(__dirname, './src') },
      { find: '@components', replacement: path.resolve(__dirname, './src/components/') },
      { find: '@assets', replacement: path.resolve(__dirname, './src/assets') },
      { find: '@data', replacement: path.resolve(__dirname, './src/data') },
      { find: '@pages', replacement: path.resolve(__dirname, './src/pages') },
      { find: '@public', replacement: path.resolve(__dirname, './public/') },
    ],
  },
})
```

or 

```jsx
// ...
import * as path from 'path'

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
      '@components': path.resolve(__dirname, './src/components/'),
      '@assets': path.resolve(__dirname, './src/assets'),
      '@data': path.resolve(__dirname, './src/data'),
      '@pages': path.resolve(__dirname, './src/pages'),
      '@public': path.resolve(__dirname, './public/'),
    },
  },  
})
```

for alias naming can be done freely, I added @ in front of the alias name just to indicate it is an alias, this is just my optional approach. this is all up to you.

### Step 2:

We add the alias "@" to the src directory in tsconfig.json

tsconfig.json:

```jsx
{
  "compilerOptions": {
    // ...
    
    "types": ["node"],
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*", "./dist/*", ""],
      "@components/*": ["src/components/*"],
      "@assets/*": ["src/assets/*"],
      "@data/*": ["src/data/*"],
      "@pages/*": ["src/pages/*"],
      "@public/*": ["public/*"]
    }
  },
  "include": ["src"],
  "references": [{ "path": "./tsconfig.node.json" }]
}
```

### **Usage:**

on the file you want to import an alias:

```jsx
import Comp from '@components/Comp..'

// ...
```

that's all, hope it's useful 🤓⭐😎😊
Debunking Common Myths Surrounding Software Development
Published: 2024-04-13 13:10:44

In the dynamic field of software development, myths and misconceptions can hinder both aspiring developers and seasoned professionals alike. Let's clear the air by addressing some of the most prevalent myths in the industry.

Myth #1: You Must Be a Math Genius
Reality: While a strong mathematical foundation can be beneficial, especially in fields like data science and machine learning, the majority of software development requires problem-solving skills and logic more than advanced math. Many successful developers are not math experts but excel in understanding logic and algorithms.

Myth #2: Programming is Only for the Young
Reality: Software development is a skill that can be learned at any age. The key ingredients are curiosity and a willingness to learn. Many successful developers have started their coding careers well into their thirties, forties, or even later.

Myth #3: Developers Work Alone
Reality: Collaboration is key in software development. Most projects require constant communication with teammates, managers, and clients. Developers often work in teams to brainstorm, solve problems, and share knowledge.

Myth #4: More Code Means Better
Reality: Quality over quantity applies perfectly to coding. Good code is clean, simple, and efficient. It’s often more challenging to write less code that does more, and achieving this is a hallmark of a great developer.

Myth #5: A Degree in Computer Science is Required
Reality: While a formal education can provide a strong theoretical foundation, many developers are self-taught or have graduated from coding boot camps. Practical experience, a solid portfolio, and continuous learning are often just as valuable as a degree.

Myth #6: Software Development Doesn't Require Soft Skills
Reality: Soft skills like communication, empathy, and adaptability are crucial. Developers must explain their ideas clearly, collaborate with others, and adapt to changing technologies and user needs.

Conclusion
Debunking these myths opens the door to a more inclusive and accurate understanding of software development. Whether you're a novice interested in starting a coding journey or a veteran looking to mentor others, remember that this field is as diverse and evolving as the technology itself.

Let’s continue to demystify software development and foster an environment where anyone with passion and perseverance can succeed.

---
Thank you for reading my article! For more updates and useful information, feel free to connect with me on LinkedIn and follow me on Twitter. I look forward to engaging with more like-minded professionals and sharing valuable insights.
Lambda Function(Python)
Tags: python, machinelearning, ai, programming
Published: 2024-04-13 13:05:00

In Python, a lambda function is a small anonymous function without a name. It is defined using the lambda keyword and has the following syntax:

```
lambda arguments: expression
```

Lambda functions are often used in situations where a small function is required for a short period of time. They are commonly used as arguments to higher-order functions, such as map, filter, and reduce.

## Here is an example of how to use a lambda function:

## Function to double the input

```
def double(x):
  return x * 4

```
## Lambda function to double the input

```
lambda x: x * x * x * x

```
The above lambda function has the same functionality as the double function defined earlier. However, the lambda function is anonymous, as it does not have a name.

Lambda functions can have multiple arguments, just like regular functions. Here is an example of a lambda function with multiple arguments:

## Function to calculate the product of two numbers

```
def multiply(x, y):
    return x * y

```
## Lambda function to calculate the product of two numbers

```
lambda x, y: x * y

```
Lambda functions can also include multiple statements, but they are limited to a single expression. For example:

## Lambda function to calculate the product of two numbers, with additional print statement

```
lambda x, y: print(f'{x} * {y} = {x * y}')
```

In the above example, the lambda function includes a print statement, but it is still limited to a single expression.

Lambda functions are often used in conjunction with higher-order functions, such as map, filter, and reduce which we will look into later.

If you have any feedback, then you can DM me on [Twitter](https://twitter.com/DhruvTr89566170) or [Linkedin](https://www.linkedin.com/in/dhruv-trivedi-06a767228/).