Skip to content

Updating workflows for new scripts #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/check-snippets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Checks snippets syntax

on:
pull_request:
paths:
- 'snippets/**'

jobs:
check-snippets:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "16"

- name: Check if snippets are formated correctly
run: |
node utils/checkSnippetFormatting.js # Run the script located in the utils/ folder
11 changes: 8 additions & 3 deletions .github/workflows/consolidate-snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Consolidate JSON Files
on:
push:
paths:
- "public/data/**"
- "snippets/**"

permissions:
contents: write
Expand All @@ -25,14 +25,19 @@ jobs:
run: |
npm install

- name: Consolidate JSON files
- name: Consolidate Snippets into JSON files
run: |
node utils/consolidate.js # Run the script located in the utils/ folder
node utils/consolidateSnippets.js # Run the script located in the utils/ folder

- name: Consolidate JSON files into merged file
run: |
node utils/consolidate.js

- name: Commit and push changes
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git add public/data/*
git add public/consolidated/all_snippets.json
git commit -m "Update consolidated snippets"
git push
8 changes: 4 additions & 4 deletions snippets/c/basics/hello-world.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Hello, World!
Description: Prints Hello, World! to the terminal.
Author: 0xHouss
Tags: c,printing,hello-world,utility
title: Hello, World!
description: Prints Hello, World! to the terminal.
author: 0xHouss
tags: c,printing,hello-world,utility
---

```c
Expand Down
8 changes: 4 additions & 4 deletions snippets/c/mathematical-functions/factorial-function.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Factorial Function
Description: Calculates the factorial of a number.
Author: 0xHouss
Tags: c,math,factorial,utility
title: Factorial Function
description: Calculates the factorial of a number.
author: 0xHouss
tags: c,math,factorial,utility
---

```c
Expand Down
8 changes: 4 additions & 4 deletions snippets/c/mathematical-functions/power-function.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Power Function
Description: Calculates the power of a number.
Author: 0xHouss
Tags: c,math,power,utility
title: Power Function
description: Calculates the power of a number.
author: 0xHouss
tags: c,math,power,utility
---

```c
Expand Down
8 changes: 4 additions & 4 deletions snippets/cpp/basics/hello-world.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Hello, World!
Description: Prints Hello, World! to the terminal.
Author: James-Beans
Tags: cpp,printing,hello-world,utility
title: Hello, World!
description: Prints Hello, World! to the terminal.
author: James-Beans
tags: cpp,printing,hello-world,utility
---

```cpp
Expand Down
8 changes: 4 additions & 4 deletions snippets/cpp/string-manipulation/reverse-string.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Reverse String
Description: Reverses the characters in a string.
Author: Vaibhav-kesarwani
Tags: cpp,array,reverse,utility
title: Reverse String
description: Reverses the characters in a string.
author: Vaibhav-kesarwani
tags: cpp,array,reverse,utility
---

```cpp
Expand Down
8 changes: 4 additions & 4 deletions snippets/cpp/string-manipulation/split-string.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Split String
Description: Splits a string by a delimiter
Author: saminjay
Tags: cpp,string,split,utility
title: Split String
description: Splits a string by a delimiter
author: saminjay
tags: cpp,string,split,utility
---

```cpp
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/buttons/3d-button-effect.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: 3D Button Effect
Description: Adds a 3D effect to a button when clicked.
Author: dostonnabotov
Tags: css,button,3D,effect
title: 3D Button Effect
description: Adds a 3D effect to a button when clicked.
author: dostonnabotov
tags: css,button,3D,effect
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/buttons/button-hover-effect.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Button Hover Effect
Description: Creates a hover effect with a color transition.
Author: dostonnabotov
Tags: css,button,hover,transition
title: Button Hover Effect
description: Creates a hover effect with a color transition.
author: dostonnabotov
tags: css,button,hover,transition
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/buttons/macos-button.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: MacOS Button
Description: A macOS-like button style, with hover and shading effects.
Author: e3nviction
Tags: css,button,macos,hover,transition
title: MacOS Button
description: A macOS-like button style, with hover and shading effects.
author: e3nviction
tags: css,button,macos,hover,transition
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/effects/blur-background.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Blur Background
Description: Applies a blur effect to the background of an element.
Author: dostonnabotov
Tags: css,blur,background,effects
title: Blur Background
description: Applies a blur effect to the background of an element.
author: dostonnabotov
tags: css,blur,background,effects
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/effects/hover-glow-effect.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Hover Glow Effect
Description: Adds a glowing effect on hover.
Author: dostonnabotov
Tags: css,hover,glow,effects
title: Hover Glow Effect
description: Adds a glowing effect on hover.
author: dostonnabotov
tags: css,hover,glow,effects
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/effects/hover-to-reveal-color.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Hover to Reveal Color
Description: A card with an image that transitions from grayscale to full color on hover.
Author: Haider-Mukhtar
Tags: css,hover,image,effects
title: Hover to Reveal Color
description: A card with an image that transitions from grayscale to full color on hover.
author: Haider-Mukhtar
tags: css,hover,image,effects
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/layouts/css-reset.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: CSS Reset
Description: Resets some default browser styles, ensuring consistency across browsers.
Author: AmeerMoustafa
Tags: css,reset,browser,layout
title: CSS Reset
description: Resets some default browser styles, ensuring consistency across browsers.
author: AmeerMoustafa
tags: css,reset,browser,layout
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/layouts/equal-width-columns.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Equal-Width Columns
Description: Creates columns with equal widths using flexbox.
Author: dostonnabotov
Tags: css,flexbox,columns,layout
title: Equal-Width Columns
description: Creates columns with equal widths using flexbox.
author: dostonnabotov
tags: css,flexbox,columns,layout
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/layouts/grid-layout.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Grid layout
Description: Equal sized items in a responsive grid
Author: xshubhamg
Tags: css,layout,grid
title: Grid layout
description: Equal sized items in a responsive grid
author: xshubhamg
tags: css,layout,grid
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/layouts/responsive-design.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Responsive Design
Description: The different responsive breakpoints.
Author: kruimol
Tags: css,responsive
title: Responsive Design
description: The different responsive breakpoints.
author: kruimol
tags: css,responsive
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/layouts/sticky-footer.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Sticky Footer
Description: Ensures the footer always stays at the bottom of the page.
Author: dostonnabotov
Tags: css,layout,footer,sticky
title: Sticky Footer
description: Ensures the footer always stays at the bottom of the page.
author: dostonnabotov
tags: css,layout,footer,sticky
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/typography/letter-spacing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Letter Spacing
Description: Adds space between letters for better readability.
Author: dostonnabotov
Tags: css,typography,spacing
title: Letter Spacing
description: Adds space between letters for better readability.
author: dostonnabotov
tags: css,typography,spacing
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/css/typography/responsive-font-sizing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Responsive Font Sizing
Description: Adjusts font size based on viewport width.
Author: dostonnabotov
Tags: css,font,responsive,typography
title: Responsive Font Sizing
description: Adjusts font size based on viewport width.
author: dostonnabotov
tags: css,font,responsive,typography
---

```css
Expand Down
8 changes: 4 additions & 4 deletions snippets/html/basic-layouts/grid-layout-with-navigation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Grid Layout with Navigation
Description: Full-height grid layout with header navigation using nesting syntax.
Author: GreenMan36
Tags: html,css,layout,sticky,grid,full-height
title: Grid Layout with Navigation
description: Full-height grid layout with header navigation using nesting syntax.
author: GreenMan36
tags: html,css,layout,sticky,grid,full-height
---

```html
Expand Down
8 changes: 4 additions & 4 deletions snippets/html/basic-layouts/sticky-header-footer-layout.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Sticky Header-Footer Layout
Description: Full-height layout with sticky header and footer, using modern viewport units and flexbox.
Author: GreenMan36
Tags: html,css,layout,sticky,flexbox,viewport
title: Sticky Header-Footer Layout
description: Full-height layout with sticky header and footer, using modern viewport units and flexbox.
author: GreenMan36
tags: html,css,layout,sticky,flexbox,viewport
---

```html
Expand Down
8 changes: 4 additions & 4 deletions snippets/javascript/array-manipulation/flatten-array.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Flatten Array
Description: Flattens a multi-dimensional array.
Author: dostonnabotov
Tags: javascript,array,flatten,utility
title: Flatten Array
description: Flattens a multi-dimensional array.
author: dostonnabotov
tags: javascript,array,flatten,utility
---

```js
Expand Down
8 changes: 4 additions & 4 deletions snippets/javascript/array-manipulation/remove-duplicates.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Remove Duplicates
Description: Removes duplicate values from an array.
Author: dostonnabotov
Tags: javascript,array,deduplicate,utility
title: Remove Duplicates
description: Removes duplicate values from an array.
author: dostonnabotov
tags: javascript,array,deduplicate,utility
---

```js
Expand Down
8 changes: 4 additions & 4 deletions snippets/javascript/array-manipulation/shuffle-array.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Shuffle Array
Description: Shuffles an Array.
Author: loxt-nixo
Tags: javascript,array,shuffle,utility
title: Shuffle Array
description: Shuffles an Array.
author: loxt-nixo
tags: javascript,array,shuffle,utility
---

```js
Expand Down
8 changes: 4 additions & 4 deletions snippets/javascript/array-manipulation/zip-arrays.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Zip Arrays
Description: Combines two arrays by pairing corresponding elements from each array.
Author: Swaraj-Singh-30
Tags: javascript,array,utility,map
title: Zip Arrays
description: Combines two arrays by pairing corresponding elements from each array.
author: Swaraj-Singh-30
tags: javascript,array,utility,map
---

```js
Expand Down
8 changes: 4 additions & 4 deletions snippets/javascript/basics/hello-world.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Title: Hello, World!
Description: Prints Hello, World! to the terminal.
Author: James-Beans
Tags: javascript,printing,hello-world,utility
title: Hello, World!
description: Prints Hello, World! to the terminal.
author: James-Beans
tags: javascript,printing,hello-world,utility
---

```js
Expand Down
Loading
Loading