teleren/devto huggingface dataset:
Add custom CSS to Rails app with Bootstrap
Tags: rails, ruby, webdev, bootstrap
Published: 2022-03-04 14:30:13

###Quick Rails tip for beginners

I'm using Rails 7 with Bootstrap 5. [Here's a nice tutorial](https://www.bootrails.com/blog/rails-7-bootstrap-5-tutorial/) on how to generate a Rails 7 app with Bootstrap 5.

Say that you want to add custom CSS files in your Rails app. Here are the steps that worked for me:

- Place your CSS file in `app/assets/stylesheets` folder
- Reference the file in `app/assets/stylesheets/application.bootstrap.scss`

It should look like this:

```
//= link_tree ../images
//= link_tree ../builds
//= link my_custom.css
```
- Now you have to put the following line inside the `<head>` tag in the `app/layouts/application.html.erb` :

```
<%= stylesheet_link_tag "navbar", media: 'all', 'data-turbolinks-track' => true %>
```

And that's it. You don't even need to restart the server jut refresh the page. If you want to make sure the CSS file has been recognized/loaded, you can inspect the page and look for the loaded resources.

_Disclaimer: I'm learning Rails as I go so improvement suggestions are welcomed_
Prerelease 2.6
Published: 2022-02-06 22:39:16

Version 2.6 is coming soon. I have been working on the tests for the [search](https://github.com/Seneca-CDOT/telescope/tree/master/src/api/search) function for Telescope.

At first it sounded like a simple task, but when I start to dig into the problem it was getting a lot more difficult. The simplest thing that I did was to setup the initial setup for the tests. [Issue-2757](https://github.com/Seneca-CDOT/telescope/commit/9cfc73ab1a52b47fd8c0261ddca4b68aa1f9df6c). Even that had some problems. I thought the config setup was correct but later found out that the configuration was not properly setup even tho the test can still work fine. This was because when we ran the `jest` command to run our test, the command included the setup config. We don't want that because different not all test will need the same setup.

```JS
Before:
 "jest": "cross-env NODE_ENV=test LOG_LEVEL=error MOCK_REDIS=1 FEED_URL_INTERVAL_MS=200 jest -c jest.config.js --",
After:
"jest": "cross-env LOG_LEVEL=error jest -c jest.config.js --",
```
With this change, each test can use their correct config file. After that, in the `jest.config.js` for the search. I would need to add the proper setting so like so: 
```JS
const baseConfig = require('../../../jest.config.base');

module.exports = {
  ...baseConfig,
  rootDir: '../../..',
  setupFiles: ['<rootDir>/src/api/search/jest.setup.js'],
  testMatch: ['<rootDir>/src/api/search/test/*.test.js'],
  collectCoverageFrom: ['<rootDir>/src.api/search/src/**/*.js'],
};
```

The `jest.setup.js` is in the same directory as the `jest.config.js`. All it does is to set a mock Elastic to 1(true).

Once that is all setup, I can create my test file. If I do not create a test, Jest will throw an error when every we try to run the test command. So what I add was a simple test to test out if it can return error `400`. 
```JS
const request = require('supertest');
const { app } = require('../src');

describe('/query routers', () => {
  it('return error 400 if no params given', async () => {
    const res = await request(app).get('/');
    expect(res.status).toBe(400);
  });
});```

I know this will always be true because the connection to a mock elastic was not created. My next step would be trying to understand how we can create the connection to a mock elastic and dummy data.
Figma and GitHub Thumbnail Generator ✨
Tags: productivity, showdev, tooling, design
Published: 2022-03-04 14:04:26

## Hey friends, does your Figma projects look like this? 🤮
Well, this look is usually common for busy designers.
![Messy Figma Project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85b0a9njbbqpemr49vzt.png)

<br>
## That's why I built Figpeek ✨

I've built this tool called Figpeek that generates a Figma thumbnail for designers to improve their workflow and organize their projects. This tool also fits in GitHub repositories! 🤯
<br>
## What is Figpeek?
Figpeek is a new Figma and GitHub thumbnail generator. With Figpeek you can create and experiment your own thumbnail with ease.
<br>
## Figma projects with Figpeek

 ![Organize Projects](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oc9kixkiqxgtvdqb871c.png)
You can organize your projects with thumbnail that you created on Figpeek. Try it now at [figpeek.xyz](https://figpeek.xyz/?ref=dev.to) ✨
What is GitLab Registry? | GitLab Pipeline | GitLab Tutorial For Beginners | Part VII
Tags: git, devops, tutorial, cicd
Published: 2022-03-04 13:54:50

{% youtube XHni0-07YQU %}


Learn what is GitLab registry, and the various registries in GitLab. [Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

In this part of GitLab Tutorial for Beginners, Moss(@tech_with_moss), an expert in DevOps and CI/CD tools, introduces you to some additional features of GitLab pipelines. He majorly focuses on packaging and releasing features. First, you will learn what are GitLab releases, what are GitLab package containers and infrastructure registries, followed by the steps on how to write a GitLab pipeline. By the end of this video, you will be able to deploy artifacts from a GitLab pipeline to the GitLab package registry.

Also, learn -:⛳
🔸 What is the GitLab container registry?
🔸 What is the GitLab package registry?
🔸 What is the GitLab infrastructure registry?


Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.
Bug Pattern: Ignoring the default case
Published: 2022-03-04 13:54:03

I'm going to be writing up bug patterns as I see them, as a bit of a personal learning project. When I create bugs, what caused me to create them?

This first one I'm going to call **Ignoring the default**. Imagine this scenario:

- You find a tricky bug
- You spend a while debugging it
- Aha! You finally find the problem. Fix it. You test the reproduction case. You ship the fix.
- Time elapses.
- A very common case in your application isn't working correctly.

I did this yesterday. What was the problem? I ignored the default case. I got so focused on fixing the error case that I forgot to test the default case and rushed to shipping the fix.

This actually came up due to two issues:

- I ignored the default case when I was preparing the fix.
- My test coverage didn't cover the default case.

In this particular situation I'm not sure a test for the default case would have made that much sense, but still. **I ignored the default case.**
How To Migrate From Jenkins Pipeline To GitLab CI | GitLab Tutorial For Beginners | Part VI
Tags: git, devops, tutorial, cicd
Published: 2022-03-04 13:51:34

{% youtube tCsYHiMpbHY %}


Learn how to use GitLab CI features to convert Jenkins Pipeline into GitLab CI pipeline.
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

In this part of GitLab Tutorial for Beginners, Moss(@tech_with_moss), an expert in DevOps and CI/CD tools, helps you understand how to migrate from Jenkins pipeline to the GitLab pipeline.. This video will also help you differentiate between the Jenkins pipeline, and the GitLab CI pipeline and walk you through how to use the GitLab pipeline to run tests on the LambdaTest Selenium Automation Grid. You would also know the prerequisites required and how to convert the Jenkins pipeline to GitLab CI and a detailed walkthrough of the Jenkins pipeline code. 

Also learn -:
🔸 What is difference between GitLab and Jenkins?
🔸 What is the difference between Jenkins pipeline and GitLab pipeline?
🔸 How to migrate to GitLab CI from Jenkins pipelines?
🔸 How to run test using GitLab pipeline?


Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.
What Is GitLab Pipeline? | How To Create GitLab Pipeline | GitLab Tutorial For Beginners | Part V
Tags: devops, tutorial, git, cicd
Published: 2022-03-04 13:49:16

{% youtube 9llCMADxvzI %}


Learn how to perform CI/CD in GitLab and explore the important features for CI/CD that GitLab offers for expediting product testing and release phases. 
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

In this part of GitLab Tutorial for Beginners, Moss(@tech_with_moss), an expert in DevOps and CI/CD tools, deep dives into how to create a GitLab Pipeline. By the end of this video tutorial, you would have developed an understanding of how GitLab pipelines integrate with a GitLab project, how to implement GitLab pipelines in your GitLab projects, and how to write a GitLab pipeline that produces artifacts. He also talks about how to write a GitLab pipeline that uses variables. He also demonstrates how to perform CI/CD in GitLab using the LambdaTest cloud Grid. 

Also learn -:
🔸 What is GitLab artifact?
🔸 What is GitLab pipeline?
🔸 How do GitLab pipelines work?
🔸 What is Git commit and push?
🔸 What is CI CD pipeline GitLab?
🔸 What are GitLab pipeline variables?


Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.
#2 Medusa News: Release of Medusa v1.2 ⚡️
Tags: news, webdev, opensource, javascript
Published: 2022-03-04 13:48:52

> **Sign-up for our newsletter [here](https://ky5eo2x1u81.typeform.com/newsletter)**



Heyyo’

This week we went live with Medusa v1.2 which comes with a handful of great features. Also, our New Admin is now fully tested and ready for deployment 🤘

---

## So what is new? 🚀

With the update, we have made a lot of smaller fixes and adjustments to the New Admin based on your feedback. But, we are also bringing some brand new core features:

**New Tax API:** Gives you more granular control of your tax logic and allows you so set up custom logic based on your individual regions based on e.g. product types or shipping options.

**Strategies:** Allow you to override core logic in Medusa in cases when necessary; e.g. if a merchant wants to apply custom logic when generating line items in a cart it can be overwritten. The first two strategy patterns are *[TaxCalculationStrategy](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/strategies/tax-calculation.ts)* and *[CartCompletionStrategy](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/strategies/cart-completion.ts)*.

**Customer groups:** Enables you to define CustomerGroups for promotion purposes (e.g. special pricing for VIP customers) and will be a core component in enabling B2B specific sales as well.

**Add error handler in `atomicPhase_`:** New way of handling errors in our atomic phases by adding an error handler param to the `atomicPhase_`. This is helpful when work is performed within a transaction, but the transactions fail and cleanup is needed.

**Global Search:** Basically it has just becomes 100-times smoother to navigate our Admin. Check it out below.

![Global Search in action!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1dnn9ghjipj5j5446gl.gif) 

There are many more details to Medusa v1.2 and you can check it all out **[here](https://www.medusajs.com/post/whats-new-in-medusa-1-2)** if interested.

If you want to always be on top latest news and updates, you can join our **[Discord](https://discord.com/invite/medusajs)** where we regularly post about updates and changes.

---

## Did you miss out on? 👀

- Our **[Product Hunt launch](https://www.producthunt.com/posts/medusa)** ending up as #1 of the day and #3 of the Month
- The **[Medusa Extender](https://github.com/adrien2p/medusa-extender)** by one of our community members, Adrien, enabling you to extend your Medusa setup (e.g. for multi-tenancy setup)
- Our **[New Admin Demo](https://demo.medusajs.com/)** which you can click around in yourself to explore (quick heads up, the design of the individual product pages is not fully up to date yet)
How To Use GitLab Flow In GitLab Project | GitLab Tutorial For Beginners | Part IV
Tags: devops, git, tutorial, cicd
Published: 2022-03-04 13:47:10

{% youtube xfFwQiu86O8 %}


Learn how to utilize the environmental branch variations to implement the GitLab Flow in the GitLab project.
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

We have already seen the two variants of GitLab Flow, i.e., the environmental branch and the release branch in the previous video of this GitLab series. In this part of GitLab Tutorial for Beginners, Moss(@tech_with_moss), a DevOps engineer, utilizes the environmental branch variants to help you learn how to apply GitLab Flow to the GitLab project. Further, you will learn to create and close an “issue” within the project and understand how to use git commands like “git push,” “git pull,” “git checkout,” “git commit,” and “git branch.” By the end of this video, you will know how to sync changes between local and remote Git repositories, create merge requests, gain familiarity with the components of the merge request, and more.

You will learn -:
🔸 What is Git push?
🔸 How to use Git push?
🔸 What are Git commands?
🔸 What is Git commit and push?
🔸 How to implement GitLab Flow?

Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.
#1 Medusa News: Official launch 🎉
Tags: news, javascript, webdev, opensource
Published: 2022-03-04 13:46:08

_Officially sent: Feb 7, 2022_

**Sign-up for our newsletter [here](https://ky5eo2x1u81.typeform.com/newsletter)**

---

Hi 👋

Today we are officially launching Medusa on Product Hunt. Check it out:

**Launch link: producthunt.com/posts/medusa**

---

## What is new with the launch? 🚀
We bring quite a few things to the table with the launch, including our first major update to our admin platform with a completely revamped design and UI. In short we introduce:
 - New admin 😻
 - New homepage 🖥
 - New product video 🎥
 - New logo & colours 💜

Check it all out in the link above!

## Thanks for taking part in the community growth🎢
Aside from some cool features, we have likewise closed the door behind us for a great first year (or really 6 months of operations, but still…). Here are a few of the highlights:

 - **+6,000** GitHub stars gained over 6 months
 - **+800** amazing community members joining our Discord
 - **+1,000** newsletter and product onboarding sign-ups
 - **85** contributions after our first Hacktober

We look forward to sharing more great community moments with you throughout 2022!

---

![Pssst... check out all these goodies](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a54umd2ts3dyxqo2x8o1.gif)

### Did you miss out on? 👀
 - The launch of our one-page checkout, [Medusa.Express](Medusa.Express)
 - Our article on [how to Migrate from Shopify to Medusa](https://dev.to/medusajs/turn-a-shopify-backend-open-source-and-headless-in-less-than-10-minutes-2g8m) (not that we directly encourage it, but... 😏 )
 - Our new Medusa Starter allowing you to spin-up Medusa with a full storefront ([link to repo](https://github.com/medusajs/gatsby-starter-medusa))
What Is GitLab Workflow | GitLab Flow | GitLab Tutorial For Beginners | Part III
Tags: devops, git, tutorial, cicd
Published: 2022-03-04 13:44:42

{% youtube 7lgGEXpsflI %}


In this video, we’ll introduce you to two variants of GitLab Flow. One utilizes environmental branches, and the other utilizes release branches. Follow along to see how you can work faster with these variants.
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

In this part of GitLab Tutorial for Beginners, Moss(@tech_with_moss), a DevOps engineer, will introduce you to the three primary Git branching strategies: GitHub Flow, GitLab Flow, and Git Flow and help you choose the best Git Branching Strategy for your project. By the end of this video, you’ll also learn GitLab’s primary branching and merging strategy to implement the development workflow in GitLab with a high degree of confidence.
 
You will learn -:
🔸 What is GitLab Flow?
🔸 What is GitHub Flow?
🔸 What is Git Flow?
🔸 What is the best Git branch strategy?
🔸 What is the difference between Git Flow and GitHub Flow?

Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.
Introduction To GitLab Interface | GitLab Tutorial For Beginners | Part II
Tags: devops, git, tutorial, cicd
Published: 2022-03-04 13:42:15

{% youtube -DAuKL22hPI %}


GitLab offers a feature-based system with a centralized, integrated platform for web developers. In addition, GitLab features help in project management, issue tracking, and free private repository hosting to simplify planning and managing your projects.
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

In this part of GitLab Tutorial for Beginners, Moss(@tech_with_moss), a DevOps engineer, introduces you to GitLab account authentication and group dashboard interface. Furthermore, you will be getting familiar with GitLab user interface features which enables you to automatically build, test, and deploy your software. Its features like built-in continuous integration and continuous delivery make it seamless to go from a code change to a running pipeline. You will also learn about the GitLab project dashboard to help you create a new project, ‘new issue’ within the project, and explore the ‘package & registry’ section.

This video will help answer the following questions 🎫 -: 
🔹What is GitLab UI?
🔹How do you access GitLab UI?
🔹How do you use GitLab?
🔹What can you do with GitLab?

Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.
Introduction to GitLab CI | What is GitLab CI | GitLab Tutorial For Beginners | Part I

Tags: devops, git, cicd, gitlabci
Published: 2022-03-04 13:39:34

{% youtube qKxytMuUiJA %}


GitLab is an open-source end-to-end DevOps platform that leverages the upstream concepts of Agile Methodologies, DevOps, and Continuous Delivery. 
[Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=feb_04&utm_term=sb&utm_content=tutorial_video)
Integrate GitLab with LambdaTest: https://www.lambdatest.com/gitlab-integration

This is Part 1 of the GitLab Tutorial for beginners, wherein Moss(@tech_with_moss), a DevOps engineer, introduces you to the GitLab CI, the fundamental commands of Git, and showcases how to work with GitLab using GitLab flow. He further explains how to migrate from Jenkins Pipelines to GitLab and deploy software using GitLab packaging and releasing features. 

This video will help answer the following questions 🎫 -: 
🔹What is GitLab CI?
🔹Why GitLab is used?
🔹How does GitLab CI work?
🔹What is the difference between Git and GitHub and GitLab?
🔹How do I migrate from Jenkins to GitLab?

Integrate LambdaTest and GitLab -:
◾ You can easily mark and track bugs with LambdaTest GitLab integration while performing cross-browser testing on the LambdaTest platform.
◾ With LambdaTest, you can identify bugs, questions, help in your GitLab repo just with a push of a button even while you are in the middle of performing a LambdaTest test session.
◾ LambdaTest provides testing environment information as well as additional testing screenshots and videos.