teleren/devto huggingface dataset:
How to add multiple rootPath in Coral 3 Pathfield?
Tags: coral, aem, pathfield, touchui
Published: 2023-08-23 06:45:29

As per the Adobe [documentation ]( https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html)`rootPath` of a Pathfield component only supports a string, not multiple strings, ie., only one rootPath. So we need to resolve this issue by overlay or extending this component`/libs/granite/ui/components/coral/foundation/picker/picker.jsp` but from 6.4 onward because picker is marked as granite: FinalArea(Defines a node as final then the Nodes are classified as final cannot be overlaid or inherited.), so we can't overlay.

Instead of enabling multiple root paths for a `Pathfield`, we can follow an alternate approach like choosing a desired root path from a selection list in the dialogue and on the basis of this selection, the root path of the `Pathfield `can be set.

- First, we need to define some options in the select component. Here the options are `/content/demo/en` and `/content/demo/fr `.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sgwcgdxrvdqhz5n3u7i.png)
- Next, we need to define the `Pathfield` component, after saving the dialogue you can see the below output.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tw4gv2u2tcd9kmarskns.png)
- Put the below JavaScript snippet in your `clientlibs `folder and then you can enable the `rootPath` set as per the selection.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kts4ayo1bzotygors204.png)
What handy app have I made using 'text-to-image' AI technology?
Tags: ai, sideprojects, buildinpublic, producthunt
Published: 2023-08-23 06:45:18

Hey there,

I'm Morgan, and I have something really cool to share with you all. I've created an AI-powered wallpaper generator called "**Gemoo AI Wallpaper Generator**," and it's free to try out. It's so easy to use that you won't believe it!

I initially made it for personal use, but after seeing how much my friends loved it, I decided to share it with the world. You can try it for free before it officially launches at: https://gemoo.com/tools/ai-wallpaper-generator

**So, what's great about it?**

Well, it can create **various styles**, like Landscape, Anime, Portrait, Painting, and 3D. All you have to do is right-click the icon in the menu bar, choose the style you want, type in a quick prompt, and voila! **Your wallpaper is generated and set automatically**.

{% embed https://youtu.be/fEi1ILx1MHU %}

If you love changing your wallpaper frequently, just like me, but don't have the time to search for the perfect one, you're going to absolutely love this app. It's only available for Mac, though, since that's what I use.

And，you know what，You can get it for free and make up to 10 wallpapers per day. That's more than enough, I believe, to keep things fresh and exciting.

I'm really excited to share this with you all, and I hope you have as much fun with it as I have. Don't hesitate to let me know what you think in the comments and show your love for it on [Product Hunt](https://www.producthunt.com/posts/gemoo-ai-wallpaper-generator).

Cheers,
Morgan
What Renders the Type Script to Javascript when running Angular Application ?
Published: 2023-08-23 06:32:34

How about Angular Application re ders to browser as thought it consists of type script code mostly 🤔.

  Angular which is Js Farme work for SPA (Single Page Application's).
  Everything in it's built up architecture produces as components which have template which is what html, class file the Application business logic which binds to template file.

Coming to point of concept when Angular app runs through the ng serve cli command the Application renders to type script constructs to javascript through Transpiler.

  Transpiler is the transformer that transpiles type script to javasvript upon browser rendering.
Hola a todos, RIP Cheems
Tags: cheems, bootstrap, ruby
Published: 2023-08-23 06:26:51

So, tonight I worked a bit more on my photogram industrial exercise, I am finally DONE with the data modeling and basically all the "backend" part of the project, now I am starting to add bootstrap onto it

I'm doing partial view templates again just so I don't have to be writing LONG lines of code, and then writing their corresponding shared files, it's pretty much like just writing a template and then using that template link everywhere you want and/or need.

I don't really have much tonight

Oh and I also had to go back and forth on some of my models, because of the spelling errors I often have, at this point I will end up looking for a job that puts me to just read code cause I go back and forth OFTEN

On another and last and most importantest note, a couple of days ago Cheems (the meme dog) passed away, so I'd like to ask you for a minute of silence, RIP Cheems, you will be missed 

xoxox


![Chems in the skies with diamonds](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krc1hbuojdf6qt8dfgt1.jpeg)

Always and forever

Sinhue
Why did we build a custom ESLint plugin?
Tags: eslint, javascript, frontend, webdev
Published: 2023-08-23 06:22:17

Checkout our latest blog post about the journey behind building a custom ESLint plugin - @bigbinary/eslint-plugin-neeto. 📝

🔗 Link: https://www.bigbinary.com/blog/eslint-plugin-neeto

Ever wondered why we embarked on this journey? 🤔

This insightful post takes you through the thought process and technical challenges we faced while creating this powerful tool. 🛠️
new vs-code Extension to generate code snippets in python!
Tags: programming, python, machinelearning, vscode
Published: 2023-08-23 06:22:02

I created a VS code extension!

Re-usable code snippets for machine learning and big data domain in python

try it - [VSCODE Download](https://shorturl.at/bCGLR)

-> supported 30+ reusable code snippets
-> data topic search feature
If Else Statements in Python
Tags: beginners, programming, tutorial, python
Published: 2023-08-23 06:13:57

email = input("Enter your email id:" )
password = input("Enter your password:" )

if email == "superpython@gmail.com" and password == "1234":
---print("Welcome")
elif email == "superpython@gmail.com" and password != "1234":
---print("Incorrect password")
---password = input("Enter password again")
---if password == "1234":
------print("Finally correct")
---else:
------print("Still incorrect")
else:
---print("Incorrect credentials")
Operators in Python
Tags: beginners, programming, tutorial, python
Published: 2023-08-23 05:52:32

Operators are used to perform operations on variables and values. Python has following operators:

## Arithmetic Operators
x = 5
y = 2
print(x + y)
o/p = 7

print(x - y)
o/p = 3

print(x * y)
o/p = 10

print(x / y)
o/p = 2.5

print(x % y)
o/p = 1

print (x ** 2)  power of op
o/p = 25

print ( x // 2) performs integer division
o/p = 2

## Comparison Operators
print(x > y)
o/p = True

print(x < y)
o/p = False

print(x >= y)
o/p = True

print(x <= y)
o/p = False

print(x == y)
o/p = False

print(x != y)
o/p = True

## Logical Operators
x = True
y = False

print(x or y)
o/p = True

print(x and y)
o/p = False

print(not x)
o/p = False

print(not y)
o/p = True

##Bitwise Operators
They work on binary values

x = 2
y = 3

print(x & y)
o/p = 2

binary of 2 = 010
binary of 3 = 011
performing bitwise and on 010 and 011, we get 010 (2 in decimal)

print(x | y)
o/p = 3
performing bitwise or on 010 and 011, we get 011 (3 in decimal)

print (x >> 2)
o/p = 0

print (y << 3)
o/p = 24

print (~x)  # 1s complement
o/p = -3

##Assignment Operators
a = 3
print (a)
o/p = 3

a += 3
o/p = 6

a =- 3
o/p = 3

a *= 3
o/p = 9

a &= 3

a++ and ++a does not exist in Python. Using this generates a Syntax Error.

## Identity Operators
Checks if 2 variables are on the same memory location.

a = 3
b = 3

print (a is b)
o/p = True

a = [1,2,3]
b = [1,2,3]

print(a is b)
o/p = False

print(a is not b)
o/p = True

##Membership Operator

x = "Delhi"

print("D" in x)
o/p = True

print ("D" not in x)
o/p = False

x = [1,2,3]
print(5 in x)
o/p = False
Understanding Basics of Swift
Tags: swift
Published: 2023-08-14 01:45:06

Swift is a powerful and intuitive programming language developed by Apple for iOS, macOS, watchOS, and tvOS app development. It's designed to give developers more freedom than ever before. Swift is easy to use and open source, so anyone with an idea can create something incredible.

## Introduction to Swift
Swift was introduced at Apple's 2014 Worldwide Developers Conference (WWDC) to provide a safer, faster, and more expressive means for iOS and OS X app development. It was designed to be easy to learn and use, even if you've never coded before. Swift is a statically typed language, which means the code is checked for errors before it's run, making it easier to catch and fix errors.

## Swift vs Other Languages
Swift is often compared to other programming languages like Objective-C, Python, and Java. While Objective-C is robust and enables highly dynamic runtime, Swift is safer and requires less code, making it easier for new developers to pick up.

Compared to Python, another beginner-friendly language, Swift is faster and safer, thanks to its static typing and error handling. However, Python has a more extensive standard library.

Java, used for Android app development, is verbose compared to Swift. Swift's syntax is cleaner and less prone to errors, thanks to its strong typing and optionals.

## Swift Syntax
Swift's syntax is clear and concise, making it easy to read and write. Here are some basics:

Variables are declared using the var keyword, and constants using the let keyword.
Every statement doesn't need to end with a semicolon (;), unless multiple statements are written in a single line.
Parentheses are not required around the conditional in if or loop statements.
Swift uses String Interpolation to include variables and constants inside a string.
## Variables and Constants
In Swift, variables are mutable, meaning their value can be changed after they're set, while constants are immutable, meaning their value cannot be changed after it's set. Here's how you declare them:
```swift
var myVariable = 42
myVariable = 50
let myConstant = 42
```
## Data Types
Swift has a strong type system, and provides a variety of data types. Here are some of the basic ones:

- Int or Integer: A whole number, positive or negative.
- Double and Float: Used for holding fractional or floating-point numbers.
- Bool: Represents a true or false value.
- String: Used for holding a series of characters, like "hello".
- Array: An ordered list of items.
- Dictionary: An unordered collection of key-value pairs.
- Set: An unordered collection of unique items.
By understanding these basics of Swift, you've taken your first step into the world of iOS app development. In the next unit, we'll dive deeper into control flow and functions in Swift.
A Beginner's Guide to Running a GoLang Project: Essential Steps
Tags: go, backenddevelopment, github
Published: 2023-08-23 04:55:19

**Your first project**

**
Introduction**

This chapter will cover:

1. **Creating a project.
2. Organize your files.**

**Module use cases**

There are two interesting use cases with modules:

Consuming a module, you will use a combination of core modules and external 3rd party modules
Creating a module, in some cases you will create code that you or someone else will be able to use. For this scenario, you can create a module and upload it to GitHub.
**Consume internal files**
You want to split up your app in many different files. Let’s say you have the following files:



```
/app
  main.go
  /helper
    helper.go 
```

What you are saying above is that your program consists of many files and that you want code in the fiile main.go to use code from helper.go for example.

To handle such a case, you need the following:

a project. By creating a project, you create a top-level reference that you can use in the import directive.
an import that points to the project root name as well as the path to the module you want to import.
You can use go mod init, this will initialize your project.

**Creating a project**
To create a project, you run go mod init and a name for a project, for example, “my-project”:

  

```
 go mod init my-project
```
You end up with a `go.mod` file looking something like so:

  

```
 module my-project

   go 1.16
```
The go.mod file tells you the name of your project and the currently used version of Go. It can contain other things as well like libraries you are dependent on.

**The import statement**
Imagine now we have this file structure in our project:

```
/app
  main.go
  /helper
    helper.go 
```
with helper.go looking like so:

```
package helper
    
import "fmt"

func Help() {
  fmt.Println("This is a helper function")
}
```
to use the public `Helper()` function from main.go, we need to import it.

In main.go we need an import statement like so:

```
import (
  "my-project/helper"
)
```
We are now able to invoke the `Help()` function from main.go like so:

```
helper.Help()
```
**Assignment - create a project**

In this assignment, you will create a project.

Create a project like so:

 

```
go mod init my-project
```
create the helper directory and `helper.go` file and give it the following content:

 

```
// helper.go
    
 package helper
    
 import "fmt"
    
 func Help() {
  fmt.Println("This is a helper function")
 }
```
Create the `main.go` file and give it the following content:

```
package main

import (
  "my-project/helper"
)
    
func main() {
  helper.Help()
}
```
Note this import `"my-project/helper"`, it ensures the helper package is in scope.

**Compile and run**



```
go run main.go
```

**Solution**

```
helper/helper.go

package helper

import "fmt"

func Help() {
 fmt.Println("help")
}
```
**main.go**

```
package main

import "my-project/helper"

func main() {
 helper.Help()
}
```
**Challenge**
See if you can create another function in helper.go, this time, make the function name lowercase, what happens if you try to import it?
credit github.io
Top IAS/UPSC Coaching Center In Newtown, Kolkata
Tags: ias, academy, upsc, kolkata
Published: 2023-08-23 04:50:21

ASPIRATION IAS ACADEMY brings out your best through proper training. The goal of ASPIATION IAS ACADEMY is to build your personality fit for being an IAS & WBCS Officer. The VISION of ASPIRATION IAS ACADEMY is to make you realize your potential through imparting proper training on what to do and when, things relevant to [UPSC’s CIVIL SERVICE EXAMINATION & WBCS EXAMINATION](https://www.aspirationias.in).  The central focus of the ACADEMY is to STRIVE TO ACHIEVE THE GOAL. ASPIRATION IAS ACADEMY concentrates on the present to make your FUTURE BRIGHT. Call us today and book your seat now (+91) 8051005800
Unveiling AnalogJS: Crafting Angular Applications with a Fullstack Meta-Framework
Tags: javascript, discuss, frontend, angular
Published: 2023-08-23 04:18:17

## Analog is a meta-framework for building applications and websites with Angular.

Similar to other meta-frameworks such as Next.JS, Nuxt, SvelteKit and others, Analog provides a similar experience, building on top of Angular created by [brandontroberts](https://twitter.com/brandontroberts).

Are you an Angular enthusiast who's always on the lookout for cutting-edge tools to enhance your development process? Look no further! We're excited to introduce you to AnalogJS, a groundbreaking fullstack meta-framework designed to transform your Angular app-building journey.

## Why AnalogJS?

Picture a world where you can seamlessly combine the power of Angular with the ease of use provided by meta-frameworks like Next.js and Nuxt.js. AnalogJS does just that - it marries the versatility of Angular with the efficiency of a meta-framework, creating a developer-friendly ecosystem that accelerates your project development.

## Documentation
Visit the docs at [https://analogjs.org](https://analogjs.org)

## Features
- Supports Vite/Vitest/Playwright
- File-based routing
- Support for using markdown as content routes
- Support for API/server routes
- Hybrid SSR/SSG support
- Supports Angular CLI or Nx workspaces

## Getting Started
Use your package manager of choice to create a new project

**With yarn:**
```
yarn create analog
```

**With npm:**

```
npm init analog
```

Follow the prompts to scaffold the project and start the development server.

Elevate your Angular experience with AnalogJS - where Angular meets meta-framework magic!

**Creator: **
https://dev.to/brandontroberts
Prisma Benchmark For Simple Queries
Published: 2023-08-23 04:06:23

I just want to share my findings. It seems that prisma has been under flak by some people in the community because of its performance. I think that Prisma 5 has fixed that problem so that it is acceptable on most use cases.

I tried using kysely with postgres.js as the dialect, and also directly using postgres.js to try and get a benchmark.  

Task: Get a user id
Prisma Code:
```
const result = await prisma.user.findUnique({
  select: { id: true },
  where: { id }
})
```

Postgres.js (Raw SQL):
```
const result2 = await sql`
  SELECT id FROM "user" u WHERE u.id = ${id}
`
```
Test Setup: PostgreSQL DB server hosted at a 4vcpu digitalocean k8s. Request made from Laptop so latency is a factor

Results after ~500x Test
```
prisma results 496x 95.96370967741936 ms
postgres results 496x 92.21774193548387 ms
```

Conclusion (For Now): Prisma is not that slow for simple tasks. I might try to do another benchmark for more complex task later on
Hosting static websites with versioning for free
Tags: pebl, react, svelte, angular
Published: 2023-08-23 03:58:35

Pebl is a cloud computer.

It is the first cloud platform that meets developers where they are the most comfortable — code. No more configs. Just embed the cloud right into your application with pebl's cloud SDK.

We just released [pebl v0.1.2](https://blog.pebl.io/release-13) which includes support for versioned folders. This makes it super easy to host static websites with versioning, meaning that you can quickly rollback to previous versions of your website!

This should only take you about five minutes. If you run into any issues, hop on our [discord](https://discord.gg/qV67JnJMZZ) to ask for help.

## Setup

We will be continuing from our first guide where we [configured static web hosting with pebl](https://dev.to/pebl/host-your-react-angular-svelte-or-any-other-framework-for-free-with-pebl-5bl1). Follow the tutorial before continuing.

## Versioning

The new release of pebl will automatically version your folders.

```
$ pebl folder upload build static
 :: uploading folder as name static
 :: success! the new uploaded version is: coawer
$
```

And we can reference these versions directly in `mount`:

```javascript
await pebl.mount("static:coawer", "/static");
```

Note that you can leave the version out of the name like we had done previously. In this case the latest version of the folder will be chosen.

## Making a Change

Go ahead and make a modification to your website. In our example, we are using the react starter. The react start page displays the react logo that rotates clockwise. We'll make a small change so that it goes the other way.

```
$ cd project-folder/my-app
$ cat src/App.css
...
@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg); // <-- this line has changed
  }
}
$
```

Now let's build and upload, just like before.

```
$ cd project-folder/my-app
$ npm run build
$ pebl folder upload build static
```

Then re-deploy our existing node server:

```
$ cd project-folder/server
$ pebl deploy
```

Now when you visit your website, you should see the change reflected.

## Rolling Back

But sometimes we need to rollback our changes! Maybe it turns out the react logo was meant to turn clockwise after all.

Here we can use the pebl cli to list the available versions:

```
$ pebl folder list static
NAME
static:coawer
static:dtzmoj
```

These are sorted by time, which means we can reference `static:dtzmoj` in order to rollback our website.

Update your `index.js` like so:

```
import express from "express";
import * as pebl from "pebl";

// reference static:dtzmoj to rollback!
await pebl.mount("static:dtzmoj", "/static");

const app = express();

app.use(express.static("/static"));
app.get('/*', function (req, res) {
  res.sendFile("/static/index.html");
});

pebl.service(app, "your-subdomain.pebl.rocks");
```

And once you deploy this with `pebl deploy`, you will see the old version!

### Next

We have a ton of [guides](https://docs.pebl.io/category/guides) for how to use pebl. And make sure to join our [discord](https://discord.gg/qV67JnJMZZ)!
Career Journey
Tags: personal, career
Published: 2023-08-23 03:56:58



## Recap
My last post here is that I was having my 2020 [goals](https://dev.to/marcobustillo/my-2020-goals-2g8j). Unfortunately I wasn't able to accomplish most of the stuff written there. My life went to another direction after that time.

## What happened
After working on one of those goals, A lot has happened from moving to teams to going to a new company

**2020-2021:** During this time the company I was part of re-shuffled the team. Instead of having the time to work on those goals I needed to be accustomed to the team: New standards, practices, and principles. It was also the reason why I have left the company. I was unhappy with the change.
From having a freedom to follow a day to day process. I was not also happy of always having a buy mindset first before building. I felt like I wasn't valuable anymore to the company/team.

**2021-2022:** This new work I had was a shock to me. Because I needed to report to a client. From having a consistent team to needing to change clients every month or so. At first I was anxious about it because I wasn't a great communicator but over the course of months I got used to it and became a better communicator. On top of that I have the opportunity to use different types of technologies (ohh shiny new toys). I have also felt that I became a better developer I experienced a lot of new challenges and problems that I know for sure that I won't experience if I have sticked to a product based company.

**2022-Present**
A new year a new me. I always wanted to try out doing DevOps so I asked to shift my career from Software Development to DevOps. I was happy with the move I learned a lot and I felt It made me a better software engineer. I learned a lot of the Ops side and it opened my eyes on how valuable knowing that stuff for a software engineer. But it is not always a happy time. For the first 6 months I struggled. Learning about networking, cloud design patterns, and cloud architecture it was a daunting task but I managed to pull through. Gotten a lot of azure certifications and will try to have more. If there's somebody who will ask me for advice moving from software development to DevOps. You will need to be prepared for the steep learning curve ahead! It is not impossible to do and having a developer background already puts you ahead of other people coming from other domain.

## To the future!
Now even though I am quite happy with my current role I am still doing development. In my free time instead of studying about DevOps or tools relating to it I always see my self doing development projects. Maybe on my next update ill be a developer but who knows.


**Credits**:
Cover photo: https://dribbble.com/allyreevessays
Image resize: https://www.kapwing.com/tools/resize/gif