teleren/devto huggingface dataset:
Using Notion as a CMS for a blog for free
Published: 2023-01-21 03:24:33

## Why to use Notion as your CMS?

[Notion](https://notion.so) is a great tool for writing. It supports markdown, images, layouts, videos, embeds, bookmarks, tables and databases. It’s like the modern day Microsoft Word.

I recently started my [blog](https://codingchronicles.adityakarad.com/), and coded it myself. But I soon realised that my CMS lacked many features that Notion had. So I decided to use Notion as my CMS. 

## Solution

I searched online for solutions and found the following Github repository. It allows direct deployment of a Website to any cloud providers like Heroku, Vercel, Netlify and many others.

[https://github.com/craigary/nobelium](https://github.com/craigary/nobelium)

Using this repository, I was able to create a [blog](https://codingchronicles.adityakarad.com/) and deploy it to Vercel.

You don’t need any NextJS experience to do it yourself (because I myself don’t know NextJS!). Just follow the README file steps and you can set it up yourself!
Easy Drupal 10 multi-site setup with DDEV
Tags: beginners, tutorial, webdev, php
Published: 2023-01-21 03:07:57

If you've struggled to setup a multi-site Drupal install then follow along to get started in minutes!

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

Credit goes to Aastha! I followed her wonderful tutorial at https://dev.to/shriaas2898/setting-up-drupal9-multi-site-with-ddev-2f22

## Prerequisites

* [Install Drupal 10 in 5 minutes](https://youtu.be/pYCZixiXX2U)
* [DDEV](https://ddev.readthedocs.io/en/stable/)
Sign in/Sign out
Published: 2023-01-21 00:24:39

In the nav bar, paste the following to create sign in/sign out functionality:

    <ul class="navbar-nav">
      <% if user_signed_in? %>
        <li class="nav-item">
          <%= link_to "Edit profile", edit_user_registration_path, class: "nav-link" %>
        </li>

        <li class="nav-item">
          <%= link_to "Sign out", destroy_user_session_path, class: "nav-link", method: :delete %>
        </li>
      <% else %>
        <li class="nav-item">
          <%= link_to "Sign in", new_user_session_path, class: "nav-link" %>
        </li>

        <li class="nav-item">
          <%= link_to "Sign up", new_user_registration_path, class: "nav-link" %>
        </li>
      <% end %>
    </ul>

To enforce sign in/out, we add a before action in ApplicationController:

1. Add: "before_action :authenticate_user!"
Best Web Development Practice
Tags: webdev, programming, beginners, javascript
Published: 2023-01-21 01:10:07

**¡Hi World! Soy Luciano Villalba "Yisus".** 

En este blog, quiero compartir con ustedes lo que, en mi opinión, son las mejores prácticas y herramientas en el desarrollo web.


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

---

1. En primer lugar, es importante tener una buena comprensión de los fundamentos del desarrollo web, como HTML, CSS y JavaScript. Estos son los pilares básicos sobre los que se construyen todas las páginas web y aplicaciones web. Es esencial estar al día con las últimas tendencias y mejores prácticas en estas tecnologías para crear sitios web y aplicaciones atractivas, accesibles y eficientes.
 
2. En segundo lugar, es importante elegir un marco de desarrollo web adecuado para su proyecto. Actualmente existen muchos marcos populares, como Angular, React y Vue.js, cada uno con sus propias ventajas y desventajas. Es importante evaluar cuidadosamente qué marco es el mejor para su proyecto en función de sus requisitos específicos.
 
3. Otra herramienta esencial en el desarrollo web es un buen sistema de control de versiones, como Git. Git permite a los desarrolladores colaborar y controlar cambios en el código de manera eficiente, lo que es esencial para proyectos de equipo.
 
4. Por último, pero no menos importante, es importante tener en cuenta la optimización de rendimiento en el desarrollo web. Esto incluye la optimización del código, la optimización de imágenes y la optimización de la velocidad de la página. Esto ayudará a asegurar que su sitio web o aplicación sea rápido y fácil de usar para los visitantes.



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

_En resumen, el desarrollo web es un campo en constante evolución, y es importante estar al día con las últimas tendencias y herramientas. Al comprender los fundamentos, elegir el marco adecuado, utilizar un sistema de control de versiones y optimizar el rendimiento, los desarrolladores pueden crear sitios web y aplicaciones impresionantes que ofrecen una excelente experiencia al usuario._

¡Gracias por leer!
Notice and Alerts
Published: 2023-01-21 01:06:14

Create 2 partials for notices and alerts:

<div class="alert alert-success alert-dismissible fade show" role="alert">
  <%= notice %>
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

<div class="alert alert-danger alert-dismissible fade show" role="alert">
  <%= alert %>
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

We can also create a single partial and pass in the css_class:

<div class="alert alert-<%= css_class %> alert-dismissible fade show" role="alert">
  <%= message %>
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

Logic in Application Layout:

      <% if notice.present? %>
        <%= render "shared/flash", message: notice, css_class: "success" %>
      <% end %>

      <% if alert.present? %>
        <%= render "shared/flash", message: alert, css_class: "danger" %>
      <% end %>
Choosing a path
Tags: opensource
Published: 2023-01-21 00:58:36

As I look to the semester ahead I am petrified. Part of it is that I have to get used to Telescope and even just getting it running locally takes a while since I have to start WSL, Docker and the containers, that's before actually learning how to work with it or getting started trying to navigate testing or debugging or anything like that, the other part is that I really don't know that much in general but that's ok since I have a few places to start, although I guess that too is kind of overwhelming.

When looking at the starchart project, which I don't think will be called starchart but that's what we have been calling it so far, I have decided that I want to work on a bit of everything, to start I particularly want to take a look at something that is new to me and that I have bumbled my way through a short presentation on and that is authentication using the [SAML protocol](https://github.com/Seneca-CDOT/starchart/wiki/SAML2-and-SSO).

There are a few places to start with this, one is that we have an [issue in Telescope](https://github.com/Seneca-CDOT/telescope/issues/3567) that relates to what I think is the session no longer existing in certain situations that results in a 400. This will give me an opportunity to take a look at Telescopes auth flow. I still am kind of unfamiliar with Telescope despite having been in the last OSD course. I know that we use passport SAML in Telescope however and in the new project we will use a different library called [SAMLIFY](https://samlify.js.org/#/?id=samlify).

Another starting point is right there, Samlify docs. Further than that David found a perfect example for our tech stack where someone has made an example implementation of SAMLIFY with REMIX [here](https://github.com/christopherpickering/remix-saml-authentication). So taking a look at these things would be a start.

Also reading up on the rest of the tech stack would be smart as well. It's all overwhelming up-front but I think will become normal as we go.
Difference Between Responsive Design and Adaptive Design
Tags: webdev, design, css
Published: 2023-01-21 00:58:25

As a frontend developer or UI designer, this is definitely one of the most asked questions according to [Java Point](https://www.javatpoint.com/front-end-developer-interview-questions). 

Responsive design and adaptive design are both methods used to make a website or application look and function well on different devices with different screen sizes and resolutions. However, they work in slightly different ways.

### Responsive design
Responsive design is a design approach that uses flexible grid-based layout, flexible images, and CSS media queries to make a website or application automatically adjust its layout and elements to fit the screen on which it's being viewed. In other words, the layout and elements of the website or application change based on the screen size and resolution, so it looks and functions well on any device.

### Adaptive design
Adaptive design is a design approach that uses a set of pre-designed layouts for specific screen sizes and resolutions. These layouts are called "breakpoints" and the website or application switches to a different layout based on the screen size and resolution. In other words, the layout and elements of the website or application are fixed for specific screen sizes and resolutions. E.g. creating several image file sizes to carter for different screen sizes.

### In summary:

- Responsive design is a fluid and flexible approach that adapts to different devices using a single codebase.

- Adaptive design is a more rigid approach that uses different layouts for specific devices with different codebase.

Both approaches have their own advantages and disadvantages, but responsive design is considered more popular and flexible for modern web development.
Bootstrap Setup
Published: 2023-01-21 00:23:52

1. Remove scaffold css from assets folder

2. In the shared folder, create a file called "_cdn_assets.html.erb"

3. Add bootstrap to the cdn assets file.

<!-- Expand the number of characters we can use in the document beyond basic ASCII 🎉 -->
<meta charset="utf-8">

<!-- Make it responsive -->
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Connect Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

<!-- Connect Bootstrap JavaScript and its dependencies -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>

<!-- Connect Font Awesome -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/js/all.min.js"></script>

4. Render "shared/cdn_assets" in the head of the application.html.erb file
«Yo88» Game bài đổi thưởng tiền thật, thẻ cào Uy tín nhất 2023
Published: 2023-01-21 00:51:55

https://yo88b.vin/ Yo88 Cổng game bài đổi thưởng uy tín nhất việt nam✔️Trang chính thức go88✔️Đa dạng thể loại tài xỉu, bắn cá, quay hũ✔️✔️✔️
https://heylink.me/yo88b/
https://boosty.to/yo88b
https://pbase.com/yo88b/yo88b
https://velog.io/@yo88b
OpenAI CEO on AI
Tags: ai, career, news, techtalks
Published: 2023-01-21 00:36:20

Here's what happened. Sam Altman gave a great interview. 

{% embed https://twitter.com/DrJimFan/status/1616451065016209409?s=20&t=6M6uWNCR26UkbHn2VIIVXg %}


It's actually in two parts that are both 1 hour long (link to original 2 parts below). Following the interview, I thought it would be so cool to jot down a few notes. So I started wondering if I could scrape all the transcripts, analyze them, and select some golden nuggets using **AI tools**. Apparently, it was easier than I thought, and I even converted it into a short video!


## Part 1

link - [https://www.youtube.com/watch?v=57OU18cogJI](https://www.youtube.com/watch?v=57OU18cogJI)

## Part 2

link - [https://www.youtube.com/watch?v=ebjkD1Om4uw](https://www.youtube.com/watch?v=ebjkD1Om4uw)

8:33 
> that's not great from a business standpoint - that's fine we'll be fine"

- My comment here about this democratic access to AI, I really hope it's not a Nikola Tesla and JP Morgan moment

16:10
> This is an unbelievable personal tutor for each kid and [...] I have used it to learn things myself and found it like much more compelling than other ways I've learned things in the past. I would much rather have ChatGPT teaching me about something than go read a textbook"

17:10
> I would caution policy National policy individual schools or whatever from relying on this um because I don't like fundamentally I think it's impossible to make it perfect you'll think you know people will figure out how much of the text they have to change there will be other things that modify the outputted text"

29:00 
> “ I think whenever someone like talks about a technology being the end of some other giant company it's usually wrong like I think people forget they get to make a counter move here” …
“I do think it me there is a change for search that will probably come at some point”


29:30
> “I think we should as AGI participates more and more in the economy I think we should distribute wealth “

31:10
> “my son's teacher was trying to prepare them but of course you would maybe be better positioned to have some ideas on this um resilience adaptability ability to like learn new things quickly uh creativity although it'll be aided creativity and innated learning things quickly“


> before Google came along um there was like a bunch of things that we learned uh like memorizing facts was really important and that changed and now I think learning will change again and will probably adapt faster than we think


31:33
> learning will change again and will probably adapt faster than we think


38:40
> I would not ignore it I think you've got to like embrace it big time but uh I think the amount of value that's about to get created we have not seen like since the launch of the iPhone app store


Godspeed

PS. Follow me on Elon's Twitter. 
[https://twitter.com/dom_sipowicz](https://twitter.com/dom_sipowicz)

{% embed https://twitter.com/dom_sipowicz %}
O que é DAST?
Tags: veracode, beginners, tutorial, security
Published: 2023-01-21 00:35:08

O conjunto de ferramentas de análise dinâmica da Veracode faz parte de uma plataforma integrada de segurança de aplicativos. 
O mecanismo interativo de análise dinâmica utiliza métodos de ataque do mundo real seguros para a produção para revelar a segurança do aplicativo e as vulnerabilidades baseadas em configuração que só podem ser encontradas com uma verificação do ambiente em tempo de execução. Com a capacidade de escanear e testar milhares de aplicativos da Web e APIs simultaneamente, fornecendo orientação abrangente de correção e menos de 5% de taxa de falsos positivos, os clientes podem perceber com precisão e reduzir rapidamente as vulnerabilidades comprovadamente exploráveis.

A análise dinâmica é uma parte crítica de qualquer programa de segurança de aplicativos – ajudando as equipes de segurança e os desenvolvedores.

**Por que há necessidade de análise dinâmica?**
Em um mundo de “Shift Left”, ainda há muita necessidade de continuar a encontrar vulnerabilidades conforme elas existem em tempo de execução.

A varredura dinâmica aproveita e é executada no ambiente de tempo de execução. Isso significa escanear e testar o código enquanto ele roda “ao vivo”. Ela não se aprofunda nas idiossincrasias das linguagens subjacentes, mas encontra vulnerabilidades na execução e na interface do código.

No gráfico abaixo, observe os principais tipos de vulnerabilidades aqui. Eles geralmente não se sobrepõem aos resultados da análise estática. As configurações do servidor e o vazamento de informações foram consistentemente as principais categorias de falhas (vulnerabilidades) encontradas em todas as linguagens subjacentes. As vulnerabilidades eram tão consistentes entre as linguagens que não mostramos essas diferenças em nosso próprio Relatório de estado de segurança de software, v12, 2022. Esses tipos de vulnerabilidades não podem ser descobertos executando verificações estáticas ou SCA.

Vulnerabilidades encontradas por uma varredura dinâmica independentemente da linguagem:
![Grafico linguagens](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnyw8a95l5njpq85dpgu.jpg)
4. Even Powers of 2 (Second Solution)
Tags: csharp, softuni, forloop, lab
Published: 2023-01-21 00:29:14

```cs
using System;
using System.Diagnostics.Tracing;

namespace EvenPowersOf_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            for (int power = 0; power <= n; power += 2)
            {
                Console.WriteLine(Math.Pow(2, power));
            }


        }
    }
}

```
4. Even Powers of 2 (First Solution)
Tags: csharp, softuni, forloop, lab
Published: 2023-01-21 00:22:55

```cs
using System;
using System.Diagnostics.Tracing;

namespace EvenPowersOf_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            for (int power =  0; power <= n; power++)
            {
                if (power % 2 == 0)
                {
                    Console.WriteLine(Math.Pow(2, power));
                }
            }

            
        }
    }
}

```
Using conditional breakpoints
Published: 2023-03-24 08:30:30

---
title: Using conditional breakpoints
published: true
date: 2023-01-21 00:00:00 UTC
tags: 
canonical_url: https://karas.codes/posts/using-conditional-breakpoints/
---

This post would cover another tip that could make debugging process way easier. Imagine that we have registered a listener for some browser API, and we want to test how it works. Sometimes our normal break point won’t stop the code execution. That’s why we could use **conditional breakpoints**.

# What’s conditional breakpoint?

It’s just line of code marked as normal breakpoint, but with additional condition applied. Thanks to that approach our code will stop there only if condition would be fulfilled. Take a look at example shown below.

![Scenario 1: Across columns](https://karas.codes/conditional_breakpoint.png)

Also in multithreaded languages e.g. like Java we could decide whether stop all threads or only one that is executing code for given class.

# When we should use it?

We could use conditional breakpoints when:

- we want to filter out breakpoints we don’t want to observe that time
- we want to stop the code only in some specific cases
- to make sure that breakpoint for event listener would stop the code execution
1. Numbers From 1 To 100
Tags: csharp, softuni, forloop, lab
Published: 2023-01-20 23:53:39

```cs
using System;

namespace Numbers_From_1_To_100
{
internal class Program
{
    static void Main(string[] args)
    {
        for (int numbers = 1; numbers <= 100; numbers++)
        {
            Console.WriteLine(numbers);
        }
    }
}
}
```
3. Numbers 1...N with Step 3 (Simple Solution)
Tags: csharp, softuni, forloop, lab
Published: 2023-01-20 23:55:06

```cs
using System;

namespace Numbers_1_N_WithStep_3
{
internal class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());

        for (int number = 1; number <= n; number += 3)
        {
            Console.WriteLine(number);
        }
    }
}
}
```
2. Numbers N...1 - (Newer Solution)
Tags: csharp, softuni, forloop, lab
Published: 2023-01-20 23:54:32

```cs
using System;

namespace Numbers_N_1
{
internal class Program
{
    static void Main(string[] args)
    {
        for (int number = int.Parse(Console.ReadLine()); number >= 1; number--)
        {
            Console.WriteLine(number);
        }
    }
}
}
```
2. Numbers N...1 - (Simple Solution)
Tags: csharp, softuni, forloop, lab
Published: 2023-01-20 23:54:08

```cs
using System;

namespace Numbers_N_1
{
internal class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());

        for (int number = n; number >= 1; number--)
        {
            Console.WriteLine(number);
        }
    }
}
}
```
09. Ski Trip
Tags: csharp, softuni, conditionalstatementsadvanced, exercise
Published: 2023-01-20 23:52:57

```cs
using System;

namespace SkiTrip
{
internal class Program
{
    static void Main(string[] args)
    {
        int stayDays = int.Parse(Console.ReadLine());
        string placeType = Console.ReadLine();
        string rating = Console.ReadLine();

        double pricePerNight = 0.00;
        stayDays = stayDays - 1; // Minus one (1) because it's per night

        // The price discount for each room type
        if (placeType == "room for one person")
        {
            pricePerNight = stayDays * 18.00;

        }
        else if (placeType == "apartment")
        {
            pricePerNight = stayDays * 25.00;

            if (stayDays > 15)
            {
                pricePerNight -= pricePerNight * 0.50;
            }
            else if (stayDays >= 10 && stayDays <= 15)
            {
                pricePerNight -= pricePerNight * 0.35;
            }
            else if (stayDays < 10)
            {
                pricePerNight -= pricePerNight * 0.30;
            }
        }
        else if (placeType == "president apartment")
        {
            pricePerNight = stayDays * 35.00;

            if (stayDays > 15)
            {
                pricePerNight -= pricePerNight * 0.20;
            }
            else if (stayDays >= 10 && stayDays <= 15)
            {
                pricePerNight -= pricePerNight * 0.15;
            }
            else if (stayDays < 10)
            {
                pricePerNight -= pricePerNight * 0.10;
            }
        }

        // The rise and fall depends by the user's rating
        if (rating == "positive")
        {
            pricePerNight += pricePerNight * 0.25;
        }
        else if (rating == "negative")
        {
            pricePerNight -= pricePerNight * 0.10;
        }

        Console.WriteLine($"{pricePerNight:F2}");
    }
}
}
```
08. On Time fore the Exam
Tags: csharp, softuni, conditionalstatementsadvanced, exercise
Published: 2023-01-20 23:52:03

```cs
using System;

namespace OnTimeForTheExam
{
internal class Program
{
    static void Main(string[] args)
    {
        int examHour = int.Parse(Console.ReadLine());
        int examMinutes = int.Parse(Console.ReadLine());
        int arrivalHours = int.Parse(Console.ReadLine());
        int arrivalMinutes = int.Parse(Console.ReadLine());


        int examTime = examHour * 60 + examMinutes;
        int arrivalTime = arrivalHours * 60 + arrivalMinutes;

        int difference = arrivalTime - examTime;
        int differenceHours = Math.Abs(difference / 60);
        int differenceMinutes = Math.Abs(difference) - differenceHours * 60;


        if (difference > 0)
        {
            Console.WriteLine("Late");

            if (difference >= 60)
            {
                Console.WriteLine($"{Math.Abs(differenceHours)}:{Math.Abs(differenceMinutes):00} hours after the start"); // More than hour
            }
            else if (difference < 60)
            {
                Console.WriteLine($"{Math.Abs(differenceMinutes)} minutes after the start");
            }
        }
        else if (difference <= 0 && difference >= -30)
        {
            if (difference == 0)
            {
                Console.WriteLine("On Time");
            }
            else
            {
                Console.WriteLine("On time");
                Console.WriteLine($"{Math.Abs(differenceMinutes)} minutes before the start");
            }
        }
        else if (difference < -30)
        {
            Console.WriteLine("Early");

            if (difference < -30 && difference > -60)
            {
                Console.WriteLine($"{Math.Abs(differenceMinutes)} minutes before the start");
            }
            else
 
            {
                Console.WriteLine($"{Math.Abs(differenceHours)}:{Math.Abs(differenceMinutes):00} hours before the start");
            }
        }
    }
}
}
```