repo
stringlengths 8
123
| branch
stringclasses 178
values | readme
stringlengths 1
441k
⌀ | description
stringlengths 1
350
⌀ | topics
stringlengths 10
237
| createdAt
stringlengths 20
20
| lastCommitDate
stringlengths 20
20
| lastReleaseDate
stringlengths 20
20
⌀ | contributors
int64 0
10k
| pulls
int64 0
3.84k
| commits
int64 1
58.7k
| issues
int64 0
826
| forks
int64 0
13.1k
| stars
int64 2
49.2k
| diskUsage
float64 | license
stringclasses 24
values | language
stringclasses 80
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
synjan/f1app | main | [![CodeQL](https://github.com/synjan/f1app/actions/workflows/codeql.yml/badge.svg)](https://github.com/synjan/f1app/actions/workflows/codeql.yml)
# F1App
F1App is a web application built with React that provides information about the current Formula 1 season. It allows users to view the race schedule, countdown to upcoming races, and see key race results.
## Features
- Displays a list of races for the current Formula 1 season
- Shows race information including name, location, and date
- Provides a countdown timer for upcoming races
- Allows users to click on a race to view detailed information
- Fetches race results for finished races and displays the winner and other key information
- Automatically scrolls to the next upcoming race on initial load
- Restores scroll position when navigating back from race details
## Technologies Used
- React: JavaScript library for building user interfaces
- Axios: Promise-based HTTP client for making API requests
- date-fns: Library for manipulating and formatting dates
- Ergast API: API providing Formula 1 data
## Getting Started
To run the F1App locally on your machine, follow these steps:
1. Clone the repository:
```
git clone https://github.com/synjan/f1app.git
```
2. Navigate to the project directory:
```
cd f1app
```
3. Install the dependencies:
```
npm install
```
4. Start the development server:
```
npm start
```
5. Open your browser and visit `http://localhost:3000` to see the app running.
## Project Structure
The project structure is as follows:
```
f1app/
├── public/
│ ├── index.html
│ └── ...
├── src/
│ ├── components/
│ │ ├── RaceCard.js
│ │ ├── RaceCard.css
│ │ ├── RaceDetail.js
│ │ └── RaceDetail.css
│ ├── App.js
│ ├── App.css
│ └── index.js
├── .gitignore
├── package.json
└── README.md
```
- `public/`: Contains the public assets and the HTML template.
- `src/`: Contains the source code of the application.
- `components/`: Contains reusable components used in the app.
- `RaceCard.js`: Component for displaying a race card with basic information.
- `RaceCard.css`: Styles for the `RaceCard` component.
- `RaceDetail.js`: Component for displaying detailed information about a race.
- `RaceDetail.css`: Styles for the `RaceDetail` component.
- `App.js`: The main component that fetches data and renders the race list and details.
- `App.css`: Styles for the `App` component.
- `index.js`: The entry point of the application.
- `.gitignore`: Specifies files and directories to be ignored by Git.
- `package.json`: Contains project metadata and dependencies.
- `README.md`: Provides information and instructions about the project.
## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
## License
This project is licensed under the [MIT License](LICENSE).
## Acknowledgements
- [Create React App](https://create-react-app.dev/)
- [Ergast API](http://ergast.com/mrd/)
- [date-fns](https://date-fns.org/)
- [Axios](https://axios-http.com/)
| F1App is a web application built with React that provides information about the current Formula 1 season. It allows users to view the race schedule, countdown to upcoming races, and see key race results. | axios,codeql,date-fns,ergast-api,formula1,html,javascript,nodejs,react | 2024-02-23T14:06:50Z | 2024-04-03T13:44:17Z | null | 1 | 0 | 21 | 0 | 0 | 2 | null | null | JavaScript |
Winnerezy/Clock | main | Clock website with basic functionality.
With aesthetic design and calm view
| Simplistic clock website | clock,css,html,html-css-javascript,javascript | 2024-02-20T11:43:03Z | 2024-02-21T07:33:47Z | null | 1 | 0 | 12 | 0 | 0 | 2 | null | GPL-3.0 | CSS |
larvalete/indesign | main | # InDesign Scripting Solutions for Error 11268
This repository contains a collection of scripts developed to address the `kIllegalScaleValueError` (error code 11268) encountered when scaling objects in Adobe InDesign using scripting.
## Overview
Error 11268 in InDesign scripting typically occurs when attempting to scale an object with an illegal or incorrect scale value. This repository documents my journey from the initial attempts that led to this error, through the developmental iterations, to the successful versions that finally resolved the issue.
## Repository Structure
- `successful-versions/`: This folder contains the scripts that successfully resolved the error. They are robust, include error handling, and are ready for use in production environments.
- `developmental-versions/`: Inside, you will find:
- `initial_attempts/`: Scripts from the early stages of development. They are part of the process but may not handle all cases successfully.
- `failed_versions/`: Scripts that did not result in successful scaling. These are included for educational purposes to demonstrate common pitfalls and debugging steps.
## Usage
To use the successful scripts, select a rectangle frame in InDesign, then run the script from the `successful-versions` folder that best fits your scaling needs.
## Future Directions
While the current focus of this repository is on providing solutions for error 11268 in Adobe InDesign scripting, we are open to expanding the repository to include solutions for other common errors encountered by InDesign scripters. Contributions and suggestions are welcome.
## Contributing
Your contributions and suggestions are welcome. If you have improvements or encounter an issue, please open a pull request or issue.
## License
This project is licensed under the MIT License - see the LICENSE.md file for details.
## Acknowledgments
- Thanks to the Adobe scripting community for continuous support and knowledge sharing.
- Special mention to ChatGPT at OpenAI for assistance in troubleshooting and refining the scripts. | An evolving hub of Adobe InDesign scripting solutions, featuring detailed fixes for common errors like 11268, alongside a wealth of practical scripts for enhancing InDesign workflows. Dive into our journey from problem to solution, and leverage our findings to elevate your scripting projects. | indesign,javascript,scripting | 2024-02-02T12:15:11Z | 2024-02-12T22:09:03Z | null | 1 | 0 | 27 | 0 | 0 | 2 | null | MIT | JavaScript |
renansouz/My-Studies | main | # My Studies 📚💻
Welcome to my study repository! Here, I share my journey in Full-Stack JavaScript development, documenting my progress and sharing knowledge with fellow developers.
## About
In this repository, I am sharing my journey in Full-Stack JavaScript development.
## Technologies
You'll find projects and studies showcasing a range of technologies. I've focused on...
### Programming Languages
<ul>
<li>JavaScript</li>
<li>python</li>
<li>TypeScript</li>
<li>C</li>
<li>PHP</li>
</ul>
### Front-end
<ul>
<li>React</li>
<li>Tailwind</li>
<li>Botstrap</li>
<li>SASS</li>
<li>HTML and CSS</li>
</ul>
## How to Contribute
If you have suggestions for improvements or would like to collaborate on a project with me, feel free to reach out to me on LinkedIn!
[Click here to visit my LinkedIn profile](https://www.linkedin.com/in/renansilvadev/)
## Acknowledgments
I would like to thank everyone who has contributed to my learning and growth as a developer.
I hope this repository is helpful for you, just as it is for me. Let's learn together! 🚀
| In this repository, I am documenting and sharing everything I am studying in programming. Here, you will find a variety of content, ranging from code snippets to projects under development. 📚💻 | code-snippets,development-journey,fullstack-development,javascript,learning-resources,programming | 2024-03-12T20:26:17Z | 2024-05-23T01:16:57Z | null | 1 | 0 | 109 | 0 | 0 | 2 | null | null | Python |
WaRtr0/FsBrowserSide | master | ![GitHub](https://img.shields.io/github/license/WaRtr0/FsBrowserSide) ![GitHub top language](https://img.shields.io/github/languages/top/WaRtr0/FsBrowserSide) ![GitHub repo size](https://img.shields.io/github/repo-size/WaRtr0/FsBrowserSide) ![GitHub contributors](https://img.shields.io/github/contributors/WaRtr0/FsBrowserSide) ![GitHub repo directory count](https://img.shields.io/github/directory-file-count/WaRtr0/FsBrowserSide) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/WaRtr0/FsBrowserSide/master) ![GitHub Repo stars](https://img.shields.io/github/stars/WaRtr0/FsBrowserSide) ![GitHub watchers](https://img.shields.io/github/watchers/WaRtr0/FsBrowserSide) ![GitHub followers](https://img.shields.io/github/followers/WaRtr0)
# Fs Browser Side
> [!warning]
> This library is currently under development and is **not recommended** for ***use*** in **production environments**!!! Contributions are welcome to improve its functionality and stability.
## Overview
`Fs Browser Side` is a library designed to bring **[NodeJS's FileSystem (FS)](https://nodejs.org/api/fs.html)** capabilities ___into___ the **client-side environment**, inspired by the robust and versatile [FS](https://nodejs.org/api/fs.html) module in NodeJS. This project aims to **simplify interactions** with the **[FileSystem API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API) on the web**, providing a more accessible interface for managing files and directories within the client's browser. By leveraging this library, developers can perform file operations **similar** to those in a **server-side context**, within the **confines of the client's permissions and browser capabilities**.
## Features
- **FileSystem API Simplification:** Offers a simplified, user-friendly interface for the [FileSystem API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API), making it easier to perform file operations on the client side.
- **Multi-Folder Management:** Allows the instantiation of multiple FS classes, enabling the management of multiple folders simultaneously.
- **NodeJS FS Commands Adaptation:** Implements a multitude of commands similar to NodeJS's FS module, adapted for browser compatibility.
- **Secure Folder Access:** Ensures secure access to the file system, requiring users to grant permission for reading and writing operations in selected folders.
## Compatibility
The library is designed with compatibility in mind; however, it's important to note the FileSystem API's **support varies across browsers**. Users may encounter **limitations based** on their **[browser's compatibility](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API#browser_compatibility)** **with** the **FileSystem API**.
## But what is it for?
But what use can it serve? These tasks can indeed be accomplished on the server side through simple upload and download operations...
Precisely, this allows you to **reduce server dependencies**! It enables users to perform complex file management tasks directly within their browser. This provides the opportunity to innovate web applications that are less reliant on a server, with better confidentiality...
**Here are some possibilities :**
- **Custom Content Management System:** Tailor and manage your digital content directly in the browser.
- **Browser-Based IDE:** Develop and test code entirely within your web browser.
- **Online Photoshop Alternative:** Edit images online with comprehensive tools.
- **Advanced Online Download Manager:** Or even a file backup and synchronization solution.
- **Client-Side Semi-Scraping Extension:** Extract and process web data on the fly.
- **Offline Cache System:** Access your files and work offline without a problem.
- **Photo Album Organizer:** Curate and manage your photo collections with ease.
| FS Browser side Javascript module (server-to-client adaptation) | adaptation,api,client-side,filesystem,javascript,browser,file,fs,mangement-system,nodejs-like-fs | 2024-02-11T23:37:19Z | 2024-02-23T01:32:53Z | null | 1 | 0 | 31 | 0 | 0 | 2 | null | MIT | JavaScript |
Skaldebane/svelte-cleanable-store | main | # svelte-cleanable-store
Custom Svelte store with built-in cleanup support on `subscribe`. Inspired by React's `useEffect` cleanup mechanism.
**While the core functionality is simple and complete, this package is still pre-1.0 until I get feedback on the API shape.** (e.g. Is `cleanable` a confusing name? Do we need a `readable` equivalent as well?)
## Usage
```ts
const state = cleanable(0);
state.subscribe((value) => {
console.log(`state = ${value}`);
return () => console.log(`cleaning up ${value}...`);
});
```
Console output:
```cjs
'state = 0'
// $state++
'cleaning up 0...'
'state = 1'
// $state = 5
'cleaning up 1...'
'state = 5'
```
## Example
### Closing a WebSocket connection
```ts
const path = cleanable("https://example.com/stream");
path.subscribe((value) => {
const webSocket = new WebSocket(value);
webSocket.onmessage = (event) => console.log(event);
return () => webSocket.close();
});
```
## But what about Svelte 5's `$effect`?
It's absolutely great! In fact, it inspired me to create this package.
However, Svelte 5 is still in beta now, and while there are many workarounds for Svelte 4, this package provides a clean, store-based solution that works with Svelte 4 (and 5), can be used anywhere (in plain `.js`/`.ts` files!), and is compatible with auto-subscriptions in `.svelte` files (with the `$` prefix), all without feeling like a hack.
## License
[MIT License](./LICENSE.md). Copyright (c) 2024 Houssam Elbadissi.
| Custom Svelte store with cleanup function support. | effect,javascript,svelte,svelte-store,typescript | 2024-02-16T15:17:07Z | 2024-02-16T17:37:39Z | 2024-02-16T15:48:26Z | 1 | 0 | 11 | 0 | 0 | 2 | null | MIT | TypeScript |
akashpawar43/Radiant-Riches | master | ## Description
- This React application is built using [Vite](https://vitejs.dev/).
- It uses [Tailwind CSS](https://tailwindcss.com/)
- The application is generated in JavaScript.
## Pre-requisites
- [git](https://git-scm.com/) - v2.13 or greater
- [NodeJS](https://nodejs.org/en/) - v16 or greater
- [npm](https://www.npmjs.com/) - v6 or greater
## Running in dev environment
1. `cd YOUR_APPLICATION`
2. `npm install`
3. `npm start`
## .env file
This file contains various environment variables that you can configure.
## Folder Structure
```
.
├── package.json
├── postcss.config.js
├── vite.config.js
├── index.html
├── public
│ ├── assets
│ │ └── images --------- All Project Images
│ ├── favicon.ico
│ ├── manifest.json
│ └── robots.txt
├── README.md
├── src
│ ├── App.jsx
│ ├── assets
│ │ └── fonts ---------- Project fonts
│ ├── components --------- UI and Detected Common Components
│ ├── constants ---------- Project constants, eg: string consts
│ ├── hooks -------------- Helpful Hooks
│ ├── index.jsx
│ ├── pages -------------- All route pages
│ ├── Routes.jsx ---------- Routing
│ ├── styles
│ │ ├── index.css ------ Other Global Styles
│ │ └── tailwind.css --- Default Tailwind modules
│ └── util
│ └── index.jsx ------- Helpful utils
└── tailwind.config.js ----- Entire theme config, colors, fonts etc.
```
For the project to build, **these files must exist with exact filenames**:
- `index.html` is the page template;
- `src/index.jsx` is the JavaScript entry point.
You may create subdirectories inside src.
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br>
Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
### `npm test`
Launches the test runner in the interactive watch mode.<br>
### `npm run build`
Builds the app for production to the `build` folder.<br>
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time.
## Installing a Dependency
You can install any dependencies (for example, React Router) with `npm`:
```sh
npm install --save react-router
```
Alternatively you may use `yarn`:
```sh
yarn add react-router
```
## ScreenShots
<a href="https://rrlc.netlify.app/"><img src="https://github.com/akashpawar43/Radiant-Riches/blob/master/public/website.png" alt="website screenshot"></a>
| https://rrlc.netlify.app/ | css3,html5,javascript,jsx,landing-page,react-router-dom,reactjs,website | 2024-02-23T17:14:16Z | 2024-02-26T08:21:48Z | null | 1 | 0 | 12 | 0 | 0 | 2 | null | null | JavaScript |
LakshayD02/Student_Management_System | main | # Student_Management_System
SMS acts as the bottom line database to store all the day-to-day school operations, maintain the proper records of the past few decades, regulate the various operation modules, managing the critical tasks, efficiently handling the administrative processes.
Developed using PHP, AJAX, jQuery, Bootstrap, SCSS, HTML, CSS, and JavaScript, it offers a seamless user experience. Its MySQL database backend ensures efficient data management. This system facilitates tasks such as student enrollment, attendance tracking, grade management, and communication between faculty and students. With its responsive design and intuitive interface, the Student Management System enhances administrative efficiency and improves student engagement, ultimately fostering a more productive learning environment.
| SMS acts as the bottom line database to store all the day-to-day school operations, maintain the proper records of the past few decades, regulate the various operation modules, managing the critical tasks, efficiently handling the administrative processes. | ajax,bootstrap,css3,html5,javascript,jquery,mysql,php,php7,php8 | 2024-03-02T12:53:14Z | 2024-03-02T13:22:04Z | null | 1 | 0 | 4 | 0 | 0 | 2 | null | null | CSS |
NHeroOP/music-player-js | main | # Music Player - Javascript Project
## Table of contents
- [Overview](#overview)
- [The challenge](#the-challenge)
- [Screenshot](#screenshot)
- [Links](#links)
- [My process](#my-process)
- [Built with](#built-with)
- [What I learned](#what-i-learned)
- [Continued development](#continued-development)
- [Useful resources](#useful-resources)
- [Author](#author)
- [Acknowledgments](#acknowledgments)
## Overview
### The challenge
Users should be able to:
- Play Pause Music
- Skip to next or previous song
- Go to any part of the music
### Screenshot
![](./assets/img/musicplayer.png)
### Links
- [Live Site](https://nheroop.github.io/music-player-js/)
- [Source Code](https://github.com/NHeroOP/music-player-js)
## My process
### Built with
- Semantic HTML5 markup
- CSS
- Flexbox
- Javascript
### What I learned
I learnt many things, so some of the highlights are down below
```css
.some-element {
background: linear-gradient(0deg, rgba(154,59,103,1) 0%, rgba(66,67,116,1) 62%);
}
```
```js
const width = this.clientWidth;
const clickX = e.offsetX
const duration = audio.duration
audio.currentTime = (clickX / width) * duration;
```
### Continued development
I will continue to update this site and make it fully working music site using frameworks because vanilla js after learning those frameworks
### Useful resources
- [W3 Schools](https://www.w3schools.com/) - This helped me for many things that i didn't knew
- [CSS Gradient](https://cssgradient.io/) - This helped for creating gradients
## Author
- NHero
## Acknowledgments
The design of website I got from the web & some things I learned from Youtube
## If you have any issues related to copyright claims or anything please contact me
| Music Player using vanilla js | javascript,vanilla-javascript | 2024-02-16T17:21:18Z | 2024-02-29T17:28:58Z | null | 1 | 0 | 30 | 0 | 1 | 2 | null | null | JavaScript |
amr12338kh/portfolio | main | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
| Amr's Portfolio is a showcase of my journey as a web developer, highlighting skills, projects, and experiences. Built with Next.js, Tailwind CSS, Shadcn, and powered by Hypergraph for data management, this portfolio combines sleek design with powerful functionality to present my work in an engaging and professional manner. | hypergraph,javascript,nextjs,reatctjs,shadcn-ui,tailwindcss,typescript | 2024-02-07T14:22:55Z | 2024-02-08T22:23:32Z | null | 1 | 0 | 6 | 0 | 0 | 2 | null | null | TypeScript |
yusufyusie/hello-react-front-end | dev | <h3 align="center"><b>Hello React Front-End</b></h3>
<a name="readme-top"></a>
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [💻 Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [Usage](#usage)
- [Run tests](#run-tests)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [📝 License](#license)
# 📖 Hello React Front-En <a name="about-project"></a>
The **Hello React Front-End** is a student project. The goal is to integrate the React front-end with the Rails back-end for one versatile monolithic app that can be hosted from a single source.
While there are different ways to achieve this, in **Hello React Front-End** I create two separate apps (React front-end with a Rails back-end) and connect them to display a random message.
This repo consumes API data from [Link to Hello Rails Back-End](https://github.com/yusufyusie/hello-rails-back-end.git) project.
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
<details>
<summary>Client</summary>
<ul>
<li><a href="https://developer.mozilla.org/ru/docs/Web/HTML">HTML</a></li>
<li><a href="https://developer.mozilla.org/ru/docs/Web/CSS">CSS</a></li>
<li><a href="https://developer.mozilla.org/ru/docs/Web/JavaScript">JavaScript</a></li>
<li><a href="https://react.dev/">React</a></li>
<li><a href="https://redux-toolkit.js.org/">Redux Toolkit</a></li>
</ul>
</details>
<details>
<summary>Server</summary>
<ul>
<li><a href="https://www.ruby-lang.org/en/">Ruby</a></li>
<li><a href="https://rubyonrails.org/">Ruby on Rails</a></li>
</ul>
</details>
<details>
<summary>Database</summary>
<ul>
<li><a href="https://www.postgresql.org/">PostgreSQL</a></li>
</ul>
</details>
### Key Features <a name="key-features"></a>
- **use Ruby on Rails for back-end of the project**
- **use React framework for front-end of the project**
- **develop project in two separate repositories**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🚀 Live Demo <a name="live-demo"></a>
- There is no Demo for this student project.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 💻 Getting Started <a name="getting-started"></a>
To get a local copy up and running, follow these steps.
### Prerequisites
In order to run this project you need:
- GitHub account;
- Git installed on your OS;
- VSCode (or another code editor);
- modern browser (supporting HTML5 and CSS3) is highly recommended;
- [Node.js and npm](https://nodejs.org/) installed.
### Setup
Clone this repository to your desired folder:
Login to your GitHub account. Clone this repository to your desired folder:
> cd my-folder
> git clone https://github.com/yusufyusie/hello-react-front-end.git
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
### Install
Install the dependencies:
> npm install
### Usage
To run the app in the development mode"."
> npm start
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
### Run tests
You can check linter errors by running these commands:
> npx eslint "**/*.{js,jsx}"
> npx stylelint "**/*.{css,scss}"
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 👥 Authors <a name="authors"></a>
👤 **Yesuf Fenta**
- GitHub: [@yusufyusie](https://github.com/yusufyusie)
- LinkedIn: [in/yusufyusie](https://www.linkedin.com/in/yusufyusie)
- Twitter: [@yusufyusiee](https://twitter.com/yusufyusiee)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🔭 Future Features <a name="future-features"></a>
- [ ] **add new routes and components**
- [ ] **add styles**
- [ ] **deploy the project**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🤝 Contributing <a name="contributing"></a>
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](../../issues/).
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## ⭐️ Show your support <a name="support"></a>
If you like this project just star it!
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thank the Microverse program for the knowledge and skills I have acquired in Modules 1-5.
I am grateful to all previous project reviewers for their advice. Thanks to them I could build this app.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 📝 License <a name="license"></a>
This project is [MIT](./LICENSE) licensed.
<p align="right">(<a href="#readme-top">back to top</a>)</p> | Hello Rails Front-end is an tutorial for creating a Rails API with React Front-end. This project is a part of the Microverse curriculum. The goal is to create a Rails API and React Front-end that will display a random greeting from the database. | css,javascript,react,react-redux | 2024-03-02T08:26:34Z | 2024-03-02T14:11:12Z | null | 1 | 1 | 22 | 0 | 0 | 2 | null | MIT | JavaScript |
inspect-js/is-data-view | main | # is-data-view <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
Is this value a JS DataView? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and despite ES6 Symbol.toStringTag.
## Example
```js
var isDataView = require('is-data-view');
var assert = require('assert');
assert.equal(false, isDataView(undefined));
assert.equal(false, isDataView(null));
assert.equal(false, isDataView(false));
assert.equal(false, isDataView(true));
assert.equal(false, isDataView([]));
assert.equal(false, isDataView({}));
assert.equal(false, isDataView(/a/g));
assert.equal(false, isDataView(new RegExp('a', 'g')));
assert.equal(false, isDataView(new Date()));
assert.equal(false, isDataView(42));
assert.equal(false, isDataView(NaN));
assert.equal(false, isDataView(Infinity));
assert.equal(false, isDataView(new Number(42)));
assert.equal(false, isDataView('foo'));
assert.equal(false, isDataView(Object('foo')));
assert.equal(false, isDataView(function () {}));
assert.equal(false, isDataView(function* () {}));
assert.equal(false, isDataView(x => x * x));
assert.equal(false, isDataView([]));
assert.equal(false, isDataView(new Int8Array()));
assert.equal(false, isDataView(new Uint8Array()));
assert.equal(false, isDataView(new Uint8ClampedArray()));
assert.equal(false, isDataView(new Int16Array()));
assert.equal(false, isDataView(new Uint16Array()));
assert.equal(false, isDataView(new Int32Array()));
assert.equal(false, isDataView(new Uint32Array()));
assert.equal(false, isDataView(new Float32Array()));
assert.equal(false, isDataView(new Float64Array()));
assert.equal(false, isDataView(new BigInt64Array()));
assert.equal(false, isDataView(new BigUint64Array()));
assert.ok(isDataView(new DataView(new ArrayBuffer(0))));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/is-data-view
[npm-version-svg]: https://versionbadg.es/inspect-js/is-data-view.svg
[deps-svg]: https://david-dm.org/inspect-js/is-data-view.svg
[deps-url]: https://david-dm.org/inspect-js/is-data-view
[dev-deps-svg]: https://david-dm.org/inspect-js/is-data-view/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/is-data-view#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/is-data-view.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-data-view.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-data-view.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-data-view
[codecov-image]: https://codecov.io/gh/inspect-js/is-data-view/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-data-view/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-data-view
[actions-url]: https://github.com/inspect-js/is-data-view/actions
| Is this value a JS DataView? This module works cross-realm/iframe, does not depend on instanceof or mutable properties, and despite ES6 Symbol.toStringTag. | data,dataview,ecmascript,javascript,typedarray,typedarrays,view | 2024-01-31T20:38:09Z | 2024-03-11T04:59:52Z | null | 1 | 0 | 11 | 1 | 0 | 2 | null | MIT | JavaScript |
Alipakkr/PetPals | main | # PetPals: Pet Adoption and Care Platform
## Introduction
Welcome to PetPals, your go-to Pet Adoption Website, dedicated to facilitating the journey of connecting loving homes with deserving animals. Our platform is designed to support and empower animal welfare organizations, ensuring a smooth and caring adoption process.
## Features
- Pet Searches: Explore a diverse range of adorable pets ready to become a part of your family.
- User Accounts: Create personalized profiles to track your favorite pets, adoption history, and preferences.
- Wish Lists: Save and organize your desired pets, making it easier to find your ideal match.
- Adoption Requests: Initiate adoption requests seamlessly and efficiently, ensuring a smooth and caring process.
- Admin Controls: Empower organizations with robust admin controls for effective management and coordination.
## User registration and authentication: Allow users to create accounts, log in, and view their profiles.
## Admin:
Manage user accounts and profiles, CRUD for the users
Manage the pet listings, CRUD for the pet listings
## User/Potential Adopter:
Pet search: Search for pets by various criteria such as species, breed, age, and location.
Adoption application: Apply for the adoption of a pet they are interested in by filling out an application form that includes information about their living situation, previous pet ownership experience, and reason for adopting.
## ANIMAL SHELTERS AND PET ADOPTION AGENCIES:
Pet listings: List pets available for adoption, including photos, descriptions, and adoption requirements for potential adopters to view.
Review adoption applications submitted by potential adopters for pets listed on the platform.
Approve or reject adoption applications based on the organization's policies and criteria.
## Project Type
Frontend | Backend | Fullstack
## Deplolyed App
- Frontend: https://petpalscare.netlify.app
- Backend: https://petpals-2z52.onrender.com
## Directory Structure
my-app/
- ├─ backend/
- ├─ frontend/
## Installation & Getting started
Detailed instructions on how to install, configure, and get the project running. For BE/FS projects, guide the reviewer how to check mongodb schema etc.
```bash
npm install my-project
cd my-project
npm start
```
## Technology Stack
- Node.js
- Express.js
- MongoDB
- Chakra-UI
- Redux
- React.js
- Tailwind
- Json-Server
## Team Members
### Alipa(Team Lead )
[![profile](https://img.shields.io/badge/Github-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://github.com/Alipakkr)
[![linkedin](https://img.shields.io/badge/Linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/alipa-55b365285/)
### M Laxminarayan Reddy
[![profile](https://img.shields.io/badge/Github-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://github.com/imlnr)
[![linkedin](https://img.shields.io/badge/Linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/alipa-55b365285/)
### Nirmal Patel
[![profile](https://img.shields.io/badge/Github-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://github.com/nirmalpatel26)
[![linkedin](https://img.shields.io/badge/Linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/alipa-55b365285/)
| Welcome to our Pet Adoption Website, where the journey to find your perfect furry companion begins. We've created a platform dedicated to connecting loving homes with deserving animals, all while supporting and empowering animal welfare organizations. | api,atlas,chakra-ui-react,css,html,javascript,json-server,mongodb,nodejs,reactjs | 2024-02-20T07:08:42Z | 2024-02-28T10:43:35Z | null | 3 | 63 | 181 | 0 | 1 | 2 | null | null | JavaScript |
tinyflowjs/tinyflow | master | <div align="center">
<img src="logo.svg" width="64">
<h1>Tinyflow</h1>
</div>
<p align="center">
A lightweight workflow engine for all runtimes.
Highly extensive with minimal core and no dependencies.
</p>
<div align="center">
[![Test suite](https://github.com/tinyflowjs/tinyflow/actions/workflows/testsuite.yml/badge.svg)](https://github.com/tinyflowjs/tinyflow/actions/workflows/testsuite.yml)
[![Publish packages](https://github.com/tinyflowjs/tinyflow/actions/workflows/publish.yml/badge.svg)](https://github.com/tinyflowjs/tinyflow/actions/workflows/publish.yml)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![CodeQL](https://github.com/tinyflowjs/tinyflow/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/tinyflowjs/tinyflow/actions/workflows/codeql-analysis.yml)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
![GitHub License](https://img.shields.io/github/license/tinyflowjs/tinyflow)
</div>
<div align="center">
[Documentation](https://tinyflowjs.github.io/tinyflow/)
·
[Releases](https://github.com/tinyflowjs/tinyflow/releases)
</div>
## Features
- 📦 no dependencies and no runtime-specific dependencies (besides ES6 + Promises)
- 🪶 minimal core with (xkb; see the [sizes table](#file-sizes))
- 🧠 very easy to use API
- 🧩 highly extensible from the ground up
- 📝 use declarative workflows and enrich them with custom functionality
## Table of Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Installation](#installation)
- [Using Package Managers and Platforms](#using-package-managers-and-platforms)
- [Using a CDN](#using-a-cdn)
- [Entry Points](#entry-points)
- [Usage](#usage)
- [Minimal Example](#minimal-example)
- [Extensions](#extensions)
- [Events](#events)
- [Covered environments](#covered-environments)
- [File sizes](#file-sizes)
- [Contribution and Development](#contribution-and-development)
- [Tools / stack](#tools--stack)
- [Development scripts](#development-scripts)
- [Security](#security)
- [License](#license)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation
### Using Package Managers and Platforms
Our goal is to make Tinyflow usable anyhwere JavaScript is running.
The following table shows some options to install Tinyflow's `core` package, the most minimal deliverable:
| name | command | tested |
|------------|-------------------------------------------------------------|--------|
| npm | `npm install @tinyflow/core` | |
| yarn | `yarn add @tinyflow/core` |
| deno (npm) | `import { Tinyflow } from "npm:@tinyflow/core";` |
| deno (cdn) | `import { Tinyflow } from "https://esm.sh/@tinyflow/core";` |
| bun | `bun install @tinyflow/core` |
### Using a CDN
- unpkg
- jsdelivr
- cdnjs
- esm.sh
- jspm
- github (not for production!)
### Entry Points
Tonyflow packages offer multiple entry point files, suited for different environments.
Nowadays, you might want to stick with ESM but we also provide cjs, es5 and iife versions of the build, including
sourcemaps and a minified version, too.
They're all placed in the respective package's `/dist` folder and committed to this repository.
## Usage
Internally there are two classes, `Workflow` and `Step` that act for the whole engine.
If you only want the `core` package then you will have to manage them manually.
Depending on your use-case, this might be exactly what you want or not want.
If you want a more comfortable solution (suitable for beginners), you might also want to install `@tinyflow/instances`.
### Minimal Example
If you want to have the most minimal size, then you will have to manage everything on your own.
Here is an example for that:
```js
import { Workflow } from '@tinyflow/core'
// create a new workflow
const workflow = new Workflow({
name: 'checkout-cart',
steps: {
visit: {},
paymentOptions: {},
complete: {}
}
})
// listen to workflow events
workflow.on('started', () => console.debug('workflow started'))
workflow.on('step', () => console.debug('new step is mounted', workflow.current))
workflow.on('error', ({ error }) => console.error(error))
workflow.on('end', () => {
workflow.off() // remove all events
console.debug('workflow ended with data', workflow.data)
})
workflow.start()
// ... at some point in your code
// update the current step's data
workflow.current.update({ some: 'data' })
// or complete the current step, causing
// workflow to move to the next step or end
workflow.current.complete()
```
### Extensions
The real power of Tinyflow is it's ability to easily extend functionality.
For this, there are two main methods (in fact, the `Tinyflow` object in `core` contains only them):
#### `Tinyflow.extend` - Extend `Tinyflow` and it's very internals
As a very simple example, we can create an id function that uses the Browser's crypto API to generate uuids:
```js
const restoreId = Tinyflow.extend(internals => {
const original = internals.id
internals.id = () => window.crypto.randomUUID()
// calling this method will rstore the default id generation
return () => {
internals.id = original
}
})
const wf = new Workflow({ name: 'foo', steps: { one: {} }})
wf.id // "54b281b4-6ee1-4747-97a5-46543f71f359"
// call he restore function if your extension
// should exist only for a limited time
restoreId()
```
As you can see, all internals remain scoped within that function (unless you intend to do fancy stuff...).
#### `Tinyflow.use` - Create a workflow runtime extension that executes, before a workflow or step startes
As a very simple example for this one, we can create a simple
#### More Examples
We have more examples ready in [our documentation's examples section](./docs/examples).
Some of them can be executed directly in the browser or using node/deno/bun.
#### New Core Extensions
Some extensions might not be ready to be published yet.
They are currently located the in the [/next folder](./next).
If you think you have a good idea for a core extension,
then please open an issue and choose the issue template for extensions.
### Events
The `core` package brings two main classes that emit several events during the engine execution.
#### Workflow Class Events
| Name | Info | Data |
|-----------|----------------------------------------------------------------------------------------------------------|------|
| `started` | fired when the workflow has started, after all extensions were executed without error |
| `step` | fired when a new step has entered | the workflow's `data` property will contain the data from the previous step at this point
| `end` | fired when the workflow ended; read the workflow state to know whether it ended by complete or by cancel | the workflow's `data` property will contain all steps data
| `error` | fired when an error has been caught |
#### Step Class Events
| Name | Info | Data |
|----------|--------------------------------------------------------------------------------------------------|------|
| `started` | fired when the step has started, after all extensions were executed without error |
| `update` | fired when a step has received new data via `update` | the `data` will contain the latest updated data
| `end` | fired when the step ended; read the it's `state` to know whether it ended by complete or by cancel | the step's `data` property will contain all steps final data
| `error` | fired when an error has been caught |
## Covered environments
Our goal is to Tinyflow executable in as many environments as possible.
The following list shows, what's currently covered:
| Environment | latest versions | known issues |
|--------------------|-----------------|--------------|
| Node.js | | |
| Deno | | |
| Bun | | |
| Cloudflare workers | | |
| Browser | tested versions | known issues |
|-----------------|-----------------|--------------|
| Chrome | | |
| Safari | | |
| Safari (iOS) | | |
| Firefox | | |
| Opera | | |
| Android Webview | | |
| ... | | |
You can help out with testing for these environments, so we can maximize the compatibility overall.
## File sizes
Tinyflow comes with a minimal core but also provides extensions out-of-the-box.
At the same time we build Tinyflow for multiple outputs.
The following table shows the size of the various builds, available in their respective `/dist` folders.
Note, that this overview shows only the sizes for the minified versions of each, excluding sourcemaps.
| package | mjs | cjs | es5 | iife |
|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|------|
| `@tinyflow/core` | ![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Fcore%2Fdist%2FTinyflow.min.mjs) | ![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Fcore%2Fdist%2FTinyflow.min.cjs) | ![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Fcore%2Fdist%2FTinyflow.es5.min.js) |![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Fcore%2Fdist%2FTinyflow.iife.min.js)
| `@tinyflow/instances` | ![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Finstance%2Fdist%2FwithInstances.min.mjs) | ![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Finstance%2Fdist%2FwithInstances.min.cjs) | ![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Finstance%2Fdist%2FwithInstances.es5.min.js) |![GitHub file size in bytes](https://img.shields.io/github/size/tinyflowjs/tinyflow/packages%2Finstance%2Fdist%2FwithInstances.iife.min.js)
## Contribution and Development
We provide an [extensive contribution guideline](./CONTRIBUTING.md) and a [code of conduct](./CODE_OF_CONDUCT.md)
to help you in making your contribution a success!
### Tools / stack
* 🗪 [Babel](https://babeljs.io/) for transpiling
* 🪄 [Standard](https://standardjs.com/) for linting
* ⚗️ [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com) for testing
* 🔍 [c8](https://github.com/bcoe/c8) for code coverage
* 📚 [JSDoc](https://jsdoc.app/) for documentation
and [jsdoc-to-markdown](https://www.npmjs.com/package/jsdoc-to-markdown) to create docs as markdown files
* ⚡ [GitHub actions](https://github.com/features/actions) for continuous integration
* 📦 [Rollup](https://rollupjs.org) for bundling
All tools are defined as **`dev-dependencies`**!
### Development scripts
We provide a default set of dev-tools via npm scripts. Run a script via
```shell
$ npm run <command>
```
where `<command>` is one of the following available commands:
| command | description | output |
|-----------------|---------------------------------------------------|------------|
| `lint` | runs the linter in read-mode | |
| `lint:fix` | runs the linter; fixes minor issues automatically | |
| `test` | runs the tests once | |
| `test:watch` | runs the tests; re-runs them on code changes | |
| `test:coverage` | runs the tests once and creates a coverage report | `coverage` |
| `docs` | creates API documentation | `docs` |
| `build` | builds the bundles for several target platforms | `dist` |
| `build:full` | runs `build` and `docs` | see above |
## Security
Please read our [security policy](./SECURITY.md) to get to know which versions are covered.
## License
MIT, see [license file](LICENSE)
| Workflows everywhere! Minimal yet highly extendable and hackable workflow engine. | engine,javascript,nodejs,package,workflow | 2024-02-21T15:43:45Z | 2024-03-27T06:31:52Z | 2024-02-28T14:52:59Z | 1 | 35 | 43 | 0 | 0 | 2 | null | MIT | JavaScript |
Raahim2/BrightHome | main | # Bright Home Furniture - E-Commerce Website
Welcome to Bright Home Furniture, your go-to destination for high-quality furniture shopping online. This Django-powered e-commerce website allows users to explore a wide range of furniture products and place orders conveniently from the comfort of their homes.
## Live Website
Visit the live website: [Bright Home Furniture](https://brighthomesfurniture.com)
## Features
- **Product Catalog:** Browse through a diverse collection of furniture products.
- **User Accounts:** Create accounts, log in, and manage your profile.
- **Shopping Cart:** Add products to your cart and proceed to checkout.
- **Order Management:** Track the status of your orders.
- **Secure Transactions:** Ensured through Django's security features.
- **Responsive Design:** Enjoy a seamless experience on various devices.
## Technologies Used
- **Django:** The web framework for building the application.
- **HTML/CSS/JavaScript:** Frontend technologies for a user-friendly interface.
- **Django REST Framework:** Used for building APIs.
- **Database:** [Specify the database you are using, e.g., PostgreSQL].
- **Vercel:** Hosting provider for the live deployment.
## Getting Started
To run this project locally, follow these steps:
1. Clone the repository: `git clone https://github.com/yourusername/bright-home-furniture.git`
2. Install dependencies: `pip install -r requirements.txt`
3. Apply migrations: `python manage.py migrate`
4. Create a superuser account: `python manage.py createsuperuser`
5. Run the development server: `python manage.py runserver`
Visit `http://localhost:8000` in your browser to explore the local version of the website.
## Contributing
If you'd like to contribute to the development of Bright Home Furniture, please follow our [Contribution Guidelines](CONTRIBUTING.md).
## License
This project is licensed under the [MIT License](LICENSE).
## Contact
For any inquiries or support, please contact us at [support@brighthomesfurniture.com](mailto:support@brighthomesfurniture.com).
---
Happy shopping at Bright Home Furniture!
| Welcome to Bright Home Furniture, where style meets comfort! Discover an exquisite collection of high-quality furniture at your fingertips. Our Django-powered e-commerce platform offers a seamless shopping experience, allowing you to explore and order from our diverse range of furniture products online. From modern designs to classic Furniture | css,django,html,javascript,postgresql,python | 2024-01-27T11:55:07Z | 2024-02-02T15:13:52Z | null | 1 | 0 | 18 | 0 | 0 | 2 | null | null | HTML |
fernanda-avila/portfolio | main | # 👾 Portfólio
Portfólio construído com HTML, CSS e JavaScript
| Portfólio construído com HTML, CSS e JavaScript | css,html,javascript | 2024-01-27T03:18:58Z | 2024-04-16T21:34:28Z | null | 1 | 0 | 14 | 0 | 0 | 2 | null | null | HTML |
humanshu001/personal-portfolio | Humanshu-Jaglan | # Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
| My Portfolio website made using Reactjs and used CarryForms for contact form | bootstrap5,javascript,personal-portfolio,personal-website,portfolio-website,reactjs | 2024-02-11T16:45:36Z | 2024-04-29T14:53:58Z | null | 1 | 0 | 18 | 0 | 0 | 2 | null | null | JavaScript |
santhosh-vairamuthu/tickethive-dapp | main | # TicketHive - Ticket Booking Dapp
Welcome to the TicketHive - Ticket Booking Dapp! This decentralized application (Dapp) allows users to book tickets for various events and concerts securely using blockchain technology.
## Features
- **Event Listing**: Browse through a list of upcoming events and concerts.
- **Ticket Booking**: Reserve tickets for your desired events seamlessly.
- **Blockchain Integration**: Utilizes blockchain technology for secure and transparent transactions.
- **User Authentication**: Ensure secure access to user accounts.
- **Payment Options**: Support for various payment methods including cryptocurrencies.
- **Real-Time Updates**: Receive instant updates on event availability and ticket status.
## Getting Started
To get started with the Event Ticket Booking Dapp, follow these steps:
1. Clone the repository:
```
git clone https://github.com/santhosh-vairamuthu/tickethive-dapp.git
```
2. Install dependencies:
```
cd tickethive-dapp
npm install
```
3. Configure the environment:
Create a `.env` file in the root directory and provide necessary environment variables such as API keys, contract addresses, etc.
4. Run the Dapp:
```
npm start
```
5. Run the backend:
```
nodemon src/server.js
```
6. Access the Dapp:
Open your web browser and navigate to `http://localhost:3000` to access the Event Ticket Booking Dapp.
## Technologies Used
- **Blockchain**: Ethereum, Solidity
- **Frontend**: React.js
- **Backend**: Node.js (Express Framework)
- **Database**: Ethereum Blockchain
- **Smart Contracts**: Solidity
## Deployment Details
The TicketHive Dapp is deployed on the Ethereum test network using Remix IDE and MetaMask for wallet integration. The smart contract code is written in Solidity and deployed to the test network using Remix. The contract address and ABI (Application Binary Interface) are then updated in the frontend code for interaction with the deployed contract.
### Remix IDE Deployment Steps:
1. Open Remix IDE (https://remix.ethereum.org/) in your web browser.
2. Copy the smart contract code from `solidity/ticket.sol` and paste it into the Remix editor.
3. Compile and deploy the contract using the appropriate compiler version.
4. After deployment, copy the contract address and update it in the `src/Details.js` file.
5. Obtain the ABI from Remix and update it in the `src/contractABI.js` file.
### SepoliaETH Usage:
SepoliaETH is used as the Ethereum test network for deploying and testing the smart contract. It provides a sandbox environment for developers to interact with Ethereum blockchain without using real Ether.
## Additional Configurations
To make the TicketHive Dapp work seamlessly, ensure the following configurations:
- Change the ABI in Remix IDE and update it in the `src/contractABI.js` file.
- Update the contract address in the `src/Details.js` file after deployment.
- Modify the MySQL database connection details in the `src/server.js` file to match your environment.
## Files Overview
- **Smart Contract**: `solidity/ticket.sol`
- **MySQL Database Schema**: `database/schema.sql`
## Technologies Used
The TicketHive Dapp leverages a variety of technologies to provide a seamless and secure ticket booking experience:
- **Node.js**: Node.js is used for the backend server environment, providing a runtime environment for executing JavaScript code outside the browser.
- **React.js**: React.js is utilized for building the frontend user interface, allowing for the creation of dynamic and interactive components.
- **Express.js**: Express.js is a web application framework for Node.js, used to build the backend RESTful API endpoints and handle HTTP requests.
- **Web3.js**: Web3.js is a JavaScript library that interacts with Ethereum nodes, enabling communication with the Ethereum blockchain and smart contracts.
- **MySQL**: MySQL is a relational database management system used for storing and managing data related to users, events, tickets, etc.
- **Bootstrap**: Bootstrap is a front-end framework used for designing and styling responsive web pages, providing a sleek and modern user interface.
- **Solidity**: Solidity is the programming language used for writing smart contracts on the Ethereum blockchain, facilitating the execution of ticket transactions securely and transparently.
| This decentralized application (Dapp) allows users to book tickets for various events and concerts securely using blockchain technology. | blockchain,ethereum,express,javascript,mysql,nodejs,reactjs,solidity,web3js | 2024-02-24T13:21:22Z | 2024-04-29T13:54:00Z | null | 4 | 4 | 30 | 0 | 0 | 2 | null | MIT | JavaScript |
DayByDayBy/fizzbuzzers | main | # fizzbuzzers
a collection of fizzbuzz scripts and other classic code problem for a quick look at the syntax of different languages
list includes:
Fortran,
C, C++, C#,
Rust,
Java,
Javascript,
Go,
Python,
Lua,
Rockstar,
Lisp,
COBOL
oh, and a wee bit of HTML
| a collection of fizzbuzz scripts (and other exercises) in various languages | classics,fizzbuzz,golang,haskell,javascript,python,sorting | 2024-02-20T21:46:11Z | 2024-04-30T22:08:42Z | null | 1 | 3 | 103 | 0 | 0 | 2 | null | null | Python |
Thizh/TextEditor | main | # TextEditor
## Overview
TextEditor is an in-development project aimed at creating a user-friendly and feature-rich text editor using React.js. This project is currently in its early stages of development, and your feedback and contributions are highly appreciated.
## Installation
To get started with the TextEditor development environment, follow these simple steps:
1. **Clone the repository:**
```bash
git clone https://github.com/Thizh/TextEditor.git
```
2. **Navigate to the project directory:**
```bash
cd text-editor
```
3. **Install dependencies:**
```bash
npm install
```
4. **Start the development server:**
```bash
npm start
```
The TextEditor will be accessible at `http://localhost:3000` in your preferred web browser.
## Contact Information
For questions or suggestions, please reach out to us via [create an issue](https://github.com/Thizh/TextEditor/issues/new).
| web-based text editor | css3,html5,javascript | 2024-01-25T07:53:06Z | 2024-02-03T09:08:53Z | null | 2 | 0 | 11 | 0 | 0 | 2 | null | null | JavaScript |
munchedbox23/Eccommerce-OnlineShop | main | # Eccommerce-Online-Shop
![1600x1200](/Screenshots/PreviewProject.png)
## Introduction
CARA Ecommerce Website is a responsive online shopping platform built entirely on standard JavaScript, HTML and CSS. This repository contains the front-end of the website, providing a seamless shopping experience for users on various devices.
## Setup
Make sure to install the dependencies:
```bash
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
```
Build the application for production:
```bash
# npm
npm run build
# pnpm
pnpm run build
```
## Installation (Windows)
1. Cloning a repository
```https://github.com/munchedbox23/Eccommerce-OnlineShop.git```
2. Going to the directory ```cd src```
3. Run the local database as a json file and go to the data folder
```bash
# npx
cd src/data
npx json-server data.json
```
4. Start the development server on `http://localhost:4200`:
```bash
# npm
npm run start
# pnpm
pnpm run start
```
Webpack option for start server:
```bash
devServer: {port: 4200},
```
## Screenshots
`Shop Page`
![image](/Screenshots/shopPage.png)
`Cart with Products`
![image](/Screenshots/cart.png)
`Contact Page`
![image](/Screenshots/contact1.png)
![image](/Screenshots/contactForm.png)
`banners`
![image](/Screenshots/banners.png)
## Adaptive layout
`iPadMini`
![image](/Screenshots/iPadMini.png)
`iPadPro`
![image](/Screenshots/iPadPro.png)
`iPhone12Pro`
![image](/Screenshots/iPhone12Pro.png)
| CARA Ecommerce Website is a responsive online shopping platform built entirely on standard JavaScript, HTML and CSS. This repository contains the front-end of the website, providing a seamless shopping experience for users on various devices. | css,html,javascript,webpack | 2024-01-29T14:49:31Z | 2024-03-07T16:46:46Z | null | 1 | 1 | 11 | 0 | 0 | 2 | null | null | HTML |
tderflinger/chi-country-facts | main | ![Chi logo](./docs/chi.png)
![Chi screenshot](./docs/screenshot-chi.png)
# chi-country-facts
This projects takes the JSON data from the World Factbook and loads it into a MongoDB database.
Once loaded, you can query the country facts via the MongoDB API.
Additionally, there is a GraphQL API to query the data. This opens up possibilities to
learn about the countries of the world.
This project uses the [https://github.com/factbook/factbook.json](https://github.com/factbook/factbook.json)
project as the source of the data.
## Why chi-country-facts
In Swahili, "nchi" means country. Since this project is about the facts of countries, we chose the name "chi-country-facts".
## Running
There is a [Docker image available on Docker Hub](https://hub.docker.com/r/tderflinger/chi-country-facts). You can run the application using the following docker-compose-prod.yml file:
docker-compose-prod.yml:
```yaml
version: '3'
services:
app:
image: tderflinger/chi-country-facts:0.1.0
ports:
- "4000:4000"
depends_on:
- db
environment:
- MONGO_URL=mongodb://db:27017/CountryFacts
db:
image: mongo:latest
volumes:
- mongodb_data:/data/db
volumes:
mongodb_data:
```
Run it with the following command:
```bash
docker compose -f ./docker-compose-prod.yml up
```
This will retrieve the image from Docker Hub and create a local Mongo DB database. Then you can access the Apollo GraphQL Sandbox via the following URL: [http://localhost:4000](http://localhost:4000).
## Development
Clone the [https://github.com/factbook/factbook.json](https://github.com/factbook/factbook.json) project into the same directory as this project.
## Mongo DB Database
There is a Docker Compose file (docker-compose.yml) in the project to run the GraphQL server together with the MongoDB database.
Start with:
```bash
docker compose up
```
At the first start the JSON factbook data is loaded into the MongoDB database.
Then you can access the Apollo Studio Sandbox by opening the following URL in your browser: http://localhost:4000
Inside the Apollo Studio Sandbox you can query the data.
## GraphQL API
If you want to start the GraphQL server without Docker, you can do so with the following command:
```bash
npm run start
```
Note, that you need to specify your MongoDB URL in the `MONGO_URL` environment variable (.env file).
## Exporting Data
Once the data is loaded in the MongoDB database you can export the data to a JSON file using the following command:
```bash
node export.mjs
```
There is also the possibility to export, clean and normalize some data about the economy of the countries using the following command:
```bash
node export-economy-csv.mjs
```
The resulting file is a CSV file (countries-economy.csv) which can be further analyzed, for example using Excel or Pandas.
## License
MIT License
| Query and analyze World Factbook country facts via a GraphQL API. Uses MongoDB for data storage. | countries,data-science,economy,javascript,mongodb,opendata,world,graphql,node,geography | 2024-03-02T18:42:59Z | 2024-05-20T13:39:24Z | null | 1 | 0 | 25 | 0 | 0 | 2 | null | null | JavaScript |
sebnozzi/miniscript-web-term | main | # MiniScript Web-Terminal
MiniScript terminal for the Web.
![Screenshot of terminal styles](./screenshot.png)
It allows you to write [MiniScript](https://miniscript.org/) programs that run on a web-terminal. Intrinsics like `print` and `input` interact directly with the terminal.
The terminal component is [xterm.js](http://xtermjs.org/). As such it supports all [escape sequences](http://xtermjs.org/docs/api/vtfeatures/) that xterm.js is capable of.
The [MiniScript implementation](https://github.com/sebnozzi/miniscript.ts) is extended to supports module `import` (either local modules or "lib" modules). Included are the [same modules](https://github.com/JoeStrout/miniscript/tree/master/MiniScript-cpp/lib) as "command-line" MiniScript.
## Usage
Download one of the latest [releases](https://github.com/sebnozzi/miniscript-web-term/releases) (the file `miniscript-web-term.zip`).
It consists of an "index.html" page and additional files / folders, among them the "lib" folder with "command-line" MiniScript modules.
Put your MiniScript files directly in the root folder or under a sub-folder of your choice.
Change "data-src-file" in "index.html" (on the "body" element) to point to
the entry file of your program.
For example, if you put it in the root folder it would read:
```html
<body data-src-file="myProgram.ms">
```
And if you put it in a sub-folder it would read:
```html
<body data-src-file="src/myProgram.ms">
```
You can then serve the contents locally (e.g. with `python3 -m http.server 8000`) or zip them and upload somewhere (e.g. to itch.io).
Feel free to explore the [example folder](./example) folder. You might want to remove it before publishing.
## Publishing
In order to "publish" a project (e.g. to [itch.io](https://www.itch.io)) you probably need to create a zip file containing the following:
* index.html
* the "dist/" folder
* the "lib/" folder (to use built-in modules)
* any other files / folders that your project uses
(in particular your MiniScript source files)
Remember to adapt "index.html" accordingly.
## Terminal Options
You can set / change the terminal options by declaring a (window) global `terminalOptions` variable according to the [ITerminalOptions](https://xtermjs.org/docs/api/terminal/interfaces/iterminaloptions/) and [ITerminalInitOnlyOptions](https://xtermjs.org/docs/api/terminal/interfaces/iterminalinitonlyoptions/) interfaces.
For example:
```javascript
window.terminalOptions = {
theme: {
background: "#191A19",
foreground: "#F5F2E7",
},
fontSize: 16,
cursorStyle: "block"
};
```
The included "index.html" already sets some options, so that you only need to adapt them as needed.
You can even remove the whole "script" section. In that case the default options will apply.
## Building from source
To build from source make sure you have [Node.js](https://nodejs.org) installed.
Then from the project's root folder:
```
npm install
npm run build
```
Once build you can serve the contents locally.
## Serve locally
To serve locally, your could use Python's built-in web-server:
```
python3 -m http.server 8000
```
Alternatively you could consider either of these:
* https://www.npmjs.com/package/local-web-server
* https://www.npmjs.com/package/http-server
* https://caddyserver.com/
| Web-Terminal for MiniScript | command-line,html,javascript,miniscript,terminal,typescript,web,xtermjs | 2024-02-17T00:29:30Z | 2024-04-21T13:20:11Z | 2024-04-20T22:47:29Z | 1 | 1 | 40 | 0 | 1 | 2 | null | NOASSERTION | MAXScript |
Verdenroz/GoogleFinanceAPI | master | # Google Finance API
The Google Finance API is a tool that provides financial data, including stock indices, quotes, active stocks, gainers, losers, and news. It's built with Node.js and Express, and uses web scraping to gather data from Google Finance.
## Documentation
For more detailed information about the API, including request parameters and response formats, please visit the
[API documentation site](https://gfinance-api-doc.web.app/).
## API Endpoints
The API provides the following endpoints:
- `/indices/:region?country?`: Get stock indices by a region. Optionally, specify a country with the `country` parameter.
- `/fullQuote/:symbol?exchange?`: Get full quote for a specific stock symbol and its exchange.
- `/quote/:symbol?exchange?`: Get a simple quote for a specific stock symbol and its echange.
- `/active`: Get the stocks or funds with the highest trading volume (in shares) during the current trading session
- `/gainers`: The top gaining stocks or funds (by percent change) during the current trading session
- `/losers`: The top losing stocks or funds (by percent change) during the current trading session
- `/news:symbol?:exchange?`: Get financial news related to a stock
## Rate Limiting
Please note that the API uses rate limiting to prevent abuse and ensure fair usage. Each client can make 10 requests per minute. If the rate limit is exceeded, the API will respond with a 429 status code.
If you would like to use the API for yourself, you will have to fork this repo and create your own X-API-Key as an environment variable in a .env file,deploy the project to your own firebase project.
## Deploy to Firebase
Firebase deploys my functions directory as a cloud function and hosts my docs directory. If you are forking my repo, create your own Firebase project and download the [Firebase CLI](https://firebase.google.com/docs/cli/).
Initialize firebase with `firebase init` and choose your project. Ensure that your .firebaserc and firebase.json match your project details
### Recommended Resources
- [Firebase Hosting](https://youtu.be/5n1-wQFoZtU?si=M8qkJyTWvr8cE-T8)
- [Firebase Cloud Functions](https://youtu.be/LW26kpjGl2c?si=f4dKzsUJSc7zzuK4)
| A web scraper that provides financial data such as market indices, quotes, financial news, and moving stocks. All the data is sourced from Google Finance | express,firebase,firebase-functions,firebase-hosting,google-finance,google-finance-api,nodejs,javascript | 2024-02-23T15:49:31Z | 2024-03-20T19:09:14Z | 2024-03-20T19:09:14Z | 1 | 0 | 42 | 0 | 1 | 2 | null | MIT | JavaScript |
zk-Call/zkp-hmac-communication-js | main | <div align="center">
<img src="assets/zk-Call Preview [JS].png">
</div>
<h1 align="center">zk-Call & Labs</h1>
<div align="center">
<strong>"Zero-Knowledge" Proof Implementation with HMAC Communication in JavaScript</strong>
</div>
<br />
<div align="center">
<img src="http://badges.github.io/stability-badges/dist/experimental.svg" alt="Experimental" />
</div>
<div align="center">
<sub>
Built by <a href="https://github.com/zk-Call"> zk-Call</a> :)
</sub>
</div>
<br />
# Table of Contents
- [Credits](#credits)
- [Purpose](#purpose)
- [How it Works](#how-it-works)
- [API](#api)
- [Example Usage](#example-usage)
<br>
# Credits
This repository hosts a refined implementation of [**Schnorr's Protocol**](https://en.wikipedia.org/wiki/Schnorr_signature), innovatively incorporating a state seed for enhanced security measures. While the underlying proofs may appear intricate, I aim to elucidate their functionality to the best of my ability. However, for a deeper understanding, I encourage referencing the seminal research papers underpinning this implementation, as they offer comprehensive insights.
---
![Detailed Schematic Overview of Schnorr's Protocol (Example)](assets/Schnorr's%20Protocol.png)
<br>
<br>
**For further exploration:**
[**Elliptic Curve Based "Zero-Knowledge" Proofs and Their Applicability on Resource Constrained Devices by Ioannis Chatzigiannakis, Apostolos Pyrgelis, Paul G. Spirakis, and Yannis C. Stamatiou**](https://arxiv.org/pdf/1107.1626.pdf)
---
![Detailed Schematic Overview of Elliptic Curves (Example)](assets/Elliptic%20Curve.png)
<br>
Additionally, this repository delves into the concepts of **"Zero-Knowledge" Proofs (ZKPs)** and **Hash-based Message Authentication Codes (HMACs)**. **ZKPs** are cryptographic protocols that allow one party **(the prover)** to prove to another party **(the verifier)** that a given statement is true, without revealing any additional information beyond the validity of the statement itself. This property is particularly valuable for preserving privacy while establishing trust.
<br>
On the other hand, **HMACs** are a type of cryptographic hash function used for message authentication. They involve a cryptographic hash function **(such as SHA-256)** and a secret cryptographic key. **HMACs** provide a way to verify both the data integrity and the authenticity of a message, ensuring that it has not been altered or tampered with during transmission and that it indeed originates from the purported sender.
<br>
<br>
# Purpose
In today's rapidly evolving IT and application development landscape, **"Zero-Knowledge" Proofs (ZKPs)** emerge as a pivotal paradigm for authentication security. Their capacity to affirm the validity of a claim, such as proving possession of a secret password — without revealing any sensitive information about the claim itself, such as passwords or hashes, revolutionizes the assurance of secure **AAA operations** (**authentication**, **authorization**, and **accounting**).
---
![The Purpose of our Repositories and The Overall Technology](assets/Purpose-1.png)
<br>
**zk-Call & Labs** represents an implementation of a [**Non-Interactive "Zero-Knowledge" Proof**](https://en.wikipedia.org/wiki/Non-interactive_zero-knowledge_proof) **(NIZKP)** protocol tailored specifically for validating text-based secrets. This framework proves invaluable for safeguarding passwords and other authentication mechanisms, ensuring robust security measures without compromising privacy. Additionally, the integration of **HMAC (Hash-Based Message Authentication Code)** further fortifies the authentication process, enhancing data integrity and thwarting potential security breaches.
<br>
<br>
# How It Works
The authentication protocol employed in this system operates based on two fundamental concepts:
**"Zero-Knowledge" Proofs (ZKPs)** and **Hash-Based Message Authentication Code (HMAC)**. Let's delve into each of these components and understand how they synergize to ensure secure authentication in messaging applications.
<br>
"Zero-Knowledge" Proofs (ZKPs)
---
#### **"Zero-Knowledge" Proofs (ZKPs):**
**ZKPs** form the bedrock of privacy-preserving authentication mechanisms. These proofs allow one party **(the prover)** to demonstrate the validity of a claim to another party **(the verifier)** without revealing any additional information beyond the claim's validity. In essence, **ZKPs** enable authentication without the need for the prover to disclose sensitive data, such as passwords or cryptographic keys.
---
![Detailed Schematic Overview of "Zero-Knowledge" Technology (1)](assets/ZKP-HMAC-1.png)
![Detailed Schematic Overview of "Zero-Knowledge" Technology (2)](assets/ZKP-HMAC-2.png)
![Detailed Schematic Overview of "Zero-Knowledge" Technology (3)](assets/ZKP-HMAC-3.png)
![Detailed Schematic Overview of "Zero-Knowledge" Technology (4)](assets/ZKP-HMAC-4.png)
<br>
#### **Application in Authentication:**
In the context of messaging applications, **ZKPs** play a pivotal role in verifying a user's identity without the need to transmit explicit credentials over the network. Instead, users can generate cryptographic proofs attesting to their identity or possession of certain credentials without exposing those credentials themselves. This ensures that sensitive information remains confidential during the authentication process, bolstering security and privacy.
<br>
<br>
Hash-Based Message Authentication Code (HMAC)
---
#### **Hash-Based Message Authentication Code (HMAC):**
**HMAC** provides a robust mechanism for verifying the integrity and authenticity of messages exchanged between parties. It involves the use of a cryptographic hash function in conjunction with a secret key to generate a unique code **(the HMAC)** for each message. This code serves as a digital signature, allowing the recipient to verify that the message has not been tampered with or altered during transmission.
---
![Detailed Schematic Overview of HMAC Encryption](assets/HMAC.png)
#### **Application in Authentication:**
In messaging applications, **HMAC** can be employed to authenticate message senders and ensure the integrity of communication channels. By appending an **HMAC** to each message using a shared secret key, both the sender and recipient can validate the message's authenticity upon receipt. Any unauthorized modifications to the message would result in a mismatch between the **computed HMAC** and the **received HMAC**, thereby alerting the recipient to potential tampering.
<br>
<br>
Synergistic Operation
---
When combined, **"Zero-Knowledge" Proofs** and **HMAC** create a formidable framework for secure authentication in messaging applications. **ZKPs** facilitate identity verification without divulging sensitive information, while **HMAC** ensures the integrity and authenticity of messages exchanged between parties. Together, these mechanisms uphold the confidentiality, integrity, and authenticity of communication channels, safeguarding users' privacy and security in the digital realm.
---
![The Advantages of Synergy between "Zero-Knowledge" Proof and HMAC](assets/Synergistic%20Operation.png)
<br>
<br>
# API
The **`"Zero-Knowledge"`** JavaScript API is meant to be simple and intuitive:<br>
## Core Components
The **`Core Components`** are key for establishing a secure and efficient framework for cryptographic protocols; streamlining the creation and validation of **"Zero-Knowledge" Proofs (ZKPs)**. They enhance anonymous, data-safe proof validations.
![Detailed Schematic Overview of Core Components](assets/Core%20Components%20(JS).png)
---
#### ZeroKnowledge.models.ZeroKnowledgeParams
The parameters **used to initialize the "Zero-Knowledge"** crypto system.
class ZeroKnowledgeParams(NamedTuple):
"""
Parameters used to construct a Zero-Knowledge Proof state, utilizing an elliptic curve and a random salt
"""
algorithm: str # Hashing algorithm name
curve: str # Standard Elliptic Curve name to use
s: int # Random salt for the state
#### ZeroKnowledge.models.ZeroKnowledgeSignature
A **cryptographic "Zero-Knowledge"** signature that can be used to verify future messages.
class ZeroKnowledgeSignature(NamedTuple):
"""
Cryptographic public signature designed to verify future messages
"""
params: ZeroKnowledgeParams # Reference ZeroKnowledge Parameters
signature: int # The public key derived from your original secret
#### ZeroKnowledge.models.ZeroKnowledgeProof
A **cryptographic proof** that can be verified against a signature.
class ZeroKnowledgeProof(NamedTuple):
"""
Non-deterministic cryptographic Zero-Knowledge Proof designed to confirm that the
private key creating the proof matches the key used to generate the signature
"""
params: ZeroKnowledgeParams # Reference ZeroKnowledge Parameters
c: int # The hash of the signed data and random point, R
m: int # The offset from the secret `r` (`R=r*g`) from c * Hash(secret)
#### ZeroKnowledge.models.ZeroKnowledgeData
**Wrapper** that contains **a proof and the necessary data** to validate the proof against a signature.
class ZeroKnowledgeData(NamedTuple):
"""
Wrapper designed to hold data along with its corresponding signed proof
"""
data: Union[str, bytes, int]
proof: ZeroKnowledgeProof
---
## ZeroKnowledge
The **`ZeroKnowledge`** class is the central component of **`ZeroKnowledge`** and its state (defined by **`ZeroKnowledgeParams`**) should be inherently known to both the **Client (Prover)** and **Server (Verifier)**.
![Comprehensive Visual Guide to ZeroKnowledge Framework](assets/ZeroKnowledge%20(JS).png)
---
#### Instance Methods
<table>
<tr>
<th width="9%">Method</th>
<th width="46%">Params</th>
<th width="10%">Role</th>
<th width="35%">Purpose</th>
</tr>
<tr>
<td><code>create_signature</code></td>
<td><code>secret: Union[str, bytes]</code></td>
<td>Prover</td>
<td>Create a cryptographic <code>signature</code> derived from the value <code>secret</code> to be generated during initial registration and stored for subsequent <code>challenge</code> proofs.</td>
</tr>
<tr>
<td><code>sign</code></td>
<td><code>secret: Union[str, bytes]</code> <br /> <code>data: Union[str, bytes, int]</code></td>
<td>Prover</td>
<td>Create a <code>ZeroKnowledgeData</code> object using the <code>secret</code> and any additional data.
</tr>
<tr>
<td><code>verify</code></td>
<td><code>challenge: Union[ZeroKnowledgeData, ZeroKnowledgeProof]</code> <br /> <code>signature: ZeroKnowledgeSignature</code> <br /> <code>data: Optional[Union[str, bytes, int]]</code></td>
<td>Verifier</td>
<td>Verify the user-provided <code>challenge</code> against the stored <code>signature</code> and randomly generated token to verify the validity of the <code>challenge</code>.</td>
</tr>
</table>
---
# Example Usage
TODO: Include **`Example Usage`**
## Example 1
import {HMACClient} from './src/HMAC/core/base.mjs';
import {SeedGenerator} from './src/SeedGeneration/core/base.mjs';
// DEBUG constant used for enabling/disabling debugging messages
const DEBUG = true;
// Function to print messages with specific formatting if DEBUG is enabled
function printMsg(who, message) {
if (DEBUG) {
console.log(`[${who}] ${message}\n`);
}
}
// The main function of the script
function main() {
// Generating a client seed using a SeedGenerator instance
const client_seed = new SeedGenerator("job").generate();
// Creating an HMAC client instance for the client using sha256 algorithm and the generated seed
const client_hmac = new HMACClient("sha256", client_seed, 1);
// Creating an HMAC server instance for the server using sha256 algorithm and the same generated seed
const serverhmac = new HMACClient("sha256", client_seed, 1);
// Checking if the encrypted message from client and server matches
if (client_hmac.encrypt_message('') === serverhmac.encrypt_message('')) {
// Defining a message to be sent from client to server
const client_message = 'hello';
// Encrypting the client message in chunks using the client HMAC instance
const client_encrypted_message_for_server = client_hmac.encrypt_message_by_chunks(client_message)
// Printing a message indicating that client has sent an encrypted message
printMsg('client', 'sent has encrypted message')
// Decrypting the message received from client by the server using server HMAC instance
const server_decrypted_message = serverhmac.decrypt_message_by_chunks(client_encrypted_message_for_server)
// Printing a message indicating that server has decrypted the message
printMsg('server', 'server has decrypt message')
// Encrypting the decrypted message by the server
const server_response = serverhmac.encrypt_message(server_decrypted_message)
// Printing a message indicating that server has encrypted the message
printMsg('server', 'server has encrypted message')
// Checking if the encrypted message from client matches the server's response
if (client_hmac.encrypt_message(client_message) === server_response) {
// Printing a message indicating that server has successfully read the message from client
printMsg('client', 'server has read message')
}
}
}
// Calling the main function to start the script execution
main()
---
## Example 2
// Importing necessary modules
import { ZeroKnowledge } from "./src/ZeroKnowledge/core/base.mjs"; // Importing ZeroKnowledge class
import { ZeroKnowledgeData } from "./src/ZeroKnowledge/models/base.mjs"; // Importing ZeroKnowledgeData class
// DEBUG constant used for enabling/disabling debugging messages
const DEBUG = true;
// Function to print messages with specific formatting if DEBUG is enabled
function printMsg(who, message) {
if (DEBUG) {
console.log(`[${who}] ${message}\n`); // Print formatted message
}
}
// The main function of the script
function main() {
// Generating a client seed using a SeedGenerator instance
const server_password = "SecretServerPassword"; // Define server password
// Creating ZeroKnowledge instances for server and client
const server_object = ZeroKnowledge.new("secp256k1", "sha3_256"); // Initialize server ZeroKnowledge instance
const client_object = ZeroKnowledge.new("secp256k1", "sha3_256"); // Initialize client ZeroKnowledge instance
// Creating signatures for server and client
const server_signature = server_object.create_signature(server_password); // Generate server signature
printMsg("Server", `Server signature: ${server_signature}`); // Print server signature
const idenity = 'John'; // Define client identity
const client_sig = client_object.create_signature(idenity); // Generate client signature
printMsg("Client", `Client signature: ${client_sig}`); // Print client signature
// Signing and generating token for server and client
const server_token = server_object.sign(server_password, client_object.token()); // Sign and generate token for server
printMsg("Server", `Server token: ${server_token}`); // Print server token
const client_proof = client_object.sign(idenity, server_token.data); // Sign token data for client
printMsg("Client", `Client proof: ${client_proof}`); // Print client proof
// Creating ZeroKnowledgeData instance for token verification
const token_veif = new ZeroKnowledgeData(client_proof.data, client_proof.proof);
// Verifying the token against server signature
const server_verif = server_object.verify(token_veif, server_signature); // Verify token against server signature
printMsg("Server", `Server verification: ${server_verif}`); // Print server verification
}
// Calling the main function to start the script execution
main();
---
## Example 3
// Importing necessary modules
import {ZeroKnowledge} from "./src/ZeroKnowledge/core/base.mjs"; // Importing ZeroKnowledge class
import {ZeroKnowledgeData} from "./src/ZeroKnowledge/models/base.mjs";
import {SeedGenerator} from "./src/SeedGeneration/core/base.mjs";
import {HMACClient} from "./src/HMAC/core/base.mjs"; // Importing ZeroKnowledgeData class
// DEBUG constant used for enabling/disabling debugging messages
const DEBUG = true;
// Function to print messages with specific formatting if DEBUG is enabled
function printMsg(who, message) {
if (DEBUG) {
console.log(`[${who}] ${message}\n`); // Print formatted message
}
}
// The main function of the script
function main() {
// Generating a client seed using a SeedGenerator instance
const server_password = "SecretServerPassword"; // Define server password
// Creating ZeroKnowledge instances for server and client
const server_object = ZeroKnowledge.new("secp256k1", "sha3_256"); // Initialize server ZeroKnowledge instance
const client_object = ZeroKnowledge.new("secp256k1", "sha3_256"); // Initialize client ZeroKnowledge instance
// Creating signatures for server and client
const server_signature = server_object.create_signature(server_password); // Generate server signature
printMsg("Server", `Server signature: ${server_signature}`); // Print server signature
const idenity = 'John'; // Define client identity
const client_sig = client_object.create_signature(idenity); // Generate client signature
printMsg("Client", `Client signature: ${client_sig}`); // Print client signature
// Signing and generating token for server and client
const server_token = server_object.sign(server_password, client_object.token()); // Sign and generate token for server
printMsg("Server", `Server token: ${server_token}`); // Print server token
const client_proof = client_object.sign(idenity, server_token.data); // Sign token data for client
printMsg("Client", `Client proof: ${client_proof}`); // Print client proof
// Creating ZeroKnowledgeData instance for token verification
const token_veif = new ZeroKnowledgeData(client_proof.data, client_proof.proof);
// Verifying the token against server signature
const server_verif = server_object.verify(token_veif, server_signature); // Verify token against server signature
printMsg("Server", `Server verification: ${server_verif}`); // Print server verification
if (server_verif) {
// Generating a client seed using a SeedGenerator instance
const client_seed = new SeedGenerator("job").generate();
// Creating an HMAC client instance for the client using sha256 algorithm and the generated seed
const client_hmac = new HMACClient("sha256", client_seed, 1);
// Creating an HMAC server instance for the server using sha256 algorithm and the same generated seed
const serverhmac = new HMACClient("sha256", client_seed, 1);
// Checking if the encrypted message from client and server matches
if (client_hmac.encrypt_message('') === serverhmac.encrypt_message('')) {
// Defining a message to be sent from client to server
const client_message = 'hello';
// Encrypting the client message in chunks using the client HMAC instance
const client_encrypted_message_for_server = client_hmac.encrypt_message_by_chunks(client_message)
// Printing a message indicating that client has sent an encrypted message
printMsg('client', 'sent has encrypted message')
// Decrypting the message received from client by the server using server HMAC instance
const server_decrypted_message = serverhmac.decrypt_message_by_chunks(client_encrypted_message_for_server)
// Printing a message indicating that server has decrypted the message
printMsg('server', 'server has decrypt message')
// Encrypting the decrypted message by the server
const server_response = serverhmac.encrypt_message(server_decrypted_message)
// Printing a message indicating that server has encrypted the message
printMsg('server', 'server has encrypted message')
// Checking if the encrypted message from client matches the server's response
if (client_hmac.encrypt_message(client_message) === server_response) {
// Printing a message indicating that server has successfully read the message from client
printMsg('client', 'server has read message')
}
}
}
}
// Calling the main function to start the script execution
main();
| "Zero-Knowledge" Proof Implementation with HMAC Communication in JavaScript | hmac,javascript,zero-knowledge,zk-call,zkproof | 2024-04-03T09:31:34Z | 2024-04-22T08:10:31Z | 2024-04-22T01:43:43Z | 3 | 1 | 16 | 0 | 227 | 1,095 | null | MIT | JavaScript |
Abhay5855/Mission-frontend | master | # Mission Frontend
A curated list of Javascript, React, Machine coding problems, Pattern questions, basic backend knowledge and fundamentals questions all in one.
## HTML and CSS3
- Difference between innerText and textContent.
- What is the use of data attribute.
- Difference between loading lazy and loading eager on img tag.
- Semantic and non-semantic elements.
- Difference between rem, em and px.
- make cards responsive (display vertical in column), when screen size changes to lower resolution - without using media query.
- Difference between max-width and min-width.
- Why should you use border:transparent instead of border:none.
- How to check which HTML version are you using.
- Difference between HTML4 and HTML5.
- When to use Tailwind, CSS, SCSS and difference among them.
- What are pseudo classes.
- Difference between inline and block elements.
- Problem statement: Add a background image and a text above it, add opacity to background image -> Adding opacity to the background image should not affect the text above it.
- What is difference between display:none and display:hidden.
- Flex and Grid which layout approach should you use and when to use.
- Media Queries.
## Javascript
- What is difference between async and defer, which is better.
- Problem statement : Explaing what is debouncing with an example, I just created a normal function that logs "click" after 2sec, even if multiple times button is called, followup question was If the same function that logs "clicked", is called with timeout lesser than the debounced function which should run first, if the less timeout function runs first abort it and call the debounced function first (Asked for SDE-1).
- What is interface and can we add methods in the Interface.
- SOLID Principles (Highly asked question)
- Problem statement : Create a polyfill for array.map() method and Promise.all()
- What are call, apply and bind methods.
- Explain abstraction using Javascript, how will you create private variables and methods.
- Pass by value and pass by reference output based questions.
- What is callback hell, how to prevent it.
- If Promises also forms Promise chaining how is it different from callback hell then, and what can you do to prevent both promise chaining and callback hell.
- What are falsy values in Javascript.
- Difference between undefined and null.
- Problem statement: Implement and Explain Event bubbling with an example.
- Difference between forEach and map method.
- What are the features introduced in ES6 and ES5.
- What is shadow DOM , DOM
- Type conversion - output based questions.
- Event loop - Microtask and Macrotask queue.
- What are constructors in JS.
- What methods will you use to compare two objects are equal or not.
- What is currying.
- Problem statement : Create a infinite currying function.
- Except this keyword what other things are there that arrow function does not have.
- We cannot reassign or redeclare a variable to const declaration, but in the case of array/object how is this possible?
- What is an IIFE
- Problem Statement: Write a function to create an object from a string
```
IP - "x.y.z", "convert"
OP - {a: {b: {c: "convert"}}}
```
- Difference between preventDefault and stopPropagation.
- Write a JS func that takes an obj and a callback, execute the callback after 3 sec.
- Create a function that takes 3 arguments function, interval, and frequency. the function should execute as many times as the frequency
we passed and there should be a delay equal to the interval
we passed. For eg our(() => console.log("hi"), 2, 3)
should print "hi" 3 times with a gap of 2 seconds between each execution.Add up to this, the user should have control to terminate the callback function. Suppose we are pinging the server and if we get the response we should stop executing the function.
- this, call, bind , apply and their polyfills.
- Difference between == and ===
- Exception handling
- Difference between i++ and ++i.
- What happens when you fetch an api, and what role does dns play in this.
## Machine coding questions - (vanilla JS/ React)
- Show a button that will show start label on click it should show stop, viceversa show a counter with 0, after clicking start it should increment the counter by 1 every one second, on click of stop it should stop the counter and resume again where it was stopped previously.
- Given an API returning a list of todos, we want to fetch the list, create a separate block for each user, and display their todos in the appropriate block. Use this endpoint URL to get the todos: https://dummyjson.com/todos?limit=10&skip=80. It will return the following structure with a total of 10 todos: { “todos”: [ { “id”: 1, “todo”: “Do something nice for someone I care about”, “completed”: true, “userId”: 26 }, ], } Each block should contain the userId as the title of the block and the list of todos.
- Create 2 mock API’s which returns a list of students and each student has a name, some marks and a unique registration ID. Data from the 2 API’s can have common students i.e. mock API 1 can have a student as — ABC / 98% / 1234 (name / marks / registration ID) and this same data can be there in mock API 2 response as well. Now after creating these 2 API’s using Promises and hard-coded data, you need to merge the data coming from both API’s and have to delete the duplicates.
- Using this API endpoint - https://dummyjson.com/products, Display the data in a list with a checkbox and button delete with each item, Before displaying the items, add a feild completed: false in the JSON, It should be able to delete the item on click of delete button, on click of checkbox it should mark the item as completed with line-through to the item marking it as complete.
- Implement pagination using this API endpoint - https://dummyjson.com/products,
```
1.It should display 10 items on each page.
2. The page which is active should show active state.
3. It should have forward and Previous arrow on which we can change the page number.
4. Handle loading state on each page change.
5. When it's the first page the previous button should be disabled, similarly for last page.
```
- https://dummyjson.com/products using this API, display products, create a sidebar Just like Flipkart UI, show checkboxes with label - 40% and more, 50% and more, 60% and more, 70% and more, When click on particular checkboxs it should filter the products according to the discount percentage, If no products available show a display message accordingly, there should also be a button to clear the selection of selected percentage, render the UI accordingly.
- Create a multi-step form, where next and previous button are there on the last page user should be able to submit the form, on previous click the data entered should be persisted.
- Create a stopwatch display in this format - HH:MM:SS, with three buttons start, stop and reset, it should update the seconds every one second, after 60 sec update to 1 minute after 60min, update to 1hr, on stop button it should stop the watch and should be able to start again, on reset it should reset all values.
- Implement a stack structure
```
1. Create a UI that resembles stack
2. Add Input that accepts number.
3. push button : Add an element to the top of the stack.
4. pop button : Remove the topmost element from the stack.
5. create a function isEmpty : Checks whether the stack is empty.
6. create a function top : Displays the topmost element of the stack.
```
- Impelement a previous and next functionality, create a button increment, display initial count to 0, when Increment is clicked it should show two text -
```
1. Current : that will display the incremented count.
2. Previous : This will show the previous value that was before incrementing the count.
```
- Build an input box and a button to store items in an array, and have another button to find the second largest element from the stored array. Also, the array of items should be displayed along with the second-largest number.
- Create a reusable input component that will accept type as a prop
and will do different types of input validation(if the type is text it should contain max x no. of characters if a type is a number it should be between x and y etc.) depending upon the type we passed. As soon as something invalid is entered, an error should dynamically show on screen and as soon as we change it to something valid, the error should also disappear.
- Implement four quadrants (just like the Microsoft logo) using react with reusability.
And after that, whenever I click on a box, it should show clicked on that particular box, and when I click on another box it should show clicked in that box and disappear in another box. ( without any code redundancy)
- Make three radio buttons with labels red, blue, and yellow and add a div below it . When I click on any radio
button the color of the div should change ,for example , if I click on red the colour should be red.
Add feature that if I click on two radio buttons the colour of div should be mixture of those colours.
- On check/uncheck of top checkbox, all checkboxes should be checked/unchecked and vice-versa.
We should be able to individualy check/uncheck checkbox from the list.
If any of the checkbox is unchecked, the top checkbox should show an intermediate symbol.
A button below the checkbox, which when clicked should console log only the Id of the checked checkbox.
- create a toast message using Javascript/ React , it should disappear automatically after 5sec.
- Create a Reusable react card, header and type is passed as props, style of that card should be determined by type of card it is through prop : like type="facebook" some style, for "twitter" some other style, some nested components inside the body of card, they should also have styles.
- Create a component which converts the input to ascii, add 10 to it and convert the same from char code.
- Validate form
name (must not be empty and less than 100 characters allow);
age (between 18-99)
email(valid email)
password(at least 8 characters)
re-password(password and re-password same)
show error message in the alert box!
- optimize the performance of a React app that displayed a large list of data, and the interviewer wanted me to explain the most efficient approach to rendering the lists.
## DSA
- Sum of digits at even places of a number.
- Recursive solution to find factorial.
- check if strings are rotational of each other.
- recursion solution to multiply without using multiply operator
- Find the maximum Occurring string from an array.
- Given an array conver it to linked list and find the head from the converted linked list.
- Flatten an array without using inbuilt js methods.
- implement recursion function to print every character of string , after that its should print "its vowel" for every vowel from string.
- let arr = [ " ( ", " } ", " ] " , " { ", " ) ", " [ " ]; to ["(", ")", "{", "}", "[", "]"]
sort the array with pairs
catch: a left brace has a high priority over right brace
so in case of left brace "(" so we have to find it first pair ")" .
- Write a function which takes an array and returns sub arrays. for eg if we pass [1, 1, 2, 2, 4, 4, 5, 5, 5] as input we should get [[1,1,2,2], [4,4,5,5,5]] as output. Basically sub array can only contain one pair of consecutive elements but those elements should repeat as many times as they repeated in original array.
- Given input :
{
"harsh" : ["cricket", "vollyball"],
"aasim" : ["cricket", "football", "ludo", "COD", "rugb", "vollyball", "Racing"],
"jignesh" : ["cycling", "cricket"],
"jimish" : ["cycling"],
"prince" : ["vollyball","football"],
"raj" : ["ludo","cricket","cycling"]
}
output :
{
"harsh, aasim":["cricket","vollyball"],
"harsh, jignesh":["cricket"],
"harsh, jimish":[],
"harsh, prince":["vollyball"],
"harsh, raj":["cricket"],
"aasim, jignesh": ["cricket"],
"aasim, jimish": ["],
"aasim, prince": ["vollyball","football],
"aasim, raj": ["ludo","cricket"],
"jignesh, jimish" : ["cycling"],
"jignesh, prince" : [],
"jignesh, raj" :["cycling"],
"prince, raj" : []
}
- Sort the array without inbuilt method.
- Binary search implementation (Find index of number present in a sorted array).
- Find the 3rd largest element in an array.
- Sort the array 1's , 2's and 3's -> [0, 1, 1, 2, ,1 , 2, 0] -> [0, 0, 1, 1,1, 2, 2]
- Given a string "{}()[}[)]" , find the valid parenthesis, if yes return true else false.
- Count the number of each character occured in string "madam".
- Remove duplicates from an array.
- Check is the string is a palimdrome.
- Reverse the string
- Capitalize first letter of each word -> "abhay is cool" => "Abhay Is Cool"
- Array methods -> Filter, map, reduce, slice, splice, sort.
- Check if the number is a palimdrome or not.
- Impement stack and it's operations.
- Write a function that converts an object into an array, where each element represents a key-value pair in the form of an array
.toArray({ shrimp: 15, tots: 12 }) ➞ [["shrimp", 15], ["tots", 12]]
- Create a function which takes an array arr of integers as an argument. This function must return another function, which takes a single integer as an argument and returns a new array.
The returned array should consist of each of the elements from the first array multiplied by the integer.
multiply([1, 2, 3])(2) ➞ [2, 4, 6]
## React
- Dependency Injection.
- What are high order components, explain with an example.
- Design patterns.
- What solid principles are followed in React.
- Presentational Components - What are pros and cons.
- Virtual Dom.
- Lazy loading and Suspense.
- what are protected routes, how will you implement that.
- Lifting the state up.
- What components will you use lazy loading.
- Controllled vs Uncontrolled components.
- Class based vs Functional based components pros and cons.
- Why does component re-render.
- useMemo and useCallback Hook differences.
- Memoisation.
- CSR VS SSR.
- how to handle image uploading -> asset optimization techniques.
- Why the key should be unique.
- Why should you use redux instead of context.
- Can redux have multiple stores, and can context have multiple context.
- Life cycle hooks.
- Difference between state and props.
- What is batching.
- what is prop drilling how can you avoid prop drilling.
- How will you structure your folder architecture - redux, helpers, utils, constants, components.
- What are reusable component - create a reusable Input component that will handle email, password, number, text at same time.
- If props are passed from parent to child and if I made some changes in props value in child will the value be affected in the Parent component.
- Why does state use previous values to update or set state.
- What are the things that can be passed in dependency array of useEffect.
- Can functions be passed in the dependency array.
- Diffrence between useLayoutEffect and useEffect which is synchronous and which is asynchronous.
- Can you use this keyword in functional component.
- Create a h2 tag with classname attached to it and display it on the screen without using JSX.
- What is babel.
- Why is React so fast.
- React VS VueJs VS Angular JS which is better and why.
- What problems does Next JS solve, that React does not.
- React is declarative or imperative library.
- What are children props.
- What is useReducer hook how is it useful instead of using useState.
- What value does useCallback hook return function or value?.
- Why is Switch used in react-router-dom.
- Create a custom useAsync hook, that will take API URL as parameter, and return loading, error, response and use this useAsync hook to fetch data.
- Why setState is asynchronous.
- What is cleanup function in useEffect where is it used.
- What are pure components.
- If child re-renders will the parent also re-render and viceversa.
- Component lifecycle.
- Does useRef hook cause re-render on change of something.
- When to use useRef and useState hook.
- Can you pass a function in the useState initial value.
- How will you handle images that takes time to load on the UI.
- How would you explain re-renders in React
- What are synthetic events.
- What are the optimization techniques to make react fast.
- What is strict mode in react.
- What is react element.
- How will you explain components.
- What are fragments in react.
- Difference between element and component in React.
- What are Error Boundaries.
- What are render props pattern.
## Basic Backend
- Rest API.
- types of Status code and what they refer to.
- Middlewares.
- Types of storage.
- Accesss token and Refresh token.
- How Authentication works.
- Difference between Sql and noSql database.
- How will you validate API.
- ContentType
- What are headers.
- What type of content can you pass in the Rest API.
- Basic Schema idea - how will you design schema.
- What is ORM and ORD.
- API Polling.
- web tokens.
- API versoning.
## Performance and Optimization
- Given list of images how would you render it effectively.
- If network is low how will you manage the video calling effectively, if there is some error in it how will you display it to the user.
- What is lazy loading and its tradeoffs.
- How code splitting actually helps to reduce the bundle size.
- Why react is faster?
- If large unused css files are there will it effect the bundle size.
- What if the font is not loading - how can you optimize it.
- Fallback image and fallback font how to use them to optimize and improve performance.
## System Design
- video call feature, how to check network connection, which protocol to use, multiple joinee, backend connection, as I had done this feature using aws chime sdk, so this was asked to me if not aws chime how will you implement it with performance optimisation.
- TCP.
- RTMP
- Video optimization techniques.
| A curated list of Javascript, React, Machine coding problems, Pattern questions, basic backend knowledge and fundamentals questions all in one. | dsa-practice,javascript,machine-coding,reactjs | 2024-03-22T11:23:41Z | 2024-04-14T18:05:58Z | null | 1 | 0 | 13 | 0 | 63 | 560 | null | null | null |
samthor/kuto | main | 🌈 Kuto makes updating your site's JS better, faster, harder, stronger.
It reduces your download size by re-using code you've already shipped.
Read more [on the blog](https://samthor.au/2024/kuto/), or watch [Theo.gg's video](https://www.youtube.com/watch?v=_sxwQBWJQHA)! 🌈
<img src="https://storage.googleapis.com/hwhistlr.appspot.com/og/kuto.jpeg" width="200" height="105" alt="Kuto tool logo" />
[![Tests](https://github.com/samthor/kuto/actions/workflows/tests.yml/badge.svg)](https://github.com/samthor/kuto/actions/workflows/tests.yml)
It does this by splitting JS files (in ESM) into 'main' and static parts.
The static parts can be cached by clients forever, as they have no side-effects, and can be used as a 'corpus' or dictionary of code that can be called later.
Chromium even caches [the bytecode](https://v8.dev/blog/code-caching-for-devs) of previously shipped files.
Ideally, Kuto operates on a large output bundle from another tool.
Think of it as doing code-splitting 'last', rather than first.
## Requirements
Node 16+.
Kuto works best on large (>1mb) singular JS bundles 'bundled' to ESM — the tool works on a statement level, and an IIFE/webpack output is one giant statement.
## Usage
You can install via "kuto" and then run `npx kuto` to learn more.
To split a JS file, you can then run:
```bash
$ kuto split yourbundle.js out/
```
This will generate a 'main' part and a corpus of code.
If you build or change "yourbundle.js" and run Kuto _again_, this will re-use the existing corpus where possible, and remove completely disused corpus files.
Note that you'll **need to keep the old generated code around** for Kuto to work.
By default, this looks in the output dir, but you can change it with a flag.
### Flags
- `-c <old>` where to find old corpus data (default: use output dir)
Normally, Kuto reads old corpus data from the output path, but this flag can be used to point to a different location.
It can also point directly to a Kuto-generated 'main' file.
This could be useful to point to the currently published version of your code.
For example:
- `-c https://example.com/source.js` to load a Kuto-generated 'main' from a real website (uses `fetch()`)
- `-c path/to/old/source/dir` to use any corpus in this dir
- `-d` dedups callables (default: `false`)
With this flag enabled, if two classes or callables are exactly the same, they'll be merged into one.
For example:
```ts
var A = class {};
var B = class {};
// will be 'true' in `-d` mode
new A() instanceof B;
```
This is turned off by default, as it can be dangerous.
Kuto will still dedup other code where it is safe to do so!
- `-m <bytes>` only yeet code which is larger than this (default: `32`)
There's overhead to splitting the static parts of your code out, so this limits the process to larger statements.
- `-k <files>` keep this number of static bundles around (default: `4`)
Kuto can create high levels of fragmentation over time.
For most sites, you'll end up with one HUGE bundle that contains the bulk of your code, dependencies, etc.
This flag sets the number of 'corpus' files to keep around, ordered by size.
(This may not actually be the best way to keep chunks around.
This flag will probably evolve over time.)
- `-n <name>` use this basename for the output (default: basename of input)
Normally, Kuto creates output files with the same name as the input files.
Instead, use this to output e.g., "index.js" regardless of source name.
## Best Practice
One good way to understand what Kuto does is to run `./release.sh`, which builds Kuto itself.
Try running a release, changing something in the source, and releasing again—you'll see extra static files appear.
This release process runs in three steps:
1. use esbuild to create one bundle (without minification)
2. use kuto to split the bundle
3. use esbuild on all resulting files, _purely_ to minify
## Notes
Kuto bundles [acorn](https://www.npmjs.com/package/acorn) to do its parsing.
There is also has a `kuto info` command to give basic information about an ES Module.
This is the origin of the tool; I wanted something that could inform me about side-effects.
Both `info` and `split` will transparently compile TS/etc via "esbuild" if installed, but it's not a `peerDependency`.
| Faster updates for big JS projects | javascript | 2024-03-16T13:49:19Z | 2024-04-18T03:26:32Z | null | 1 | 0 | 94 | 3 | 1 | 491 | null | Apache-2.0 | TypeScript |
zheksoon/dioma | main | <h1 align="center">Dioma</h1>
<p align="center">
<img src="https://github.com/zheksoon/dioma/blob/main/assets/dioma-logo.webp?raw=true" alt="dioma" width="200" />
</p>
<p align="center">
<b>Elegant dependency injection container for vanilla JavaScript and TypeScript</b>
</p>
<p align="center">
<img alt="NPM Version" src="https://img.shields.io/npm/v/dioma?style=flat-square&color=%2364d4c1&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fdioma">
<img alt="NPM package gzipped size" src="https://img.shields.io/bundlejs/size/dioma?style=flat-square&label=gzip&color=%2364d4c1">
<img alt="Codecov" src="https://img.shields.io/codecov/c/github/zheksoon/dioma?style=flat-square&color=%2364d4c1">
</p>
## Features
- <b>Just do it</b> - no decorators, no annotations, no magic
- <b>Tokens</b> for class, value, and factory injection
- <b>Async</b> injection and dependency cycle detection
- <b>TypeScript</b> support
- <b>No</b> dependencies
- <b>Tiny</b> size
## Installation
```sh
npm install --save dioma
yarn add dioma
```
## Usage
To start injecting dependencies, you just need to add the `static scope` property to your class and use the `inject` function to get the instance of it. By default, `inject` makes classes "stick" to the container where they were first injected (more details in the [Class registration](#Class-registration) section).
Here's an example of using it for [Singleton](#singleton-scope) and [Transient](#transient-scope) scopes:
```typescript
import { inject, Scopes } from "dioma";
class Garage {
open() {
console.log("garage opened");
}
// Single instance of the class for the entire application
static scope = Scopes.Singleton();
}
class Car {
// injects instance of Garage
constructor(private garage = inject(Garage)) {}
park() {
this.garage.open();
console.log("car parked");
}
// New instance of the class on every injection
static scope = Scopes.Transient();
}
// Creates a new Car and injects Garage
const car = inject(Car);
car.park();
```
## Scopes
Dioma supports the following scopes:
- `Scopes.Singleton()` - creates a single instance of the class
- `Scopes.Transient()` - creates a new instance of the class on every injection
- `Scopes.Container()` - creates a single instance of the class per container
- `Scopes.Resolution()` - creates a new instance of the class every time, but the instance is the same for the entire resolution
- `Scopes.Scoped()` is the same as `Scopes.Container()`
### Singleton scope
Singleton scope creates a single instance of the class for the entire application.
The instances are stored in the global container, so anyone can access them.
If you want to isolate the class to a specific container, use the [Container](#Container-scope) scope.
A simple example you can see in the [Usage](#Usage) section.
Multiple singletons can be cross-referenced with each other using [async injection](#async-injection-and-circular-dependencies).
### Transient scope
Transient scope creates a new instance of the class on every injection:
```typescript
import { inject, Scopes } from "dioma";
class Engine {
start() {
console.log("Engine started");
}
static scope = Scopes.Singleton();
}
class Vehicle {
constructor(private engine = inject(Engine)) {}
drive() {
this.engine.start();
console.log("Vehicle driving");
}
static scope = Scopes.Transient();
}
// New vehicle every time
const vehicle = inject(Vehicle);
vehicle.drive();
```
Generally, transient scope instances can't be cross-referenced by the [async injection](#Async-injection-and-injection-cycles) with some exceptions.
### Container scope
Container scope creates a single instance of the class per container. It's the same as the singleton, but relative to the custom container.
The usage is the same as for the singleton scope, but you need to create a container first and use `container.inject` instead of `inject`:
```typescript
import { Container, Scopes } from "dioma";
const container = new Container();
class Garage {
open() {
console.log("garage opened");
}
// Single instance of the class for the container
static scope = Scopes.Container();
}
// Register Garage on the container
container.register({ class: Garage });
class Car {
// Use inject method of the container for Garage
constructor(private garage = container.inject(Garage)) {}
park() {
this.garage.open();
console.log("car parked");
}
// New instance on every injection
static scope = Scopes.Transient();
}
const car = container.inject(Car);
car.park();
```
Container-scoped classes usually are [registered in the container](#class-registration) first. Without it, the class will "stick" to the container it's used in.
### Resolution scope
Resolution scope creates a new instance of the class every time, but the instance is the same for the entire resolution:
```typescript
import { inject, Scopes } from "dioma";
class Query {
static scope = Scopes.Resolution();
}
class RequestHandler {
constructor(public query = inject(Query)) {}
static scope = Scopes.Resolution();
}
class RequestUser {
constructor(
public request = inject(RequestHandler),
public query = inject(Query)
) {}
static scope = Scopes.Transient();
}
const requestUser = inject(RequestUser);
// The same instance of Query is used for each of them
requestUser.query === requestUser.request.query;
```
Resolution scope instances can be cross-referenced by the [async injection](#async-injection-and-circular-dependencies) without any issues.
## Injection with arguments
You can pass arguments to the constructor when injecting a class:
```typescript
import { inject, Scopes } from "dioma";
class Owner {
static scope = Scopes.Singleton();
petSomebody(pet: Pet) {
console.log(`${pet.name} petted`);
}
}
class Pet {
constructor(public name: string, public owner = inject(Owner)) {}
pet() {
this.owner.petSomebody(this);
}
static scope = Scopes.Transient();
}
const pet = inject(Pet, "Fluffy");
pet.pet(); // Fluffy petted
```
Only transient and resolution scopes support argument injection.
Resolution scope instances are cached for the entire resolution, so the arguments are passed only once.
## Class registration
By default, `Scopes.Container` class injection is "sticky" - the class sticks to the container where it was first injected.
If you want to make a class save its instance in some specific parent container (see [Child containers](#Child-containers)), you can use class registration:
```typescript
const container = new Container();
const child = container.childContainer();
class FooBar {
static scope = Scopes.Container();
}
// Register the Foo class in the parent container
container.register({ class: FooBar });
// Returns and cache the instance on parent container
const foo = container.inject(FooBar);
// Returns the FooBar instance from the parent container
const bar = child.inject(FooBar);
foo === bar; // true
```
You can override the scope of the registered class:
```typescript
container.register({ class: FooBar, scope: Scopes.Transient() });
```
To unregister a class, use the `unregister` method:
```typescript
container.unregister(FooBar);
```
After that, the class will be removed from the container and all its child containers, and the next injection will return a new instance.
## Injection with tokens
Instead of passing a class to the `inject`, you can use **tokens** instead.
The token injection can be used for **class, value, and factory** injection.
Here's detailed information about each type.
### Class tokens
Class tokens are useful to inject an abstract class or interface that has multiple implementations:
<details>
<summary><b>Here is an example of injecting an abstract interface</b></summary>
```typescript
import { Token, Scopes, globalContainer } from "dioma";
const wild = globalContainer.childContainer("Wild");
const zoo = wild.childContainer("Zoo");
interface IAnimal {
speak(): void;
}
class Dog implements IAnimal {
speak() {
console.log("Woof");
}
static scope = Scopes.Container();
}
class Cat implements IAnimal {
speak() {
console.log("Meow");
}
static scope = Scopes.Container();
}
const animalToken = new Token<IAnimal>("Animal");
// Register Dog class with the token
wild.register({ token: animalToken, class: Dog });
// Register Cat class with the token
zoo.register({ token: animalToken, class: Cat });
// Returns Dog instance
const wildAnimal = wild.inject(animalToken);
// Returns Cat instance
const zooAnimal = zoo.inject(animalToken);
```
</details>
The class token registration can also override the scope of the class:
```typescript
wild.register({ token: animalToken, class: Dog, scope: Scopes.Transient() });
```
### Value tokens
Value tokens are useful to inject a constant value:
```typescript
import { Token } from "dioma";
const token = new Token<string>("Value token");
container.register({ token, value: "Value" });
const value = container.inject(token);
console.log(value); // Value
```
### Factory tokens
Factory tokens are useful to inject a factory function.
The factory takes the current container as the first argument and returns a value:
```typescript
import { Token } from "dioma";
const token = new Token<string>("Factory token");
container.register({ token, factory: (container) => "Value" });
const value = container.inject(token);
console.log(value); // Value
```
Factory function can also take additional arguments:
```typescript
const token = new Token<string>("Factory token");
container.register({
token,
factory: (container, a: string, b): string => a + b,
});
const value = container.inject(token, "Hello, ", "world!");
console.log(value); // Hello, world!
```
As a usual function, a factory can contain any additional logic, conditions, or dependencies.
## Child containers
You can create child containers to isolate the scope of the classes.
Child containers have a hierarchical structure, so Dioma searches instances top-down from the current container to the root container.
If the instance is not found, Dioma will create a new instance in the current container, or in the container where the class was registered.
Here's an example:
```typescript
import { Container, Scopes } from "dioma";
const container = new Container(null, "Parent");
const child = container.childContainer("Child");
class ParentClass {
static scope = Scopes.Container();
}
class ChildClass {
static scope = Scopes.Container();
}
container.register({ class: ParentClass });
child.register({ class: ChildClass });
// Returns ParentClass instance from the parent container
const parentInstance = child.inject(ParentClass);
// Returns ChildClass instance from the child container
const childInstance = child.inject(ChildClass);
```
## Injection hooks
When registering a class, you can provide hooks that will be called before the instance is created or injected:
```typescript
container.register({
class: MyClass,
beforeInject: (container, descriptor, args) => {
console.log("Before inject");
},
beforeCreate: (container, descriptor, args) => {
console.log("Before create");
},
});
```
## Async injection and circular dependencies
When you have a circular dependency, there will be an error `Circular dependency detected`. To solve this problem, you can use async injection.
<details>
<summary><b>Here is an example:</b></summary>
```typescript
import { inject, injectAsync, Scopes } from "dioma";
class A {
constructor(private instanceB = inject(B)) {}
doWork() {
console.log("doing work A");
this.instanceB.help();
}
static scope = Scopes.Singleton();
}
class B {
private declare instanceA: A;
// injectAsync returns a promise of the A instance
constructor(private promiseA = injectAsync(A)) {
this.promiseA.then((instance) => {
this.instanceA = instance;
});
}
help() {
console.log("helping with work");
}
doAnotherWork() {
console.log("doing work B");
this.instanceA.doWork();
}
static scope = Scopes.Singleton();
}
const a = await injectAsync(A);
const b = await injectAsync(B);
// Wait until all promises are resolved
await globalContainer.waitAsync();
a.doWork();
b.doAnotherWork();
```
</details>
Async injection has an undefined behavior when there is a loop with transient dependencies. It may return an instance with an unexpected loop, or throw the `Circular dependency detected in async resolution` error, so it's better to avoid such cases.
As defined in the code above, you need to use `container.waitAsync()` or **wait for the next tick** to get all instance promises resolved, even if you use `await injectAsync(...)`.
Generally, if you expect your dependency to have an async resolution, it's better to inject it with `injectAsync`, as in the example above. But, you can also use `inject` for async injection as long as you wait for it as above.
Tokens also can be used for async injection as well:
```typescript
import { Token, Scopes } from "dioma";
const token = new Token<A>("A");
class B {
private declare instanceA: A;
// token in used for async injection
constructor(private promiseA = injectAsync(token)) {
this.promiseA.then((instance) => {
this.instanceA = instance;
});
}
}
```
## TypeScript
Dioma is written in TypeScript and provides type safety out of the box:
```typescript
import { inject, Scopes, Injectable } from "dioma";
// Injectable interface makes sure the static scope is defined
class Database implements Injectable<typeof Database> {
constructor(private url: string) {}
connect() {
console.log(`Connected to ${this.url}`);
}
static scope = Scopes.Singleton();
}
// Error, scope is not specified
class Repository implements Injectable<typeof Repository> {
constructor(private db = inject(Database)) {}
}
inject(Repository); // Also type error, scope is not specified
```
Also, token and class injection infers the output types from the input types.
If available, arguments are also checked and inferred.
## API Reference
### `new Container(parent?, name?)`
Creates a new container with the specified parent container and name.
### `new Token<T>(name?)`
Creates a new token with the specified type and name.
### `container.inject(classOrToken, ...args)`
Injects the instance of the class or token, and provides arguments to the constructor or factory function.
### `container.injectAsync(classOrToken, ...args)`
Injects the promise of the instance of the class or token, and provides arguments to the constructor or factory function.
### `container.waitAsync()`
Returns a promise that resolves when all current async injections are resolved.
### `container.register({ class, token?, scope? })`
### `container.register({ token, value })`
### `container.register({ token, factory })`
Registers the class, value, or factory with the token in the container.
### `container.unregister(classOrToken)`
Unregister the class or token from the container.
### `container.childContainer(name?)`
Creates a new child container with the specified name.
### Global exports
Global container:
- `globalContainer` - the global container that is used by default for the `inject` function.
- `inject` - the function to inject the instance of the class or token.
- `injectAsync` - the function to inject the promise of the instance of the class or token.
Errors:
- `DependencyCycleError` - thrown when a circular dependency is detected.
- `AsyncDependencyCycleError` - thrown when a circular dependency is detected in async resolution.
- `ArgumentsError` - thrown when the arguments are passed to unsupported scopes.
- `TokenNotRegisteredError` - thrown when the token is not registered in the container.
## Author
Eugene Daragan
## License
MIT
| Elegant dependency injection container for vanilla JavaScript and TypeScript | 1kb,awilix,dependency-injection,di,di-container,inversify,inversion-of-control,ioc,ioc-container,javascript | 2024-03-21T17:12:32Z | 2024-04-20T12:42:19Z | null | 1 | 1 | 44 | 4 | 3 | 205 | null | MIT | TypeScript |
bewcloud/bewcloud | main | # bewCloud
[![](https://github.com/bewcloud/bewcloud/workflows/Run%20Tests/badge.svg)](https://github.com/bewcloud/bewcloud/actions?workflow=Run+Tests)
This is the [bewCloud app](https://bewcloud.com) built using [Fresh](https://fresh.deno.dev) and deployed using [docker compose](https://docs.docker.com/compose/).
If you're looking for the desktop sync app, it's at [`bewcloud-desktop`](https://github.com/bewcloud/bewcloud-desktop).
If you're looking for the mobile app, it's at [`bewcloud-mobile`](https://github.com/bewcloud/bewcloud-mobile).
## Self-host it!
[![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/bewcloud/bewcloud)
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/bewcloud/bewcloud)
Or on your own machine:
Download/copy [`docker-compose.yml`](/docker-compose.yml) and [`.env.sample`](/.env.sample) as `.env`.
```sh
$ docker compose up # makes the app available at http://localhost:8000
$ docker compose run website bash -c "cd /app && make migrate-db" # initializes/updates the database (only needs to be executed the first time and on any updates)
```
Alternatively, check the [Development section below](#development).
> [!IMPORTANT]
> Even with signups disabled (`CONFIG_ALLOW_SIGNUPS="false"`), the first signup will work and become an admin.
## Development
### Requirements
- Don't forget to set up your `.env` file based on `.env.sample`.
- This was tested with [`Deno`](https://deno.land)'s version stated in the `.dvmrc` file, though other versions may work.
- For the postgres dependency (used when running locally or in CI), you should have `Docker` and `docker compose` installed.
### Commands
```sh
$ docker compose -f docker-compose.dev.yml up # (optional) runs docker with postgres, locally
$ make migrate-db # runs any missing database migrations
$ make start # runs the app
$ make format # formats the code
$ make test # runs tests
```
### Other less-used commands
```sh
$ make exec-db # runs psql inside the postgres container, useful for running direct development queries like `DROP DATABASE "bewcloud"; CREATE DATABASE "bewcloud";`
$ make build # generates all static files for production deploy
```
## Structure
- Routes defined at `routes/`.
- Static files are defined at `static/`.
- Frontend-only components are defined at `components/`.
- Isomorphic components are defined at `islands/`.
- Cron jobs are defined at `crons/`.
- Reusable bits of code are defined at `lib/`.
- Database migrations are defined at `db-migrations/`.
## Deployment
Just push to the `main` branch.
## Where's Contacts/Calendar (CardDav/CalDav)?! Wasn't this supposed to be a core Nextcloud replacement?
[Check this tag/release for more info and the code where/when that was being done](https://github.com/bewcloud/bewcloud/releases/tag/v0.0.1-self-made-carddav-caldav). Contacts/CardDav worked and Calendar/CalDav mostly worked as well at that point.
My focus was to get me to replace Nextcloud for me and my family ASAP, and it turns out it's not easy to do it all in a single, installable _thing_, so I focused on the Files UI, sync, and sharing, since [Radicale](https://radicale.org/v3.html) solved my other issues better than my own solution (and it's already _very_ efficient).
## How does file sharing work?
[Check this PR for advanced sharing with internal and external users, with read and write access that was being done and almost working](https://github.com/bewcloud/bewcloud/pull/4). I ditched all that complexity for simply using [symlinks](https://en.wikipedia.org/wiki/Symbolic_link), as it served my use case (I have multiple data backups and trust the people I provide accounts to, with the symlinks).
You can simply `ln -s /<absolute-path-to-data-files>/<owner-user-id>/<directory-to-share> /<absolute-path-to-data-files>/<user-id-to-share-with>/` to create a shared directory between two users, and the same directory can have different names, now.
> [!NOTE]
> If you're running the app with docker, the symlink needs to point to the container's directory, usually starting with `/app` if you didn't change the `Dockerfile`, otherwise the container will fail to load the linked directory.
## How does it look?
[Check the website](https://bewcloud.com) for screenshots or [the YouTube channel](https://www.youtube.com/@bewCloud) for 1-minute demos.
| A simpler alternative to Nextcloud and ownCloud, built with TypeScript and Deno using Fresh. 🦕 🍋 | deno,fresh,javascript,nextcloud,open-source,owncloud,preact,tailwindcss,typescript | 2024-03-16T08:28:53Z | 2024-05-05T07:09:34Z | 2024-05-05T07:09:34Z | 3 | 3 | 53 | 2 | 6 | 180 | null | AGPL-3.0 | TypeScript |
huaji8/huajiScript | main | # 一旦使用或复制了任何相关脚本或Script项目,则视为您已接受免责声明
# 滑稽のScript 韭菜交流:901898186
投稿或者有问题可加群or发issues!
本仓库的本删去即视为已失效,请勿就有关脚本失效问
一旦使用或复制了任何相关脚本或Script项目,则视为您已接受免责声明
Power By Huaji
## 拉库方法 About 青龙
青龙-订阅管理-填入随意名称-填入链接-定时 8 * * * *
链接可选
* https://github.com/huaji8/huajiScript.git (国外)
* https://mirror.ghproxy.com/https://github.com/huaji8/huajiScript.git (国内)
![alt](/img/qinglong.png)
## 赞助我~
| 赞助者 | 金额 | 留言or备注 | 时间 |
| ---- | ---- | ---- | ---- |
| 风里飞 | 0.5 | 感谢脚本 | 2024年4月15日 16:13:46 |
| 鏡㱋(名字真难打)| 0.5 | 感谢脚本 | 2024年4月16日 22:52:51 |
|白毛|5|Null|2024年4月26 13:10|
|南岭|0.5|棒棒哒|2024年5月12 18:23|
赞助可以让我有更多的动力更新哦!
![alt](/img/wx.jpg)
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=huaji8/huajiScript&type=Date)](https://star-history.com/#huaji8/huajiScript&Date)
## 免责声明
免责声明:
Huaji所发布的所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。 这里的脚本只是自己学习的一个实践 仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断.
Huaji对任何问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. 间接使用脚本的任何用户,包括但不限于建立VPS或在某些行为违反国家/地区法律或相关法规的情况下进行传播。
Huaji对于由此引起的任何隐私泄漏或其他后果概不负责. 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本.
任何以任何方式查看此项目的人或直接或间接使用该项目的任何脚本的使用者都应仔细阅读此声明。
本人所发布的所有文件不在包括但不限于 闲鱼/公众号 等平台发布 所发布的所有文件均不产生包括但不限于 收费/获利 等违法违规行为,因此产生纠纷/违法行为等后果均由传播者所承担 作者不负任何责任
所发布的内容仅供学习,禁止用于其他用途,您必须在下载后的24小时内从计算机或手机中完全删除以上内容.严禁产生利益链!
Huaji保留随时更改或补充此免责声明的权利。一旦使用或复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. 如您不同意,请马上删除该文件
Power by Huaji 韭菜交流:901898186
| 滑稽の青龙脚本库库 | python-script,qinglong,luguan,javascript | 2024-04-03T09:53:36Z | 2024-05-21T15:44:54Z | null | 1 | 1 | 133 | 0 | 22 | 173 | null | MIT | Python |
SuboptimalEng/volume-rendering | main | # 🌊 Volume Rendering
Volume rendering is a common technique used to render 3D medical imaging data like MRIs or CT scans. This repo contains the code for my implementation in Three.js and GLSL. Here's a 30-second demo on [Twitter](https://x.com/SuboptimalEng/status/1781808470985003035) and [Reddit](https://www.reddit.com/r/GraphicsProgramming/comments/1c9ke0p/volume_rendering_in_threejs_and_glsl/).
Huge thanks to Will Usher for his blog post on [Volume Rendering in WebGL](https://www.willusher.io/webgl/2019/01/13/volume-rendering-with-webgl).
<img src="/_demos/foot-01.png" width="100%">
<img src="/_demos/foot-02.png" width="100%">
<img src="/_demos/bonsai-01.png" width="100%">
## Setup
```
git clone https://github.com/SuboptimalEng/volume-rendering.git
cd volume-rendering/
npm install
npm run dev
```
But wait, there's more! After running these commands, you will be able to open the project in localhost. However, there will be no image rendered on screen. Why, you may ask? Simple, I did not want to upload multiple 16MB data files to GitHub. To see the demo in action, you will need to download one of these files and upload them via the UI.
- Foot - https://klacansky.com/open-scivis-datasets/foot/foot_256x256x256_uint8.raw
- Skull - https://klacansky.com/open-scivis-datasets/skull/skull_256x256x256_uint8.raw
- Bonsai - https://klacansky.com/open-scivis-datasets/bonsai/bonsai_256x256x256_uint8.raw
Note: The website I linked has tons of models, but not all of them will work. I've hard-coded this project to work with `256x256x256 uint8` files that are scaled `1x1x1`.
## References
- Will Usher's Blog Post - https://www.willusher.io/webgl/2019/01/13/volume-rendering-with-webgl
- Open Scientific Visualization Datasets - https://klacansky.com/open-scivis-datasets
- The Art of Code - https://www.youtube.com/watch?v=S8AWd66hoCo
- Inigo Quilez - https://iquilezles.org/articles/palettes/
## License
Shield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]
This work is licensed under a
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg
| 🌊 The code for my volume rendering implementation in Three.js and GLSL. | glsl,javascript,shaders,three-js,typescript,volume-rendering,dicom | 2024-04-07T14:42:08Z | 2024-04-24T22:04:02Z | null | 1 | 0 | 58 | 0 | 4 | 156 | null | NOASSERTION | GLSL |
dahlia/logtape | main | <!-- deno-fmt-ignore-file -->
LogTape
=======
[![JSR][JSR badge]][JSR]
[![npm][npm badge]][npm]
[![GitHub Actions][GitHub Actions badge]][GitHub Actions]
[![Codecov][Codecov badge]][Codecov]
> [!NOTE]
> LogTape is still in the early stage of development. The API is not stable
> yet. Please be careful when using it in production.
LogTape is a logging library for JavaScript and TypeScript. It provides a
simple and flexible logging system that is easy to use and easy to extend.
The highlights of LogTape are:
- *Zero dependencies*: LogTape has zero dependencies. You can use LogTape
without worrying about the dependencies of LogTape.
- *Library support*: LogTape is designed to be used in libraries as well
as applications. You can use LogTape in libraries to provide logging
capabilities to users of the libraries.
- *Runtime diversity*: LogTape supports Deno, Node.js, Bun, edge functions,
and browsers. You can use LogTape in various environments without
changing the code.
- *Structured logging*: You can log messages with structured data.
- *Hierarchical categories*: LogTape uses a hierarchical category system
to manage loggers. You can control the verbosity of log messages by
setting the log level of loggers at different levels of the category
hierarchy.
- *Template literals*: LogTape supports template literals for log messages.
You can use template literals to log messages with placeholders and
values.
- *Dead simple sinks*: You can easily add your own sinks to LogTape.
Currently, LogTape provides only few sinks, but [you can easily add your own
sinks.](#sinks)
![](./screenshots/web-console.png)
![](./screenshots/terminal-console.png)
[JSR]: https://jsr.io/@logtape/logtape
[JSR badge]: https://jsr.io/badges/@logtape/logtape
[npm]: https://www.npmjs.com/package/@logtape/logtape
[npm badge]: https://img.shields.io/npm/v/@logtape/logtape?logo=npm
[GitHub Actions]: https://github.com/dahlia/logtape/actions/workflows/main.yaml
[GitHub Actions badge]: https://github.com/dahlia/logtape/actions/workflows/main.yaml/badge.svg
[Codecov]: https://codecov.io/gh/dahlia/logtape
[Codecov badge]: https://codecov.io/gh/dahlia/logtape/graph/badge.svg?token=yOejfcuX7r
Installation
------------
### Deno
~~~~ sh
deno add @logtape/logtape
~~~~
### Node.js
~~~~ sh
npm add @logtape/logtape
~~~~
### Bun
~~~~ sh
bun add @logtape/logtape
~~~~
Quick start
-----------
Set up LogTape in the entry point of your application (if you are composing
a library, you should not set up LogTape in the library itself; it is up to
the application to set up LogTape):
~~~~ typescript
import { configure, getConsoleSink } from "@logtape/logtape";
await configure({
sinks: { console: getConsoleSink() },
filters: {},
loggers: [
{ category: "my-app", level: "debug", sinks: ["console"] }
]
});
~~~~
And then you can use LogTape in your application or library:
~~~~ typescript
import { getLogger } from "@logtape/logtape";
const logger = getLogger(["my-app", "my-module"]);
export function myFunc(value: number): void {
logger.debug `Hello, ${value}!`;
}
~~~~
How to log
----------
There are total 5 log levels: `debug`, `info`, `warning`, `error`, `fatal` (in
the order of verbosity). You can log messages with the following syntax:
~~~~ typescript
logger.debug `This is a debug message with ${value}.`;
logger.info `This is an info message with ${value}.`;
logger.warn `This is a warning message with ${value}.`;
logger.error `This is an error message with ${value}.`;
logger.fatal `This is a fatal message with ${value}.`;
~~~~
You can also log messages with a function call. In this case, log messages
are structured data:
~~~~ typescript
logger.debug("This is a debug message with {value}.", { value });
logger.info("This is an info message with {value}.", { value });
logger.warn("This is a warning message with {value}.", { value });
logger.error("This is an error message with {value}.", { value });
logger.fatal("This is a fatal message with {value}.", { value });
~~~~
Sometimes, values to be logged are expensive to compute. In such cases, you
can use a function to defer the computation so that it is only computed when
the log message is actually logged:
~~~~ typescript
logger.debug(l => l`This is a debug message with ${computeValue()}.`);
logger.debug("Or you can use a function call: {value}.", () => {
return { value: computeValue() };
});
~~~~
When using the function call, the way to log single curly braces `{` is to
double the brace `{{`:
~~~~ typescript
logger.debug("This logs {{single}} curly braces.");
~~~~
Categories
----------
LogTape uses a hierarchical category system to manage loggers. A category is
a list of strings. For example, `["my-app", "my-module"]` is a category.
When you log a message, it is dispatched to all loggers whose categories are
prefixes of the category of the logger. For example, if you log a message
with the category `["my-app", "my-module", "my-submodule"]`, it is dispatched
to loggers whose categories are `["my-app", "my-module"]` and `["my-app"]`.
This behavior allows you to control the verbosity of log messages by setting
the log level of loggers at different levels of the category hierarchy.
Here's an example of setting log levels for different categories:
~~~~ typescript
import { configure, getConsoleSink } from "@logtape/logtape";
await configure({
sinks: {
console: getConsoleSink(),
},
filters: {},
loggers: [
{ category: ["my-app"], level: "info", sinks: ["console"] },
{ category: ["my-app", "my-module"], level: "debug", sinks: ["console"] },
],
})
~~~~
Sinks
-----
A sink is a destination of log messages. LogTape currently provides a few
sinks: console and stream. However, you can easily add your own sinks.
The signature of a sink is:
~~~~ typescript
export type Sink = (record: LogRecord) => void;
~~~~
Here's a simple example of a sink that writes log messages to console:
~~~~ typescript
import { configure } from "@logtape/logtape";
await configure({
sinks: {
console(record) {
console.log(record.message);
}
},
// Omitted for brevity
});
~~~~
### Console sink
Of course, you don't have to implement your own console sink because LogTape
provides a console sink:
~~~~ typescript
import { configure, getConsoleSink } from "@logtape/logtape";
await configure({
sinks: {
console: getConsoleSink(),
},
// Omitted for brevity
});
~~~~
See also [`getConsoleSink()`] function and [`ConsoleSinkOptions`] interface
in the API reference for more details.
[`getConsoleSink()`]: https://jsr.io/@logtape/logtape/doc/~/getConsoleSink
[`ConsoleSinkOptions`]: https://jsr.io/@logtape/logtape/doc/~/ConsoleSinkOptions
### Stream sink
Another built-in sink is a stream sink. It writes log messages to
a [`WritableStream`]. Here's an example of a stream sink that writes log
messages to the standard error:
~~~~ typescript
// Deno:
await configure({
sinks: {
stream: getStreamSink(Deno.stderr.writable),
},
// Omitted for brevity
});
~~~~
~~~~ typescript
// Node.js:
import stream from "node:stream";
await configure({
sinks: {
stream: getStreamSink(stream.Writable.toWeb(process.stderr)),
},
// Omitted for brevity
});
~~~~
> [!NOTE]
> Here we use `WritableStream` from the Web Streams API. If you are using
> Node.js, you cannot directly pass `process.stderr` to `getStreamSink` because
> `process.stderr` is not a `WritableStream` but a [`Writable`], which is a
> Node.js stream. You can use [`Writable.toWeb()`] method to convert a Node.js
> stream to a `WritableStream`.
See also [`getStreamSink()`] function and [`StreamSinkOptions`] interface
in the API reference for more details.
[`WritableStream`]: https://developer.mozilla.org/en-US/docs/Web/API/WritableStream
[`Writable`]: https://nodejs.org/api/stream.html#class-streamwritable
[`Writable.toWeb()`]: https://nodejs.org/api/stream.html#streamwritabletowebstreamwritable
[`getStreamSink()`]: https://jsr.io/@logtape/logtape/doc/~/getStreamSink
[`StreamSinkOptions`]: https://jsr.io/@logtape/logtape/doc/~/StreamSinkOptions
### File sink
> [!NOTE]
> File sink is unavailable in the browser environment.
LogTape provides a file sink as well. Here's an example of a file sink that
writes log messages to a file:
~~~~ typescript
import { getFileSink } from "@logtape/logtape";
await configure({
sinks: {
file: getFileSink("my-app.log"),
},
// Omitted for brevity
});
~~~~
See also [`getFileSink()`] function and [`FileSinkOptions`] interface
in the API reference for more details.
> [!NOTE]
> On Deno, you need to have the `--allow-write` flag and the `--unstable-fs`
> flag to use the file sink.
[`getFileSink()`]: https://jsr.io/@logtape/logtape/doc/~/getFileSink
[`FileSinkOptions`]: https://jsr.io/@logtape/logtape/doc/~/FileSinkOptions
### Rotating file sink
> [!NOTE]
> Rotating file sink is unavailable in the browser environment.
A rotating file sink is a file sink that rotates log files. It creates a new
log file when the current log file reaches a certain size. Here's an example
of a rotating file sink that writes log messages to a file:
~~~~ typescript
import { getRotatingFileSink } from "@logtape/logtape";
await configure({
sinks: {
file: getRotatingFileSink("my-app.log", {
maxFileSize: 1024 * 1024, // 1 MiB
maxFiles: 5,
}),
},
// Omitted for brevity
});
~~~~
Rotated log files are named with a suffix like *.1*, *.2*, *.3*, and so on.
For more details, see [`getRotatingFileSink()`] function and
[`RotatingFileSinkOptions`] interface in the API reference.
> [!NOTE]
> On Deno, you need to have the `--allow-write` flag and the `--unstable-fs`
> flag to use the rotating file sink.
[`getRotatingFileSink()`]: https://jsr.io/@logtape/logtape/doc/~/getRotatingFileSink
[`RotatingFileSinkOptions`]: https://jsr.io/@logtape/logtape/doc/~/RotatingFileSinkOptions
### Text formatter
A stream sink and a file sink write log messages in a plain text format.
You can customize the format by providing a text formatter. The type of a
text formatter is:
~~~~ typescript
export type TextFormatter = (record: LogRecord) => string;
~~~~
Here's an example of a text formatter that writes log messages in a [JSON Lines]
format:
~~~~ typescript
await configure({
sinks: {
stream: getFileSink("log.jsonl", {
formatter(log) {
return JSON.stringify(log) + "\n",
}
}),
},
// Omitted for brevity
})
~~~~
> [!TIP]
> If you want to monitor log messages formatted in JSON Lines in real-time
> readably, you can utilize the `tail` and [`jq`] commands:
>
> ~~~~ sh
> tail -f log.jsonl | jq .
> ~~~~
[JSON Lines]: https://jsonlines.org/
[`jq`]: https://jqlang.github.io/jq/
### Disposable sink
> [!TIP]
> If you are unfamiliar with the concept of disposables, see also the proposal
> of *[ECMAScript Explicit Resource Management]*.
A disposable sink is a sink that can be disposed of. They are automatically
disposed of when the configuration is reset or the program exits. The type
of a disposable sink is: `Sink & Disposable`. You can create a disposable
sink by defining a `[Symbol.dispose]` method:
~~~~ typescript
const disposableSink: Sink & Disposable = (record: LogRecord) => {
console.log(record.message);
};
disposableSink[Symbol.dispose] = () => {
console.log("Disposed!");
};
~~~~
A sink can be asynchronously disposed of as well. The type of an asynchronous
disposable sink is: `Sink & AsyncDisposable`. You can create an asynchronous
disposable sink by defining a `[Symbol.asyncDispose]` method:
~~~~ typescript
const asyncDisposableSink: Sink & AsyncDisposable = (record: LogRecord) => {
console.log(record.message);
};
asyncDisposableSink[Symbol.asyncDispose] = async () => {
console.log("Disposed!");
};
~~~~
[ECMAScript Explicit Resource Management]: https://github.com/tc39/proposal-explicit-resource-management
### Explicit disposal
You can explicitly dispose of a sink by calling the [`dispose()`] method. It is
useful when you want to flush the buffer of a sink without blocking returning
a response in edge functions. Here's an example of using the `dispose()`
with [`ctx.waitUntil()`] in Cloudflare Workers:
~~~~ typescript
import { configure, dispose } from "@logtape/logtape";
export default {
async fetch(request, env, ctx) {
await configure({ /* ... */ });
// ...
ctx.waitUntil(dispose());
}
}
~~~~
[`dispose()`]: https://jsr.io/@logtape/logtape/doc/~/dispose
[`ctx.waitUntil()`]: https://developers.cloudflare.com/workers/runtime-apis/context/#waituntil
Filters
-------
A filter is a function that filters log messages. A filter takes a log record
and returns a boolean value. If the filter returns `true`, the log record is
passed to the sinks; otherwise, the log record is discarded. Its signature is:
~~~~ typescript
export type Filter = (record: LogRecord) => boolean;
~~~~
For example, the following filter discards log messages whose property `elapsed`
is less than 100 milliseconds:
~~~~ typescript
import { configure, type LogRecord } from "@logtape/logtape";
await configure({
// Omitted for brevity
filters: {
tooSlow(record: LogRecord) {
return "elapsed" in record.properties && record.properties.elapsed >= 100;
},
},
loggers: [
{
category: ["my-app", "database"],
level: "debug",
sinks: ["console"],
filters: ["tooSlow"],
}
]
});
~~~~
### Level filter
LogTape provides a built-in level filter. You can use the level filter to
filter log messages by their log levels. The level filter factory takes
a [`LogLevel`] string and returns a level filter. For example, the following
level filter discards log messages whose log level is less than `info`:
~~~~ typescript
import { getLevelFilter } from "@logtape/logtape";
await configure({
filters: {
infoOrHigher: getLevelFilter("info");
},
// Omitted for brevity
});
~~~~
[`LogLevel`]: https://jsr.io/@logtape/logtape/doc/~/LogLevel
### Sink filter
A sink filter is a filter that is applied to a specific sink. You can add a
sink filter to a sink by decorating the sink with [`withFilter()`]:
~~~~ typescript
import { getConsoleSink, withFilter } from "@logtape/logtape";
await configure({
sinks: {
filteredConsole: withFilter(
getConsoleSink(),
log => "elapsed" in log.properties && log.properties.elapsed >= 100,
),
},
// Omitted for brevity
});
~~~~
The `filteredConsoleSink` only logs messages whose property `elapsed` is greater
than or equal to 100 milliseconds to the console.
> [!TIP]
> The `withFilter()` function can take a [`LogLevel`] string as the second
> argument. In this case, the log messages whose log level is less than
> the specified log level are discarded.
[`withFilter()`]: https://jsr.io/@logtape/logtape/doc/~/withFilter
Testing
-------
Here are some tips for testing your application or library with LogTape.
### Reset configuration
You can reset the configuration of LogTape to its initial state. This is
useful when you want to reset the configuration between tests. For example,
the following code shows how to reset the configuration after a test
(regardless of whether the test passes or fails) in Deno:
~~~~ typescript
import { configure, reset } from "@logtape/logtape";
Deno.test("my test", async (t) => {
await t.step("set up", async () => {
await configure({ /* ... */ });
});
await t.step("run test", () => {
// Run the test
});
await t.step("tear down", async () => {
await reset();
});
});
~~~~
### Buffer sink
For testing purposes, you may want to collect log messages in memory. Although
LogTape does not provide a built-in buffer sink, you can easily implement it:
~~~~ typescript
import { type LogRecord, configure } from "@logtape/logtape";
const buffer: LogRecord[] = [];
await configure({
sinks: {
buffer: buffer.push.bind(buffer),
},
// Omitted for brevity
});
~~~~
| Simple logging library with zero dependencies for Deno/Node.js/Bun/browsers | bun,deno,javascript,logging,nodejs,typescript,log | 2024-04-16T11:36:21Z | 2024-05-07T03:35:18Z | null | 2 | 1 | 64 | 0 | 2 | 108 | null | MIT | TypeScript |
aralroca/diff-dom-streaming | main | <p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/aralroca/diff-dom-streaming/assets/13313058/ca678952-6232-4db4-aff2-c4bedade4f9a" width="128">
<img src="https://github.com/aralroca/diff-dom-streaming/assets/13313058/6d544ef2-651e-4907-a246-abc6c859ab5c" width="128">
</picture>
<h1 align="center">Diff DOM Streaming</h1>
</p>
[![npm version](https://badge.fury.io/js/diff-dom-streaming.svg)](https://badge.fury.io/js/diff-dom-streaming)
![npm](https://img.shields.io/npm/dw/diff-dom-streaming)
![size](https://img.shields.io/bundlephobia/minzip/diff-dom-streaming)
[![PRs Welcome][badge-prwelcome]][prwelcome]
<a href="https://github.com/aralroca/diff-dom-streaming/actions?query=workflow%3ATest" alt="Tests status">
<img src="https://github.com/aralroca/diff-dom-streaming/workflows/Test/badge.svg" /></a>
<a href="https://twitter.com/intent/follow?screen_name=aralroca">
<img src="https://img.shields.io/twitter/follow/aralroca?style=social&logo=x"
alt="follow on Twitter"></a>
</div>
[badge-prwelcome]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prwelcome]: http://makeapullrequest.com
The Diff DOM (Document Object Model) algorithm is used to compare two versions of the DOM, such as before and after an update on a web page. It aims to efficiently identify the changes between both DOMs, minimizing the number of manipulations required to update the user interface.
The Diff DOM Streaming library extends the traditional Diff DOM algorithm by introducing support for comparing a DOM node with a streaming reader. This enables the library to process the changes incrementally as they occur during the diff process.
For more info, read this:
- [HTML Streaming Over the Wire | A Deep Dive](https://dev.to/aralroca/html-streaming-over-the-wire-a-deep-dive-2n20).
- [SPA-like Navigation Preserving Web Component State](https://dev.to/aralroca/spa-like-navigation-preserving-web-component-state-lh3)
## Getting started
### NPM
Install:
```sh
bun install diff-dom-streaming
```
Then import it:
```ts
import diff from "diff-dom-streaming";
```
### JSR
Install:
```sh
bunx jsr add @aralroca/diff-dom-streaming
```
Then import it:
```ts
import diff from "@aralroca/diff-dom-streaming";
```
### UNPKG
Just import it:
```tsx
import diff from "https://unpkg.com/diff-dom-streaming@latest";
```
## Using it
```ts
const res = await fetch(/* some url */);
// Diff between the current document and the reader:
await diff(document, res.body.getReader());
```
## API
`diff(oldNode: Node, reader: ReadableStreamDefaultReader, options?: Options)`
This function performs a diffing operation between the `oldNode` and the DOM tree streamed through `reader`. It applies the necessary changes to update the `oldNode` accordingly. An optional `options` that include:
```ts
type Options = {
// calback to handle each new docoument node during the streaming
// (default: undefined)
onNextNode?: NextNodeCallback;
// update the DOM using document.startViewTransition (default: false)
transition?: boolean;
};
```
## Lists and `key` attribute
Keys help to identify which items have changed, are added, or are removed. Keys should be given to the elements inside the array to give the elements a stable identity:
```jsx 3
const numbers = [1, 2, 3, 4, 5];
const listItems = numbers.map((number) => (
<li key={number.toString()}>{number}</li>
));
```
_(Example with JSX)_
The `diff-dom-streaming` library takes into account the `key` attribute for these cases, if it does not exist, then see if they have `id`.
## Transitions between pages (View Transition API)
You can activate the View Transition API updating the DOM with this property:
```diff
await diff(document, res.body.getReader(), {
+ transition: true
})
```
> [!TIP]
>
> To access the transition with JavaScript/TypeScript you can access the global property `window.lastDiffTransition`
### Incremental vs full transition
Many times it will make more sense to use a complete transition instead of incremental, especially if we do not use suspense and we want a single transition at once instead of several, in this case, instead of using the configuration, we can use the View Transition API directly:
```diff
+ document.startViewTransition(async () => {
await diff(document, res.body.getReader(), {
- transition: true,
});
+});
```
## Examples
In the repo we have examples for you to try.
### Locally
There are some examples:
- Run `bun run example:boxes`
- Run `bun run examples:spa-like`
### Stackblitz
You can run the boxes demo with Vanillajs [here](https://stackblitz.com/edit/diff-dom-streaming?file=index.js).
![ezgif-4-1ff18912f4](https://github.com/aralroca/diff-dom-streaming/assets/13313058/f18c01c0-4dfe-473f-8817-fb905adc20c1)
## Acknowledgments
The Diff DOM Algorithm with HTML Streaming is inspired by the [set-dom](https://github.com/DylanPiercey/set-dom) library by [@dylan_piercey](https://twitter.com/dylan_piercey) and a technique for parsing streams pioneered by [@jaffathecake](https://twitter.com/jaffathecake).
## Contributing
See [Contributing Guide](CONTRIBUTING.md) and please follow our [Code of Conduct](CODE_OF_CONDUCT.md).
## License
[MIT](LICENSE)
| HTML Streaming Over the Wire! 🥳 Diff DOM algorithm with streaming to make only the necessary modifications, insertions and deletions between a DOM node and an HTML stream reader. | diff,dom,dom-manipulation,html-streaming,javascript,typescript,virtual-dom | 2024-04-02T16:14:35Z | 2024-05-01T20:49:43Z | 2024-05-01T20:49:43Z | 2 | 7 | 46 | 1 | 0 | 102 | null | MIT | TypeScript |
mercurjs/mercur | main | ![Mercur](https://rigby-web.fra1.digitaloceanspaces.com/mercur-readme.png)
<div align="center">
<h1>Mercur</h1>
<p>JavaScript Open Source Multi-Vendor Marketplace built on top of Medusa.js.</p>
<!-- Shields.io Badges -->
<a href="https://your-link-to-license">
<img alt="License" src="https://img.shields.io/badge/license-MIT-blue.svg" />
</a>
<a href="https://your-link-to-pull-requests">
<img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" />
</a>
<a href="https://your-link-to-support">
<img alt="Support" src="https://img.shields.io/badge/support-contact%20author-blueviolet.svg" />
</a>
<a href="https://your-link-to-discord">
<img alt="Chat on Discord" src="https://img.shields.io/discord/your-discord-server-id.svg?label=chat&logo=discord&color=7289da" />
</a>
<!-- Documentation and Website Links -->
<p>
<a href="https://link-to-your-documentation">Documentation</a> |
<a href="https://link-to-your-website">Website</a>
</p>
</div>
<br>
# Getting started
```bash
npx mercurjs marketplace
```
# What is Mercur?
Mercur is the first JavaScript open-source platform for building multi-vendor marketplaces. Built on top of Medusa.js, it simplifies the development of customized marketplaces.
## Why Mercur?
After seeing the rising trend in multi-vendor business models and setting up several marketplaces from scratch at Rigby, we wanted to eliminate the repetitive setup of marketplaces.
The aim is to enable users to start a new marketplace in about five minutes, providing a strong starting point for anyone looking to build their own multi-vendor platform.
Medusa is an amazing and strong foundation for building marketplaces but requires a few modifications to adjust to this business model. We wanted a faster way to get these platforms up and running — Mercur is that accelerator for building multi-vendor marketplace with Medusa.js as a core.
## Goals
We aim to make Mercur adaptable for various marketplace types, such as rental or service marketplaces. We're also building an ecosystem of plugins tailored to multi-vendor setups, including solutions for payment distributions like Stripe.
Feel free to share your ideas on our Discord, how you imagine the development of this project.
## Project Components:
![Mercur Architecture](https://rigby-web.fra1.digitaloceanspaces.com/mercur-mvm-arch.png)
- **Core:** The backbone of Mercur, handling the primary operations and data flow essential for marketplace functionality.
- **Admin:** Provides a control panel for marketplace administrators to manage vendors, orders, settings, and more.
- **Vendor:** A dedicated interface for vendors to manage their products, orders, and profile details.
- **Storefront:** The frontend where customers browse products, place orders, and interact with the marketplace. It is a customized version of the Medusa.js Next.js Starter.
## Project Features:
- **Vendor Registration:** Allows new vendors to sign up and await approval from marketplace administrators.
- **Vendor Profiles:** Enables vendors to create and customize their profiles on the marketplace.
- **Vendor Authorization by Admin:** Admins can review and authorize vendor registrations to maintain marketplace standards.
- **Role-based Access:** Ensures users have permissions appropriate to their role within the marketplace.
- **Order Splitting:** Facilitates the distribution of orders among multiple vendors involved in a single transaction.
- **Vendor Shipping Management:** Vendors can manage their shipping logistics independently within the platform.
- **Commission Management:** Admins can set up and manage commission rates from vendor sales.
## Getting started 🚀
Create a new Mercur project with just one command:
`npx @mercur generate marketplace`
You will be asked to enter the project's name and select the project’s modules (admin / vendor / storefront) platform you wish to use. Once selected, the CLI will create project files in the directory matching your project name.
## Support Mercur ❤️
Mercur is a community-driven, open-source initiative. We are committed to keeping it free and accessible by releasing it under the MIT License.
### How to contribute:
- **Ideas:** If you have any ideas on how to develop the product further, feel free to share them with us. We're always open to new suggestions!
- **Code:** Help improve our project by contributing code or fixing bugs. We invite you to review our Contributing Guide.
- **Bug:** Encountered a bug? We encourage you to open an issue on our GitHub repository.
- **Spread the Word:** Tell others about our project. Every mention helps!
- **Create Content:** Write a post, make a video, or create a tutorial. We’ll share your work.
- **Join the Community:** Answer questions and provide support on our Discord.
## Useful Links
- [GitHub Issues](https://github.com/medusajs/medusa/issues)
- [Community Discord](https://discord.gg/medusajs)
- [Mercur website](https://medusajs.com/blog/)
- [Mercur docs](https://github.com/medusajs/medusa)
- [Medusa website](https://medusajs.com)
- [Medusa repo](https://github.com/medusajs/medusa/blob/develop/LICENSE)
- [Medusa Docs](https://github.com/medusajs/medusa)
## License
Licensed under the [MIT License](https://github.com/medusajs/medusa/blob/develop/LICENSE).
| JavaScript Open Source
Multi-Vendor Marketplace Accelerator build on top of Medusa.js. Mercur simplifies the path to your own customized, multi-vendor marketplace. | ecommerce,javascript,marketplace,multivendor-ecommerce,nextjs,nodejs,open-source,medusajs | 2024-04-23T15:36:13Z | 2024-05-23T14:21:48Z | null | 3 | 2 | 21 | 4 | 4 | 94 | null | null | TypeScript |
Suchitra-Sahoo/AgriLearnNetwork | main | # AgriLearnNetwork
<div align = "center">
<img src="https://emojiisland.com/cdn/shop/products/26_large.png?v=1571606116" >
<div>
**Check the Website [here](https://suchitra-sahoo.github.io/AgriLearnNetwork//)**.
## TABLE OF CONTENTS
- [About our project](#About-our-project)
- [Tech Stack Used](#Tech-Stack-Used)
- [Website Overview](#Website-Overview)
- [Let's Get Started](#lets-get-started)
- [Key Features ✨](#Key-Features-✨)
- [Components of Website](#Components-of-Website)
Welcome to AgriLearnNetwork, your premier destination for comprehensive agricultural education and an abundance of invaluable resources. Whether you're a seasoned farmer, a budding agricultural enthusiast, or simply curious about the world of farming, we're here to empower you with knowledge and tools to thrive in the field. Explore our diverse range of courses, delve into expert insights, and discover the latest advancements in agricultural practices. Join us in cultivating a brighter future for agriculture together.
<div align="center">
<img src="https://forthebadge.com/images/badges/built-with-love.svg" />
<img src="https://forthebadge.com/images/badges/uses-brains.svg" />
<img src="https://forthebadge.com/images/badges/powered-by-responsibility.svg" />
<br>
<img src="https://img.shields.io/github/repo-size/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge">
<img src="https://img.shields.io/github/issues/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/issues-closed-raw/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/license/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/issues-pr/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/contributors/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/stars/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/issues-pr-closed-raw/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/forks/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://img.shields.io/github/last-commit/Suchitra-Sahoo/AgriLearnNetwork?style=for-the-badge" />
<img src="https://api.visitorbadge.io/api/visitors?path=https://github.com/Suchitra-Sahoo/AgriLearnNetwork&label=visitors&countColor=%2337d67a&style=for-the-badge&labelStyle=upper" />
</div>
<br>
<br>
**Tech Stack Used**
<div align="center">
<img src="https://img.shields.io/badge/HTML5-E34F26.svg?style=for-the-badge&logo=HTML5&logoColor=white">
<img src="https://img.shields.io/badge/CSS3-1572B6.svg?style=for-the-badge&logo=CSS3&logoColor=white">
<img src="https://img.shields.io/badge/Bootstrap-7952B3.svg?style=for-the-badge&logo=Bootstrap&logoColor=white">
<img src="https://img.shields.io/badge/JavaScript-F7DF1E.svg?style=for-the-badge&logo=JavaScript&logoColor=white">
</div>
# Website Overview
Agrilearn Network serves as an indispensable resource, offering farmers a holistic platform enriched with essential insights spanning the diverse landscape of agriculture. Delving into the core of farming practices, our platform provides detailed guidance on agriculture techniques, in-depth knowledge on seed varieties, recommendations for optimal tool usage, streamlined harvesting methods, best practices for sowing, and strategic farm management approaches. By encompassing a wide spectrum of topics, Agrilearn Network aims to empower farmers with the comprehensive understanding needed to navigate the complexities of modern agriculture successfully.
# Let's Get Started
<p>Welcome to AgriLearnNetwork! If you're interested in contributing, here's how you can get started:</p>
<div align="left">
1. **Fork the repository:** Click on the "Fork" button at the top-right corner of the repository's page on GitHub to create your own copy of the project.
2. **Clone the repository:** After forking, clone the repository to your local machine using the following command in your terminal:
```bash
git clone https://github.com/<your-github-username>/AgriLearnNetwork.git
```
3. **Add a remote upstream:** Set up a remote upstream to the original repository by running the following command in your terminal:
```bash
git remote add upstream https://github.com/<original-owner>/AgriLearnNetwork/
```
4. **Create a new branch:** Switch to a new branch for your contributions:
```bash
git checkout -b <your-branch-name>
```
5. **Make changes:** Start making your changes to the source code.
6. **Add your changes:** Stage your changes for commit:
```bash
git add <changed-file1> <changed-file2> ...
```
7. **Commit your changes:** Commit your changes with a descriptive message:
```bash
git commit -m "<your-commit-message>"
```
8. **Push your changes:** Push your changes to your forked repository:
```bash
git push origin <your-branch-name>
```
9. **Create a Pull Request:** Go to the GitHub repository, select your branch, and click on the "New pull request" button to create a new pull request.
</div>
# Key Features ✨
- **Landing Page**: Experience agriculture's future today with AgriLearnNetwork's innovative platform.
- **About Us**: Discover how AgriLearnNetwork is reshaping agriculture education and support worldwide.
- **Blogs Page**: Dive into a wealth of agricultural knowledge with our curated blog posts.
- **Resource Library**: Access essential tutorials covering crucial topics in agriculture and farming.
- **Contact Us**: Reach out to our dedicated team for personalized assistance and guidance.
- **AI Chat Bot**: Get instant answers to all your agriculture-related queries with our AI-powered chatbot.
**Components of Website**
---
**Landing Page**
Welcome to AgriLearnNetwork! Step into a world where agriculture meets innovation. Our captivating landing page invites you to embark on a journey towards agricultural excellence. Be inspired to take the first step towards a prosperous and sustainable farming future.
![image](https://github.com/Suchitra-Sahoo/AgriLearnNetwork/assets/123376847/522bc4a9-f54c-48ba-92fb-7d54b4a22c9a)
<br>
**About Us**
Discover the heart and soul of AgriLearnNetwork. Learn about our mission to revolutionize agriculture education and support farmers worldwide. Explore how our platform equips you with the tools and knowledge needed to thrive in the ever-evolving world of farming.
![image](https://github.com/Suchitra-Sahoo/AgriLearnNetwork/assets/123376847/2392b9e9-0954-48c5-9a57-b806bd099b09)
<br>
**Blogs Page**
Dive into a treasure trove of insightful blog posts covering a myriad of topics relevant to modern agriculture. Our curated collection of articles delves into various aspects of farming, offering valuable advice, tips, and solutions to common challenges faced by farmers today.
![image](https://github.com/Suchitra-Sahoo/AgriLearnNetwork/assets/123376847/f9860021-eb7b-4b2e-a459-d8f77f2e5dbc)
<br>
**Resource Library**
Explore our extensive collection of tutorials covering a wide range of crucial topics in agriculture and farming. Our resource library is your go-to destination for in-depth guidance and expert insights on various aspects of agricultural practices. Whether you're looking to enhance your knowledge in crop management, soil health, pest control, irrigation techniques, or livestock care, our tutorials offer comprehensive information to help you succeed in your farming endeavors.
![image](https://github.com/Suchitra-Sahoo/AgriLearnNetwork/blob/main/components/Screenshot%202024-05-04%20210212.png)
<br>
**Contact Us**
Have questions or need assistance? Our dedicated team is here to help. Reach out to us through our contact page, and we'll be happy to provide support and guidance tailored to your needs.
![image](https://github.com/Suchitra-Sahoo/AgriLearnNetwork/assets/123376847/e0def232-335e-4b4d-881f-5494f5679c64)
<br>
**AI Chat Bot**
Introducing our AI-powered chatbot, your virtual agricultural assistant. Have questions about farming techniques, crop management, or agricultural practices? Simply chat with our AI bot, and get instant answers to all your agriculture-related queries. Experience the convenience of personalized support at your fingertips, 24/7.
<br>
## License 🪪
[MIT license](https://opensource.org/license/mit/)
## Thanks to all the contributors❤️
<a href="https://github.com/Suchitra-Sahoo/AgriLearnNetwork/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Suchitra-Sahoo/AgriLearnNetwork" />
</a>
| AgriLearnNetwork is a comprehensive platform designed to empower farmers with essential insights and resources for successful agriculture practices. Our platform serves as an indispensable resource, offering a holistic approach enriched with detailed guidance, in-depth knowledge and strategic management approaches across various facets of farming. | collaborate,css,github,github-pages,html,javascript,vscode,ghdesktop | 2024-04-11T05:49:16Z | 2024-05-23T15:06:29Z | null | 51 | 174 | 281 | 109 | 188 | 91 | null | MIT | CSS |
Itxxwasi/WASI-MD-V2 | main | <p align="center">
<a href="https://whatsapp.com/channel/0029VaDK8ZUDjiOhwFS1cP2j">
<img alt="wasi" height="300" src="https://telegra.ph/file/9f5aac1b37d65de4c725c.jpg">
<h1 align="center">WASI MD V2</h1>
</a>
</p>
<p align="center">
<a href="https://github.com/Itxxwasi"><img title="Author" src="https://img.shields.io/badge/Itxxwasi-black?style=for-the-badge&logo=Github"></a> <a href="https://whatsapp.com/channel/0029VaDK8ZUDjiOhwFS1cP2j"><img title="Author" src="https://img.shields.io/badge/CHANNEL-black?style=for-the-badge&logo=whatsapp"></a> <a href="https://wa.me/923192173398"><img title="Author" src="https://img.shields.io/badge/CHAT US-black?style=for-the-badge&logo=whatsapp"></a>
<p/>
<p align="center">
<a href="https://github.com/Itxxwasi?tab=followers"><img title="Followers" src="https://img.shields.io/github/followers/Itxxwasi?label=Followers&style=social"></a>
<a href="https://github.com/Itxxwasi/WASI-MD-V2/stargazers/"><img title="Stars" src="https://img.shields.io/github/stars/Itxxwasi/WASI-MD-V2?&style=social"></a>
<a href="https://github.com/Itxxwasi/WASI-MD-V2/network/members"><img title="Fork" src="https://img.shields.io/github/forks/Itxxwasi/WASI-MD-V2?style=social"></a>
<a href="https://github.com/Itxxwasi/WASI-MD-V2/watchers"><img title="Watching" src="https://img.shields.io/github/watchers/Itxxwasi/WASI-MD-V2?label=Watching&style=social"></a>
</p>
####
# My Awesome Project
Welcome to my awesome project! Here you'll find...
## YouTube Channel
Check out my YouTube channel for tutorials and more!
[![YouTube Channel](https://img.shields.io/badge/Subscribe-My%20Channel-red?style=for-the-badge&logo=youtube)](https://www.youtube.com/@wasitech1)
## WhatsApp Channel
Join our WhatsApp channel for updates and discussions!
[![WhatsApp Channel](https://img.shields.io/badge/Join-WhatsApp%20Channel-25D366?style=for-the-badge&logo=whatsapp)](https://whatsapp.com/channel/0029VaDK8ZUDjiOhwFS1cP2j)
## WhatsApp Support Group
Join our WhatsApp support group for assistance and discussions!
[![WhatsApp Support Group](https://img.shields.io/badge/Join-WhatsApp%20Support%20Group-25D366?style=for-the-badge&logo=whatsapp)](https://chat.whatsapp.com/Dd2RCJsumFWBfQ6290pDy8)
#### SETUP
1.𝔽𝕠𝕣𝕜 𝕥𝕙𝕖 𝕣𝕖𝕡𝕠
<br>
<a href='https://github.com/Itxxwasi/WASI-MD-V2/fork' target="_blank"><img alt='Fork repo' src='https://img.shields.io/badge/Fork Repo-100000?style=for-the-badge&logo=scan&logoColor=white&labelColor=black&color=green'/></a>
2.𝔾𝕖𝕥 𝕊𝕖𝕤𝕤𝕚𝕠𝕟 𝕀𝔻 (ℙ𝔸𝕀ℝ𝕀ℕ𝔾)
<br>
<a href='https://pair-qr-wasi-md.onrender.com/pair' target="_blank"><img alt='SESSION ID' src='https://img.shields.io/badge/Session_id-100000?style=for-the-badge&logo=scan&logoColor=white&labelColor=black&color=green'/></a>
3.𝔾𝕖𝕥 𝕊𝕖𝕤𝕤𝕚𝕠𝕟 𝕀𝔻 (𝕊ℂ𝔸ℕ ℚℝ)
<br>
<a href='https://pair-qr-wasi-md.onrender.com' target="_blank"><img alt='SESSION ID' src='https://img.shields.io/badge/Session_id-100000?style=for-the-badge&logo=scan&logoColor=white&labelColor=black&color=green'/></a>
#### 𝕕𝕖𝕡𝕝𝕠𝕪𝕞𝕖𝕟𝕥 𝕤𝕖𝕔𝕥𝕚𝕠𝕟
# <a href="https://dashboard.heroku.com/new?template=https://github.com/Itxxwasi/WASI-MD-V2"><img title="heroku" src="https://img.shields.io/badge/DEPLOY ON HEROKU-h?color=green&style=for-the-badge&logo=msi"></a>
# <a href="https://railway.app/template/tM2McB?referralCode=v7Xehd"><img title="railway" src="https://img.shields.io/badge/DEPLOY ON RAILWAY-h?color=green&style=for-the-badge&logo=msi"></a>
# <a href="(https://replit.com/github/Itxxwasi/WASI-MD-V2"><img title="raplir" src="https://img.shields.io/badge/RAPLIT-h?color=green&style=for-the-badge&logo=msi"></a>
# <a href="https://wasimd-9dedcea2edba.herokuapp.com/"><img title="koyeb" src="https://img.shields.io/badge/DEPLOY ON KYOEB-h?color=green&style=for-the-badge&logo=msi"></a>
### 𝕋ℍ𝔸ℕ𝕂𝕊 𝕋𝕆
[`ASTROPED FOR PLUGINS `](https://github.com/astroped)
[`ibrahim-tech-for-help`](https://github.com/ibrahimaitech)
## 𝕎𝔸ℝℕ𝕀ℕ𝔾
- 𝘛𝘩𝘪𝘴 𝘣𝘰𝘵 𝘪𝘴 𝘯𝘰𝘵 𝘮𝘢𝘥𝘦 𝘣𝘺 `𝘞𝘩𝘢𝘵𝘴𝘈𝘱𝘱 𝘐𝘯𝘤.` 𝘚𝘰 𝘮𝘪𝘴𝘶𝘴𝘪𝘯𝘨 𝘵𝘩𝘦 𝘣𝘰𝘵 𝘮𝘪𝘨𝘩𝘵 `𝘣𝘢𝘯` 𝘺𝘰𝘶𝘳 `𝘞𝘩𝘢𝘵𝘴𝘈𝘱𝘱 𝘢𝘤𝘤𝘰𝘶𝘯𝘵!`(𝘛𝘩𝘰𝘶𝘨𝘩 𝘺𝘰𝘶𝘳 𝘞𝘩𝘢𝘵𝘴𝘈𝘱𝘱 𝘢𝘤𝘤𝘰𝘶𝘯𝘵 𝘤𝘢𝘯 𝘣𝘦 𝘶𝘯𝘣𝘢𝘯𝘯𝘦𝘥 𝘰𝘯𝘭𝘺 𝘰𝘯𝘤𝘦.)
- 𝘐 𝘢𝘮 𝘯𝘰𝘵 𝘳𝘦𝘴𝘱𝘰𝘯𝘴𝘪𝘣𝘭𝘦 𝘧𝘰𝘳 𝘣𝘢𝘯𝘯𝘪𝘯𝘨 𝘺𝘰𝘶𝘳 𝘢𝘤𝘤𝘰𝘶𝘯𝘵.
- 𝘜𝘴𝘦 𝘢𝘵 𝘺𝘰𝘶𝘳 𝘰𝘸𝘯 𝘳𝘪𝘴𝘬 𝘣𝘺 𝘬𝘦𝘦𝘱𝘪𝘯𝘨 𝘵𝘩𝘪𝘴 𝘸𝘢𝘳𝘯𝘪𝘯𝘨 𝘪𝘯 𝘮𝘪𝘯𝘥.
<h2 align="center"> NOTICE
</h2>
| WASI-MD-V2 is a Cool Multi-Device WhatsApp bot developed by WASI TECH. This bot is just developed for using whatsapp in funny ways. | itxxwasi,javascript,node-js,npm-package,wasixd | 2024-04-29T05:12:35Z | 2024-05-09T12:05:05Z | null | 2 | 3 | 133 | 0 | 272 | 70 | null | Apache-2.0 | JavaScript |
ErickWendel/testing-serverless-apps | main | # Example of how to run e2e and unit tests on serverless apps using LocalStack and Jest
[![Build Status](https://github.com/ErickWendel/testing-serverless-apps/workflows/Docker%20Actions/badge.svg)](https://github.com/ErickWendel/testing-serverless-apps/actions)
Code samples of my video on [testing serverless applications](https://youtu.be/rwyhw9UYHkA).
It uses **Jest** as test runner, **LocalStack** as a mock server for AWS Services, **serverless framework** to deploy apps on AWS and **GitHub Actions** as continuous integration platform.
Note that it uses **ECMAScript Modules** empowered by **Node.js v20** without any bundlers (NICE).
Leave your star 🌟 in the project 💚
- In the ./tests folder I put two examples: [**e2e**](./test/e2e/listBuckets.test.js) and [**unit**](./test/unit/listBuckets.test.js) tests folder and there you can take a look on how to make those tests.
- In [./src/factory.js](./src/factory.js) you can take a look on how to configure the **AWS SDK v3** to point it to localStack when in development mode.
## Running
![Testando aplicacnes serverless](https://github.com/ErickWendel/testing-serverless-apps/assets/8060102/41ea502b-8d62-4592-9311-91ae1e269113)
### Pre reqs
- Install Docker & Docker-compose
- Install Node.js v20
### Running
- run `docker-compose up -d localstack`
- restore node.js dependencies `npm ci`
- run tests `npm t` or press `F5` on VSCode.
| Code samples of how to make unit and e2e tests in serverless applications | aws,aws-lambda,aws-s3,continuous-integration,debugging,docker,e2e-testing,github-actions,javascript,jest | 2024-03-18T23:35:35Z | 2024-03-24T23:44:46Z | null | 1 | 0 | 36 | 1 | 15 | 69 | null | null | JavaScript |
Drako01/javascript---57705 | main | <p align="center">
<img src="https://jobs.coderhouse.com/assets/logos_coderhouse.png" alt="CoderHouse" height="100"/>
</p>
# Bienvenidos a la Comisión #57705
<p align="center">
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
<img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg" alt="Javascript" width="100" height="100"/></a>
<a href="https://www.w3.org/html/" target="_blank"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original-wordmark.svg" alt="html5" width="100" height="100"/></a> <a href="https://www.w3schools.com/css/" target="_blank">
<img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/css3/css3-original-wordmark.svg" alt="css3" width="100" height="100"/></a>
</p>
---
## Temas Incluidos
### 1er Fase con Entrega
```ssh
1. Conceptos generales: Sintaxis y variables
2. Control de flujos
3. Ciclos e iteraciones
4. Funciones
```
### 2da Fase con Entrega
```ssh
5. Objetos
6. Arrays
7. Funciones de orden superior
8. DOM
```
### 3er Fase con Entrega
```ssh
9. Eventos
10. Storage & JSON
11. Workshop
12. Operadores avanzados
```
### 4ta Fase
```ssh
13. Librerías
14. Asincronía y promesas
15. Ajax & Fetch
16. Frameworks & NodeJS
```
## Entrega Final:
### El Proyecto Integrador debe incluir todos los temas vistos en el Curso.
---
## Profesor: Alejandro Daniel Di Stefano
| Repositorio para uso exclusivo de los Alumnos de la Comisión #57705 de CoderHouse | css3,git,html5,javascript,visual-studio-code | 2024-04-16T19:52:36Z | 2024-04-16T20:06:07Z | null | 1 | 0 | 3 | 0 | 1 | 67 | null | MIT | null |
aymanalhattami/filament-context-menu | main | # Context Menu for Filament
[![Latest Version on Packagist](https://img.shields.io/packagist/v/aymanalhattami/filament-context-menu.svg?style=flat-square)](https://packagist.org/packages/aymanalhattami/filament-context-menu)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/aymanalhattami/filament-context-menu/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/aymanalhattami/filament-context-menu/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/aymanalhattami/filament-context-menu/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/aymanalhattami/filament-context-menu/actions?query=workflow%3A"Fix+PHP+code+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/aymanalhattami/filament-context-menu.svg?style=flat-square)](https://packagist.org/packages/aymanalhattami/filament-context-menu)
---
This package is used to add a context menu (right click menu) for resource pages, custom pages and table cells of [Filament Admin Panel](https://filamentphp.com/).
* It uses [Filament Actions](https://filamentphp.com/docs/3.x/actions/overview) to set menu actions.
* It supports dark and light modes.
* It supports left-to-right and right-to-left direction.
* You can set a divider between menu actions.
* It supports resource pages and custom pages.
* You can set a context menu for table cells.
* Three actions are available for usage in the page context menu:
* ```AymanAlhattami\FilamentContextMenu\Actions\RefreshAction``` to refresh the page.
* ```AymanAlhattami\FilamentContextMenu\Actions\GoBackAction``` to go back to the previous page.
* ```AymanAlhattami\FilamentContextMenu\Actions\GoForward``` to go back to the forward page.
[Demo project](https://github.com/aymanalhattami/filament-context-menu-project) | [Youtube video](https://www.youtube.com/watch?v=ciTH-u5sluw) | [Laravel Daily (Povilas Korop) Video](https://www.youtube.com/watch?v=ZqJ96GCtfBQ)
## Installation
You can install the package via Composer:
```bash
composer require aymanalhattami/filament-context-menu
```
## Usage 1: resource pages and custom pages
1. Add the trait ```AymanAlhattami\FilamentContextMenu\PageHasContextMenu``` to the page you want to add the context menu.
2. Then, define a ```getContextMenuActions``` method inside the page, the method should return an array of [Filament Actions](https://filamentphp.com/docs/3.x/actions/installation)
```php
use App\Filament\Resources\UserResource\Pages\CreateUser;
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Actions\Action;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
use PageHasContextMenu;
public function getContextMenuActions(): array
{
return [
Action::make('Create user')
->url(CreateUser::getUrl())
];
}
//
}
```
### Divider
You can use ```AymanAlhattami\FilamentContextMenu\ContextMenuDivider``` to set divider between menu actions
```php
use App\Filament\Resources\UserResource\Pages\CreateUser;
use App\Filament\Resources\UserResource\Pages\TrashedUsers;
use AymanAlhattami\FilamentContextMenu\ContextMenuDivider;
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Actions\Action;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
Action::make('Create user')
->url(CreateUser::getUrl()),
ContextMenuDivider::make(),
Action::make('Trashed user')
->url(TrashedUsers::getUrl()),
];
}
//
}
```
### Create Action
You can use ```Filament\Actions\CreateAction```, visit [filament create action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\CreateAction::make()
->model(App\Models\User::class)
->form([
TextInput::make('name')
->required(),
// ...
])
];
}
//
}
```
### Edit Action
You can use ```Filament\Actions\EditAction```, visit [filament edit action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/edit) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ViewRecord;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\EditAction::make()
->record($this->user)
->form([
TextInput::make('name')
->required(),
// ...
])
];
}
//
}
```
### View Action
You can use ```Filament\Actions\ViewAction```, visit [filament view action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/view) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\EditRecord;
class EditUser extends EditRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\ViewAction::make()
->record($this->user)
->form([
TextInput::make('name')
->required(),
// ...
])
];
}
//
}
```
### Delete Action
You can use ```Filament\Actions\DeleteAction```, visit [filament delete action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/delete) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ViewRecord;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\DeleteAction::make()
->record($this->user)
];
}
//
}
```
### Replicate Action
You can use ```Filament\Actions\ReplicateAction```, visit [filament replicate action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/replicate) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ViewRecord;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\ReplicateAction::make()
->record($this->user)
];
}
//
}
```
### Force Delete Action
You can use ```Filament\Actions\ForceDeleteAction```, visit [filament force delete action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/force-delete) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ViewRecord;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\ForceDeleteAction::make()
->record($this->user)
];
}
//
}
```
### Restore Action
You can use ```Filament\Actions\RestoreAction```, visit [filament restore action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/restore) for more information.
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\RestoreAction::make()
->record($this->user)
];
}
//
}
```
### Import Action
You can use ```Filament\Actions\ImportAction```, visit [filament import action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import) for more information.
```php
use App\Filament\Imports\UserImporter;
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\ImportAction::make()
->importer(UserImporter::class)
];
}
//
}
```
### Export Action
You can use ```Filament\Actions\ExportAction```, visit [filament export action](https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export) for more information.
```php
use App\Filament\Exports\UserExporter;
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ListRecords;
class ListUsers extends ListRecords
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
\Filament\Actions\ExportAction::make()
->exporter(UserExporter::class)
];
}
//
}
```
### Example: action with modal
You can use filament action with modal
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ViewRecord;
use Filament\Actions\Action;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
Action::make('Quick edit user')
->form([
\Filament\Forms\Components\Grid::make(2)
->schema([
TextInput::make('name'),
TextInput::make('email'),
])
])
->action(function($data){
$this->getRecord()->update([
'name' => $data['name'],
'email' => $data['email'],
]);
})
];
}
//
}
```
### Example: refresh, go back and go forward actions
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;
use Filament\Resources\Pages\ViewRecord;
use AymanAlhattami\FilamentContextMenu\Actions\{ RefreshAction, GoBackAction, GoForwardAction};
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
//
public static function getContextMenuActions(): array
{
return [
RefreshAction::make(),
GoBackAction::make(),
GoForwardAction::make()
];
}
//
}
```
### Enable / Disable context menu in resource pages and custom pages
Method 1: To globally enable or disable the context menu, you need to define an env variable called ```CONTEXT_MENU_ENABLED``` and to set the value to ```true``` or ```false```.
Method 2: You can also define a static variable called ```public static bool $contextMenuEnabled``` in the page and set the value to ```true``` or ```false```;
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;use Filament\Resources\Pages\ViewRecord;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
# enable / disable context menu
public static bool $contextMenuEnabled = true;
//
public static function getContextMenuActions(): array
{
return [];
}
//
}
```
Method 3: define a static method called ```isContextMenuEnabled``` in the page
```php
use AymanAlhattami\FilamentContextMenu\Traits\PageHasContextMenu;use Filament\Resources\Pages\ViewRecord;
class ViewUser extends ViewRecord
{
use PageHasContextMenu;
public static function isContextMenuEnabled(): bool
{
return true;
}
//
public static function getContextMenuActions(): array
{
return [];
}
//
}
```
## Usage 2: table cells
To add a context menu to the table cell, you can use the following columns:
```php
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuTextColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuCheckboxColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuSelectColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuColorColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuIconColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuImageColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuTextInputColumn;
AymanAlhattami\FilamentContextMenu\Columns\ContextMenuToggleColumn;
```
```php
use Filament\Tables\Table;
use Filament\Tables\Actions\Action;
use AymanAlhattami\FilamentContextMenu\Columns\ContextMenuTextColumn;
use App\Filament\Resources\UserResource\Pages\{ ViewUser, EditUser };
//
public static function table(Table $table): Table
{
return $table
->columns([
ContextMenuTextColumn::make('id')
->searchable()
->contextMenuActions(fn (Model $record) => [
Action::make('View user')
->url(ViewUser::getUrl(['record' => $record]))
->link()
->icon('heroicon-o-user'),
]),
ContextMenuTextColumn::make('name')
->searchable()
->contextMenuActions(fn (Model $record) => [
Action::make('View user')
->url(Pages\ViewUser::getUrl(['record' => $record]))
->link()
->icon('heroicon-o-user'),
Action::make('Edit user')
->url(Pages\EditUser::getUrl(['record' => $record]))
->link()
->icon('heroicon-o-pencil'),
])
,
,
])
}
```
Use ```AymanAlhattami\FilamentContextMenu\ContextMenuDivider``` to set a divider between menu actions.
### enable / disable table cell context menu
Use ```->contextMenuEnabled()``` method to enable/disable the context menu for the table cell.
```php
//
public static function table(Table $table): Table
{
return $table
->columns([
ContextMenuTextColumn::make('id')
->contextMenuEnabled(false)
->contextMenuActions(fn (Model $record) => [
Action::make('View user')
->url(ViewUser::getUrl(['record' => $record]))
->link()
->icon('heroicon-o-user'),
]),
//
```
## Note
For action to have a nice style, use ```->link()``` method of the action, [more information](https://filamentphp.com/docs/3.x/actions/trigger-button#choosing-a-trigger-style)
```php
public static function getContextMenuActions(): array
{
return [
Action::make('Create user')
->url(CreateUser::getUrl())
->link()
];
}
```
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [aymanalhattami](https://github.com/aymanalhattami)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
| This package is used to add a context menu (right click menu) for resource pages, custom pages and table cells of Filament Admin Panel. | filament,javascript,laravel | 2024-04-17T18:05:01Z | 2024-05-17T12:26:19Z | 2024-05-17T12:22:52Z | 3 | 4 | 147 | 1 | 6 | 66 | null | MIT | PHP |
Satyam1923/Spring-Music-Player | master | # ⭐️ Spring - Music Player ⭐️
The Spring Music Player with JioSaavn API Integration is a web application that allows users to listen to their favorite music tracks using the JioSaavn music streaming service. It provides a seamless and user-friendly interface for discovering, playing, and managing music playlists.
## ✨ Features ✨
- Music/Album/Playlists/Singer Search
- Playback Controls
- Top 10 search list
- Loop Playback
## 🚀 Tech Stack
**Client:** React, TailwindCSS
**Server:** Node, Express, Firebase, Axios
**API:** JioSaavn API (unofficial) - [API Link](http://jiosaavn-olj6ym1v4-thesumitkolhe.vercel.app)
## 🎨 Expected Design
![Screenshot 2024-05-13 143315](https://github.com/Satyam1923/Spring-Music-Player/assets/104068640/efe5fe9e-e049-4b00-bbd1-5182caff35de)
Check the design in [Figma](https://www.figma.com/file/mrTzLDEAtHPOsDl99R3kOY/Spring-Music-Player?type=design&node-id=0%3A1&mode=design&t=WCOysEPxmfpAsN12-1)
## 🌐 WebPage link
Visit the Spring Music Player [here](https://spring-music-player.vercel.app/)
## 🛠️ Getting Started
1. **Clone the repository**
```sh
git clone https://github.com/Satyam1923/Spring.git
```
### For Backend
1. **Navigate to the backend folder**
```sh
cd backend
```
2. **Install npm packages**
```sh
npm install .
```
3. **Run the server**
```sh
node index.js
```
4. **Access it locally**
Go to http://localhost:3030/
### For Frontend
1. **Navigate to the frontend folder**
```sh
cd frontend
```
2. **Install npm packages**
```sh
npm install .
```
3. **Run the development server**
```sh
npm run dev
```
4. **Access the local server**
You will receive a link in your terminal.
## Contributing Readme.
### For someone working on backend
1. Change directory
```sh
cd backend
```
2. Install npm packages
```sh
npm install .
```
3. Go to localhost
```sh
https://localhost:3030/
```
### For someone working on frontend
1. Change directory
```sh
cd frontend
```
2. Install npm packages
```sh
npm install .
```
3. Run server
```sh
npm run dev
```
## For someone working on backend+frontend
1. Change directory
```sh
cd backend
```
2. Install npm packages
```sh
npm install .
```
3. Go to localhost
```sh
https://localhost:3030/
```
4. Change directory
```sh
cd frontend
```
5. Install npm packages
```sh
npm install .
```
6. Change directory
```sh
cd src
```
7. change in app.jsx under app component fetchSongData function
change this url https://spring-music-player-3hyj.vercel.app/search with https://localhost:3030/search
## 🤝 Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
- If you have any suggestions for the projects, like reporting a bug, improving UI/UX, or enhancing the README.md file, feel free to **open an issue** to discuss it.
- Please ensure your pull request adheres to good practices and standards.
- Pleae ensure your pull request have reference to the issue assigned.
- Please make sure you check your spelling and grammar.
- Create individual Pull Requests for each issues.
## 🔧Creating a Pull Request
1. **Fork the Project**
2. **Clone your forked repository**
```sh
git clone https://github.com/Satyam1923/Spring.git
```
3. **Create a new branch and move to it**
```sh
git checkout -b fix-issue-<ISSUE-NUMBER>
```
4. **Make your changes, then check the status of changed files**
```sh
git status
```
5. **Add all the files to the staging area**
```sh
git add .
```
or
```sh
git add <file_name1> <file_name2>
```
6. **Commit your changes with a descriptive message**
```sh
git commit -m "<EXPLAIN-YOUR_CHANGES>"
```
7. **Push your changes to your branch**
```sh
git push origin fix-issue-<ISSUE-NUMBER>
```
8. **Open a Pull Request**
**Feel free to enhance this project and contribute in any way you find valuable!
Let's make Spring Music Player even better together. 🎶✨**
| The JioSaavn Player project aims to create a feature-rich music player application leveraging the unofficial JioSaavn API. This application will provide users with a seamless experience to discover, stream, and organize their favorite music tracks from the extensive JioSaavn library. | axios,ejs-templates,expressjs,javascript,nodejs,postman,vscode,api-rest,firebase,figma | 2024-04-11T15:25:21Z | 2024-05-22T17:16:50Z | null | 14 | 50 | 143 | 63 | 74 | 45 | null | MIT | JavaScript |
ialex32x/GodotJS | main |
GodotJS - TypScript/JavaScript for Godot with V8.
> [!NOTE]
> This project is still in the very early stage of development.
## Features
* [x] `ScriptLanguage` integration
* [x] Debug with Chrome devtools when using V8
* [x] REPL in Editor
* [ ] Hot-reloading
* [ ] Asynchronous module loading (`import` function)
* [ ] Sandboxed scripting (not multi-threading)
* [ ] Worker threads
## Get Started
Download or clone the repo into the `modules` directory of your Godot engine source:
```sh
cd YourGodotEngineSource/modules
git lfs clone https://github.com/ialex32x/GodotJS.git
```
Compile and launch `Godot Editor`. Then, [install TypeScript/JavaScript presets](./docs/install_ts_presets.md) into a Godot project.
For more information on how to use `GodotJS` in a project, check out [GodotJSExample](https://github.com/ialex32x/GodotJSExample.git) for examples written in typescript.
[![snake](./docs/assets/snake_01.gif)](https://github.com/ialex32x/GodotJSExample.git)
[![jummpybird](./docs/assets/jumpybird.gif)](https://github.com/ialex32x/GodotJSExample.git)
### Scripting
* [GodotJS Scripts](./docs/godotjs_scripts.md)
* [Godot Primitive Types](./docs/godot_primitive_types.md)
* [Running code in the editor](./docs/running_code_in_editor.md)
* [Signals](./docs/signals.md)
### Utilities
* [REPL](./docs/repl.md)
* [SourceMap](./docs/source_map.md)
* [Debugger](./docs/debugger.md)
### Advanced
* [Build V8](./docs/build_v8.md)
* [QuickJS (PLANNED)](./docs/quickjs.md)
* [Dependencies](./docs/deps.md)
* [Compiler Options](./docs/compiler_options.md)
## Supported Platforms
- [x] Windows: x86_64
- [ ] Windows: ARM64, UWP
- [x] MacOS: AppleSilicon
- [ ] Android
- [ ] iOS
- [ ] Linux
- [ ] WebAssembly (quickjs only)
| GodotJS - TypeScript/JavaScript for Godot | godot,javascript,scripting,typescript,v8,quickjs,godotjs,godotts | 2024-04-20T09:09:28Z | 2024-05-23T12:07:03Z | null | 1 | 0 | 78 | 0 | 0 | 42 | null | MIT | C |
Priyaaa1/StartConnect-Hub | main | # Welcome to StartConnect-Hub 🚀
StartConnect Hub is a revolutionary platform designed to bridge the gap between startups and investors, fostering collaboration, innovation, and growth in the entrepreneurial ecosystem. Our mission is to empower startups to succeed by providing them with the resources, connections, and support they need to thrive, while also enabling investors to discover and invest in promising opportunities.
## 🌟 Contributing
Contributions are always welcome! Follow these steps to get started:
1. **🍴 Fork this repository.**
- Click the `Fork` button at the top-right corner of this repository page to create a copy of the repository under your GitHub account.
2. **📥 Clone your forked copy of the project.**
```sh
git clone https://github.com/<your-username>/StartConnect-Hub.git
```
3. **📂 Change the working directory.**
```sh
cd StartConnect-Hub
```
4. **🔗 Add a reference to the original repository.**
```sh
git remote add upstream https://github.com/Priyaaa1/StartConnect-Hub.git
```
5. **🔍 Check the remotes for this repository.**
```sh
git remote -v
```
6. **⬇️ Always take a pull from the upstream repository to your main branch to keep it up-to-date with the main project (updated repository).**
```sh
git pull upstream main
```
7. **🌿 Create a new branch.**
```sh
git checkout -b <your_branch_name>
```
You are all set! 🎉
8. **🛠️ Perform your desired changes to the code base.**
9. **📊 Track your changes.**
```sh
git add .
```
10. **💬 Commit your changes with a relevant commit message.** For example, if you added a new feature, you could use:
```sh
git commit -m "Add feature X"
```
Or if you fixed a bug, you could use:
```sh
git commit -m "Fix issue Y"
```
11. **🚀 Push the committed changes in your feature branch to your remote repo.**
```sh
git push -u origin <your_branch_name>
```
12. **🔄 To create a pull request,** go to your forked repository on GitHub and click on `Compare & pull request`. Ensure you compare your feature branch to the desired branch of the repo you are supposed to make a PR to.
13. **🎉 Voila!** You have made a PR to the StartConnect-Hub project. Sit back patiently and relax while the project maintainers review your PR.
---
Thank you for your contributions! Your efforts help improve StartConnect Hub and support our mission to empower startups and investors. Happy coding! 🚀✨ | https://startconnect-hub.netlify.app/ | css,html,javascript,reactjs | 2024-04-04T19:52:48Z | 2024-05-23T16:02:00Z | null | 24 | 62 | 109 | 145 | 73 | 41 | null | null | JavaScript |
devXprite/gitglance | main | <h1 align="center">GitGlance</h1>
<h3 align="center">Tool for visualizing GitHub profiles</h3>
<p align="center">
<a href="https://gitglance.vercel.app/">View Demo</a>
·
<a href="https://github.com/devXprite/gitglance/issues/new?assignees=&labels=bug&template=bug_report.md&title=">Report Bug</a>
</p>
<br/>
<p>GitGlance is a powerful tool for visualizing a developer's GitHub profile, showcasing their contributions, fields of expertise, and much more. With GitGlance, developers can gain insights into their GitHub activity in an intuitive and visually appealing manner.
</p>
## Features
- **GitHub Profile Visualization:** GitGlance provides a comprehensive visualization of a developer's GitHub profile, including their contributions, repositories, and more.
- **Field of Contributions:** Understand the areas in which the developer contributes the most through a graphical representation.
- **GitHub GraphQL API Integration:** Utilizing the GitHub GraphQL API, GitGlance fetches user data directly from GitHub, ensuring accurate and up-to-date information.
- **Next.js & Tailwind CSS:** Built with Next.js for efficient server-side rendering and Tailwind CSS for easy styling and customization.
- **Responsive Design:** GitGlance is designed to be responsive, ensuring a seamless experience across various devices and screen sizes.
- **Dynamic Chart Generation:** GitGlance employs advanced chart generation techniques to dynamically visualize GitHub data. Whether it's plotting commit timelines, repository language distributions, or pull request statistics, GitGlance generates interactive and customizable charts.
## Screenshots
<!-- <img > -->
<img src="./public/screenshots/2.png" width="75%" />
<img src="./public/screenshots/3.png" width="75%" />
<img src="./public/screenshots/4.png" width="75%" />
<img src="./public/screenshots/5.png" width="75%" />
<img src="./public/screenshots/6.png" width="75%" />
## Installation
To run GitGlance locally, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/your-username/gitglance.git
```
2. Navigate to the project directory:
```bash
cd gitglance
```
3. Create a .env file in the root directory of the project by copying the .env.example file:
```bash
cp .env.example .env
```
4. Open the .env file and add your GitHub Personal Access Token:
```bash
GITHUB_TOKEN=
```
5. Install dependencies:
```bash
npm install
```
6. Start the development server:
```bash
npm run dev
```
7. Open your browser and visit `http://localhost:3000`
## Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
## How to Contribute
We welcome contributions from the community to enhance GitGlance further.You can use GitHub Desktop to manage this repository. Here's how:
1. **Download and Install GitHub Desktop**:
- Go to the [GitHub Desktop website](https://desktop.github.com/) and download the GitHub Desktop application.
- Follow the installation instructions to install GitHub Desktop on your computer.
2. **Clone the Repository**:
- Open GitHub Desktop and sign in to your GitHub account.
- Click on the "File" menu, then select "Clone Repository..."
- Choose the repository you want to clone from the list or enter its URL.
- Choose the local path where you want to clone the repository and click "Clone".
3. **Make Changes**:
- After cloning the repository, you can make changes to the files locally using your preferred code editor.
4. **Commit Changes**:
- Once you've made changes, open GitHub Desktop.
- You'll see a list of files with changes. Write a summary and description of your changes in the text fields.
- Click "Commit to main" to commit your changes locally.
5. **Push Changes**:
- To push your changes to the remote repository on GitHub.com, click "Push origin".
6. **Pull Changes**:
- If there are changes on the remote repository that you don't have locally, you can pull them by clicking "Fetch origin" or "Pull origin".
7. **Sync Changes**:
- To synchronize your local repository with the remote repository, click "Sync" to push and pull changes in one step.
That's it! You can now use GitHub Desktop to manage this repository efficiently.
## License
This project is licensed under the MIT License. see the LICENSE file for details.
## Acknowledgements
GitGlance utilizes the following technologies and libraries:
- [Next.js](https://nextjs.org/)
- [Tailwind CSS](https://tailwindcss.com/)
- [GitHub GraphQL API](https://docs.github.com/en/graphql)
- [Node.js](https://nodejs.org/)
## Support
This project needs a ⭐️ from you. Don't forget to leave a star ⭐️
| GitGlance is your go-to tool for visualizing GitHub profiles. Gain insights into your contributions, expertise, and community engagement with intuitive visualizations. | javascript,tailwindcss,github-profile-visualize,profile-visualize,github,mongoose,nextjs,nodejs,react,react-chartjs-2 | 2024-03-30T10:29:32Z | 2024-05-21T12:21:51Z | null | 11 | 15 | 47 | 25 | 17 | 36 | null | MIT | JavaScript |
getmeemaw/meemaw | main | <p align="center">
<img src="https://influchain.fra1.digitaloceanspaces.com/static/img/grandma-transparent-purple.png" width="180px" />
</p>
<h1 align="center">Meemaw</h1>
<h3 align="center">Trustless and Grandma-friendly Wallet as a Service</h3>
<p align="center">
<img src="https://img.shields.io/badge/Latest-v0.2-blue"/>
<img src="https://img.shields.io/badge/Stability-Beta-orange"/>
<img src="https://img.shields.io/badge/License-AGPL%20v3-green.svg"/>
</p>
<br />
Deploy a trustless wallet for each of your users, in a few lines of code 🚀
* Join us on [Discord](https://discord.gg/XD4dq4BE)
* [Get started](https://getmeemaw.com/docs/getting-started)
[https://getmeemaw.com](https://getmeemaw.com)
```diff
- Meemaw is still under heavy development, we would not advise you to use it in production just yet.
```
Table of Contents
=================
* [Introduction](#introduction)
* [Features](#features)
* [Getting Started](#getting-started)
* [Web](#web)
* [iOS](#ios)
* [Documentation](#documentation)
* [Contribute](#contribute)
* [License](#license)
# Introduction
Onboarding users on Web3 projects is a pain. You mostly have a choice between 3 options:
* letting your users fully manage their wallet with a terrible UX 🤮
* trusting another company with the private keys of your users 😨
* taking the burden on yourself and assume the risk of full custody 🤯
Not any more. We are building solutions to make it easier and more secure for developers to onboard new people to Web3, at scale.
Right now, **Meemaw allows you to deploy a trustless MPC-TSS wallet for each of your users.** [It only takes a few lines of code](#getting-started), even your Grandma would want to use it. It's also way less risky for you than trusting another company or holding the whole wallets yourself, as your server never sees the private keys.
# Features
Available right now:
- [x] **Trustless**: Meemaw wallets are MPC-TSS (Multi-Party Computation with Threshold Signature Scheme) wallets. They are non-custodial and zero-knowledge: the private keys of your users never appear on your servers so they don't need to trust you with their assets.
- [x] **Easy**: You can easily deploy Meemaw with Docker. You can then use the client SDKs to easily integrate it in a few lines of code. It's easy to offer an amazing web2-like experience to your users.
- [x] **Web & iOS**: It's super easy to integrate Meemaw in your Web & iOS apps. Just use the appropriate SDK and you're good to go. Note that we are planning to add support for Android and cross-platform frameworks as well.
- [x] **Integrates with your Auth**: Meemaw is built so that you can easily integrate with your own Auth provider. We are also continuously adding one-click integrations for more and more third-party Auth providers.
- [x] **Battle-tested technologies**: Meemaw is NOT innovating on the actual technology (TSS and others). Instead, it aims at bringing together established and production-ready technologies to form a coherent experience while reducing risk.
<!-- the next points are not as key and important, people will see it in docs or it's obvious -->
<!-- - [x] **Ethereum and more**: Meemaw is compatible with most blockchains (those based on ECDSA). On top of that, it provides helpers to send transactions and call smart contract on Ethereum and other EVM blockchains with one line of code. -->
<!--* **No vendor lock-in**: On top of being open-source and here to stay, Meemaw is built so that you can migrate at any time. From cloud or self-hosted to a competitor or to a different way of dealing with Web3 onboarding.-->
<!--* **Self-hosted**: Meemaw is built so that you can easily self-host it in just a few clicks. Depending on your objectives, you may want to install Meemaw with Docker or build it from source. Both options are available.-->
Exciting things we're looking forward to:
- [ ] **Android & Cross-platform frameworks**: If you're using Android or cross-platform frameworks, we plan to be able to cover your needs. Meemaw will be compatible with Web, iOS, Android, React Native, Flutter and Kotlin Multiplatform.
- [ ] **Multi-devices**: Most MPC-TSS Wallet providers only allow your users to access their wallet from one device. The plan is to allow your users to securely add new devices that are also able to access the wallet and its assets.
- [ ] **Biometrics & Passkeys**: Depending on platforms and applications, you will be able to encrypt and protect client shares with biometrics and/or passkeys. We want to reach state of the art security on all aspects.
- [ ] **Cloud offering**: You can easily self-host Meemaw with a few clicks, and soon you will be able to trust us to host it for you and make your life easier and safer. We will also offer Entreprise services and additional features for ambitious projects.
- [ ] **Account abstraction**: People often oppose MPC wallets with account abstractions, but they are complementary! We will combine them so you can abstract gas payment from your users, innovate on UX and add one more layer of protection, for example.
<!-- - [ ] **Dual server mode**: You will be able to perform the TSS process between two servers, removing the need to store anything client-side. You will also be able to combine one server you self-host and one server we host on our cloud, maximising the benefits. -->
We're super excited ☀️
# Getting Started
If you want to start using Meemaw, you should check [the getting started section of our docs.](https://getmeemaw.com/docs/getting-started) You will find a complete example including deployment of the server and integration of the client SDK. It's really accessible for any dev, seriously, you should check it for yourself!
However, you deserve a sneak peak right here :
### Web
Here is a simple example using the Meemaw SDK in JS to create a wallet and sign a transaction. Web3.js is used to send the transaction.
```javascript
import meemaw
import web3
// Create or recover a wallet for this user
const meemaw = new Meemaw('meemaw-url');
const wallet = await meemaw.GetWallet(jwt); // will recover the wallet if exists for the user or create a new one
// Instantiate Web3
const web3 = new Web3(new Web3.providers.HttpProvider('rpc-url'));
// Craft the transaction (adapt to your needs)
var raw = {
'to': '0x809ccc37d2dd55a8e8fa58fc51d101c6b22425a8',
'value': 10000000000000,
'nonce': 1,
'gasLimit': 21000,
'gasPrice': 10,
};
// Sign the transaction
const rawTransaction = await wallet.SignEthTransaction(raw, chainId);
// Send the signed transaction
const txReceipt = await web3.eth.sendSignedTransaction(rawTransaction);
console.log("Look at my fabulous transaction:", txReceipt);
```
### iOS
Here is a simple example using the Meemaw SDK in Swift to create a wallet and sign a transaction. Web3.swift from the Argent team is used to send the transaction.
```swift
import meemaw
import web3
// Create or recover a wallet for this user
let meemaw = Meemaw(server: "meemaw-url")
let wallet = try await meemaw.GetWallet(auth: jwt) // will recover the wallet if exists for the user or create a new one
// Instantiate Web3
guard let clientUrl = URL(string: "rpc-url") else { return }
let client = EthereumHttpClient(url: clientUrl)
// Craft the transaction (adapt to your needs)
let transaction = EthereumTransaction(
from: wallet.From(),
to: "0x809ccc37d2dd55a8e8fa58fc51d101c6b22425a8",
value: 10000000000000,
data: Data(),
nonce: 1,
gasPrice: 10,
gasLimit: 21000,
chainId: 1
)
// Sign and send the transaction with wallet
let txHash = try await client.eth_sendRawTransaction(transaction, withAccount: wallet)
print("Look at my fabulous transaction: \(txHash)")
```
# Documentation
Want to know how it works in more details or want to start using Meemaw in your projects?
Check [our docs here.](https://getmeemaw.com/docs/intro) 🚀
# Contribute
If you care about Web3 and want to participate in its future, you should join us! Contributions are welcome and greatly appreciated.
If you want to help, we actually have a list of things you can start doing right now 😊
For ideas, contribution guidelines and more, see [our docs](https://getmeemaw.com/docs/contribute/).
# License
Most of Meemaw is under the ***AGPLv3*** license. The client SDKs are under the ***Apache 2.0*** license. You can find more info on [how we intend those licenses here](licenses.md).
| Trustless and Grandma-friendly Wallet as a Service | crypto,cryptocurrency,cryptography,finance,golang,ios,javascript,mpc,self-hosted,swift | 2024-04-26T12:37:24Z | 2024-05-21T07:17:37Z | 2024-05-20T14:14:18Z | 1 | 3 | 39 | 0 | 3 | 34 | null | AGPL-3.0 | Go |
braiekhazem/Vidify | main | <div align="center"> <img alt="vidify-logo" src="https://res.cloudinary.com/dj6kxvxqb/image/upload/v1715187268/logo_t3smlf.svg" width="80" height="80" style="display:inline"> <h1 style="margin-top:0" >Vidify</h1></div>
<div align="center">
<a href="https://www.npmjs.com/package/vidify" title="MIT License">
<img src="https://img.shields.io/npm/l/vidify" alt="MIT License">
</a>
<a href="https://www.npmjs.com/package/vidify" title="Latest version">
<img src="https://img.shields.io/npm/v/vidify" alt="Latest version">
</a>
<a href="https://buymeacoffee.com/hazembraiek" title="Latest version">
<img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-donate-blue.svg" alt="Latest version">
</a>
</div>
### 🔗 🚀 Live Demo: [Demo](https://vidify-demo.netlify.app/)
## ✨ Features
- 📹 Video player component that provides consistent UI/UX on different browsers.
- 🎨 Super customizable layout.
- 📝 Provide tools for users to add annotations.
- 🔄 Vidify supports passing an array of video sources.
- 📱 Flexbox css with SVG icons. Mobile friendly.
- 🎨 Provide options for users to customize the primary color.
- ♿️ Accessibility supported, keyboards events supported.
- ✔️ Vidify offers all the essential features expected from a modern video player.
- 🛠️ Customize the control bar, progress bar, and more to match your a- pplication's design and user experience requirements.
- 🎮 Define states and actions to control Vidify with your own user interface elements.
- 📋 Vidify supports customizable ccontrol bar for enhanced user interaction.
- 💻 Written in TypeScript.
![screenshot](https://res.cloudinary.com/dj6kxvxqb/image/upload/v1715112645/Screen_Shot_2024-05-07_at_9.05.31_PM_v2jemq.png)
## 📦 Install
You can install Vidify via npm:
```bash
npm i vidify
```
Or using yarn:
```bash
yarn add vidify
```
## 🔨 Usage
```jsx
import { VideoPlayer } from "vidify";
const MyVideoPlayer = ({ src }) => (
<VideoPlayer src={src} autoplay className="my-video-player" />
);
export default MyVideoPlayer;
```
### ⌨️ Keyboard shortcuts (When video player focused)
| Key binding | Action |
| ----------- | ----------------- |
| Space or K | Play/Pause |
| shift + P | Next video |
| shift + N | Previous video |
| shift + D | Download |
| shift + S | Screenshot |
| ← | Rewind |
| → | Forward |
| ↑ | Volume up |
| ↓ | Volume down |
| M | Toggle mute |
| F | Toggle fullscreen |
## 🛠️ Props
### 🏷️ HTML Video Tag Native Attributes
| Props | Type | Default | Note |
| ----------- | ----------------------------- | ----------- | ---- |
| src | string\| string[] | '' | |
| preload | 'auto'\| 'metadata' \| 'none' | 'auto' | |
| autoPlay | boolean | false | |
| loop | boolean | false | |
| muted | boolean | false | |
| volume | number | 1.0 | |
| crossOrigin | string | 'anonymous' | |
##### More attributes details : [Vidify props attributes](https://github.com/braiekhazem/Vidify/blob/main/src/components/VideoPlayer/%40types.ts#L19)
### 🛠️ Vidify Props
| Prop | Type | Description |
| --------------- | -------------------------------------------------- | --------------------------------------------------------------------------------- |
| src | string\| string[] | The source(s) of the video file(s). |
| defaultSrcIndex | number | The index of the default source to play. |
| startTime | number | The time (in seconds) to start playing the video from. |
| children | React.ReactNode | Child elements to be rendered within the video player component. |
| className | string | Additional CSS class(es) to apply to the video player component. |
| id | string | The unique identifier of the video player component. |
| primaryColor | string | The primary color used for styling the video player interface. |
| annotation | ReactNode | Additional content (such as text or icons) to be displayed on the video player. |
| annotationStyle | CSSProperties | CSS styles to apply to the annotation content. |
| width | string | The width of the video player. |
| height | string | The height of the video player. |
| durationType | "remainingTime"\| "default" | The type of duration display for the video player. |
| placeholder | string | The URL of an image to display as a placeholder before the video loads. |
| title | string | The title of the video player. |
| style | CSSProperties | Custom CSS styles to apply to the video player. |
| controller | contextmenu\| boolean \| contextmenuRender | Configurations for the control bar of the video player. |
| volume | number | The volume level of the video player (0 to 1). |
| paused | boolean | Whether the video is paused or not. |
| poster | string | The URL of an image to display as the video poster. |
| thumbnail | string | The URL of an image to display as the video thumbnail. |
| autoPlay | boolean | Whether the video should automatically start playing when loaded. |
| playbackRate | number | The playback rate of the video (e.g., 1 for normal speed, 2 for double speed). |
| playsInline | boolean | Whether the video should play inline (e.g., in the same layout as other content). |
| preload | string | Specifies how the video should be loaded when the page loads. |
| crossOrigin | "anonymous"\| "use-credentials" \| "" \| undefined | The CORS setting for the video resource. |
| loop | boolean | Whether the video should loop playback. |
| muted | boolean | Whether the video should be muted. |
| containerRef | React.Ref`<any>` | Reference to the container element of the video player. |
| block | boolean | Whether the video player should be displayed full width or not. |
| rounded | boolean | |
### 🎉 Event Props
| Props | Type | Default | Note |
| ---------------- | ---------------- | ------- | ----------------------------------------------------------------------------------- |
| onClick | Function (Event) | null | Called when click on video player |
| onClickNext | Function (Event) | null | Called when click Next button |
| onClickPrevious | Function (Event) | null | Called when click Previous button |
| onPlay | Function (Event) | null | Called when user plays the video |
| onPause | Function (Event) | null | Called when user pauses the video |
| onAbort | Function (Event) | null | Called when unloading the video player, like when switching to a different src file |
| onEnded | Function (Event) | null | Called when playback has finished to the end of the file |
| onError | Function (Event) | null | Called when the video tag encounters an error |
| onProgress | Function (Event) | null | Called when the video is on progress |
| onLoadStart | Function (Event) | null | Called when the video is loading |
| onDurationChange | Function (Event) | null | Called when the duration video change |
| onVolumeChange | Function (Event) | null | Called when the volume video change |
| onScreenshot | Function (File) | null | Called when the user screenshot |
| onLoadedData | Function () | null | Called when the video data loaded |
| onWaiting | Function () | null | Called when the user is waiting the video to load |
| onDownload | Function () | null | Called when the user download the video |
## 🔄 Dynamic Source Switching with Tooltip Preview
Vidify supports passing an array of video sources (srcs) to enable dynamic source switching. This feature allows users to seamlessly switch between different video sources within the same player instance. Additionally, when hovering over the next or previous video button, Vidify displays a tooltip previewing the next or previous video. This enhancement provides users with a visual preview of upcoming content, enabling informed decisions when switching between videos.
```jsx
import { VideoPlayer } from "vidify";
const videoSources = [
"https://example.com/video1.mp4",
"https://example.com/video2.mp4",
"https://example.com/video3.mp4",
];
const MyVideoPlayer = () => (
<VideoPlayer
src={videoSources}
controls
autoplay
className="my-video-player"
/>
);
export default MyVideoPlayer;
```
![screenshot](https://res.cloudinary.com/dj6kxvxqb/image/upload/v1715112646/Screen_Shot_2024-05-07_at_9.07.27_PM_eca32w.png)
## 🎨 Customizable Primary Color
Vidify provides a 'primaryColor' prop that allows users to specify a custom primary color for the video player interface. This feature enables users to match the video player's appearance to their application's branding or design scheme.
```jsx
import { VideoPlayer } from "vidify";
const MyVideoPlayer = () => (
<VideoPlayer
src="https://example.com/video.mp4"
controls
autoplay
primaryColor="red"
className="my-video-player"
/>
);
export default MyVideoPlayer;
```
![screenshot](https://res.cloudinary.com/dj6kxvxqb/image/upload/v1715112647/Screen_Shot_2024-05-07_at_9.08.33_PM_xcf3ij.png)
## 🛠️ Control Bar and Progress Bar Customization
The `controller` prop in Vidify allows for fine-grained control over the visibility and customization of the control bar and progress bar. Users can choose from various options to tailor the video player interface according to their needs.
### Option 1: Hide Control Bar and Progress Bar
Setting `controller={false}` hides both the control bar and progress bar, providing a minimalist video player interface.
### Option 2: Custom Control Bar
Passing a function to the `controller` prop allows users to create their own custom control bar using React components. The function receives an `actions` object containing methods to control the video playback (e.g., `play`, `pause`).
```jsx
controller={(actions, info) => (
<div>
<span onClick={actions?.play}>Play</span>
<span onClick={actions?.pause}>Pause</span>
</div>
)}
```
### Option 3: Advanced Control Options
Users can provide an object to the `controller` prop to enable advanced control options. This object allows for granular control over individual components of the video player interface, such as the screenshot button, fullscreen button, and progress bar.
```jsx
controller={{
screenshot: {
allow: true,
style: { color: "red" },
className: "custom-button",
},
fullscreen: false,
progressBar: false,
controlBar: (actions, info) => (
<div style={{ display: "flex", columnGap: "10px" }}>
<p>{info.currentTime} / {info.duration}</p>
<button onClick={actions?.play}>Play</button>
<button onClick={actions?.pause}>Pause</button>
<p>Volume</p>
<input
type="range"
onChange={(e) => actions?.setVolume(+e.target. value / 100)}
/>
<button onClick={actions?.screenShot} >ScreenShot</button>
<button onClick={actions?.download}>Download</button>
</div>
),
}}
```
![screenshot](https://res.cloudinary.com/dj6kxvxqb/image/upload/v1715112646/Screen_Shot_2024-05-07_at_9.10.19_PM_vtqkes.png)
### Option 4: Custom Buttons
Users can add custom buttons to the control bar by providing an array of custom button objects. Each button object specifies the button's content and placement (either "left" or "right").
```jsx
controller={{
customButtons: [
{ content: <div>Button 1</div>, placement: "left" },
{ content: <div>Button 2</div>, placement: "right" },
],
}}
```
## ❤️ Support
If you've found Vidify useful and would like to support its ongoing development, you can donate via Buy Me a Coffee:
<a href="https://buymeacoffee.com/hazembraiek" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" width="200"></a>
Your support is greatly appreciated! ☕️❤️
## ⌨️ Development
🚀 Follow these steps to clone and run Vidify locally:
```bash
$ git clone https://github.com/braiekhazem/Vidify.git
$ cd vidify
$ npm install # dependencies for package
$ cd demo
$ npm install # dependencies for demo site
$ cd ..
$ npm run dev # for running the development server
# OR
$ npm run demo # for running the demo
```
Open your browser and visit [http://localhost:3000]().
## 🤝 How to Contribute
Thank you for considering contributing to Vidify! Here's how you can help:
### Opening Issues
If you encounter any bugs or have suggestions for improvements, please [open an issue](https://github.com/your-username/vidify/issues) on GitHub. Be sure to include detailed information about the issue or suggestion, along with any relevant screenshots or code examples.
### Pull Requests
We welcome contributions from the community! If you'd like to contribute code changes, enhancements, or new features, please follow these steps:
1. Fork the repository to your GitHub account.
2. Create a new branch for your feature or bug fix.
3. Make your changes and ensure they are thoroughly tested.
4. Submit a pull request with a clear description of your changes and the problem they solve.
5. We'll review your pull request and provide feedback or merge it into the main branch.
### Code Style
Please adhere to the existing code style and conventions when making changes to the codebase. This helps maintain consistency and readability across the project.
### Feature Requests
If you have an idea for a new feature or improvement, feel free to [open an issue](https://github.com/braiekhazem/Vidify/issues) to discuss it with the maintainers and community members. We're always interested in hearing your ideas!
By contributing to Vidify, you're helping to make it a better tool for everyone. Thank you for your support!
## 📜 License
```markdown
Copyright 2024 Hazem braiek
Licensed under the Apache License, Version 2.0.
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
| Vidify is a modern, customizable video player for React applications, designed to provide seamless video playback and a personalized UI experience. | component-library,customizable,frontend,interactive,javascript,media,modern,react-components,reactjs,typescript | 2024-03-22T16:17:41Z | 2024-05-21T18:51:28Z | null | 2 | 27 | 74 | 1 | 5 | 34 | null | NOASSERTION | TypeScript |
rithask/ktu-results-aggregator | main | null | Find all your semesters' result all at once in one place with beautiful graph | javascript,ktu,apjaktu,ktu-notifications,ktu-results | 2024-04-19T03:41:01Z | 2024-05-16T19:59:11Z | null | 1 | 0 | 66 | 3 | 0 | 34 | null | GPL-3.0 | JavaScript |
sai6855/material-ui-advanced | master | # material-ui-advanced
## About
Collection of advanced UI components built on top of material-ui that can be used in your projects. Each component comes with its own source code that you can copy and paste into your project.
Explore the components and view demos at [material-ui-advanced.com](https://material-ui-advanced.com/).
## Components Included
- **Nested Menu:** A component for organizing menu items into subcategories, enabling easier navigation through hierarchical menus. [Source code](https://github.com/sai6855/material-ui-advanced/blob/master/src/components/NestedMenu.tsx) [Demo](https://material-ui-advanced.com/)
- **Debounced Input:** An input field that delays processing user input until they pause typing. [Source code](https://github.com/sai6855/material-ui-advanced/blob/master/src/components/DebouncedInput.tsx) [Demo](https://material-ui-advanced.com/#debounced-input)
- **OTP Input:** A specialized input field for entering one-time passwords. [Source code](https://github.com/sai6855/material-ui-advanced/blob/master/src/components/OtpInput.tsx) [Demo](https://material-ui-advanced.com/#otp-input)
- **Input File Upload:** A file upload component that allows users to select files for upload, also supports drag-and-drop functionality. [Source code](https://github.com/sai6855/material-ui-advanced/blob/master/src/components/InputFileUpload.tsx) [Demo](https://material-ui-advanced.com/#input-file-upload)
- **Swipeable Tabs:** Tabs you can slide through to switch between different sections, making it easy to navigate on touchscreens. [Source code](https://github.com/sai6855/material-ui-advanced/blob/master/src/components/SwipeableTabs.tsx) [Demo](https://material-ui-advanced.com/#swipeable-tabs)
- **Stacked Snackbar:** A stack of snackbars that appear one on top of the other, allowing users to see multiple notifications at once. [Source code](https://github.com/sai6855/material-ui-advanced/blob/master/src/components/StackedSnackBar.tsx) [Demo](https://material-ui-advanced.com/#stacked-snackbar)
## Upcoming Components
Stay tuned for the following upcoming components:
- Tagging in Text Area
- Tour
- Carousel
---
If you find these components useful, please consider giving this repository a star!
| Collection of advanced UI components built on top of material-ui | advanced-ui,front-end,javascript,material-design,material-ui,react,typescript | 2024-04-01T09:53:02Z | 2024-04-09T16:54:34Z | null | 1 | 2 | 68 | 0 | 2 | 33 | null | null | TypeScript |
aadeshkulkarni/medium-app | master | # Blogging-app [Fullstack Javascript]
![blogging app](https://i.ibb.co/zxM16cs/Screenshot-2024-05-14-at-11-33-44-PM.png)
[Medium-app](https://medium-app-zeta.vercel.app/) is a React frontend and Cloudflare workers backend application offering features replicating Medium, the popular blogging platform. The application comes with JWT authentication, Postgres database, and various user features.
---
## ✨ Features
- Sign up and Sign in securely via token-based authentication.
- View all published articles.
- Create, Edit, and Delete articles.
- Link an article to a topic.
- View specific article.
- Bookmark an article (Save for later).
- Like an article.
- Search for articles.
- Filter articles based on topics.
- View & edit user profile.
- **Generate article content based on title using AI.**
#### In the pipeline:
- Voiceover
- Recommendation system
> (More features TBA)
---
## 🛠 Tech Stack
The application is built with the following technologies:
- [React](https://reactjs.org/) for the frontend.
- [Cloudflare Workers](https://workers.cloudflare.com/) for the serverless backend.
- [Zod](https://zod.dev) for validation library and TypeScript type inference.
- [TypeScript](https://www.typescriptlang.org/) as the main programming language.
- [Prisma](https://www.prisma.io/) with connection pooling as the ORM.
- [Postgres](https://www.postgresql.org/) as the database.
- [JSON Web Tokens (JWT)](https://jwt.io/) for authentication.
## 📁 Project Structure
The project is structured into the following directories:
- Backend: Contains server-side code and logic.
- Common: Shared assets and modules used by frontend and backend. (NPM Library)
- Frontend: Contains client-side code and logic.
---
## 💻 Local Setup
### Backend
- Navigate into the backend directory `cd backend`
- Set up Postgres DATABASE_URL in .env. You can get a free PostgreSQL connection string from [Aiven.io](https://aiven.io/).
- Set up Prisma connection pool DATABASE_URL in wrangler.toml file. You can get this for free from [Prisma](https://www.prisma.io/data-platform/accelerate).
- Set up JWT Secret JWT_SECRET in wrangler.toml file. This can be any value.
- Install dependencies using `npm install`
- Run the application locally using `npm run dev`
> Note: wrangler.toml is the environment configuration file for a serverless backend. .env is used by Prisma for connection pooling. Ensure you configure both environment files accordingly.
### Frontend
- Navigate into the frontend directory using `cd frontend`
- Install dependencies using `npm install`
- Run the application locally using `npm run dev`
---
### AI based Article content generation
- set `FF_ENABLE_AI` = true in config.ts
- set `OPENAI_API_KEY` in wrangler.toml file in the backend.
- The feature is enabled only when title is atleast 10 characters long.
### Docker-Setup
- For this setup complete all the Frontend, Backend process including the Postgres, Prisma connection pool and JWT secret
- Navigate to the root directory and run command `docker-compose up -d`, runs command in detached mode.
- At last Navigate to the url `http://localhost:80` for viewing the website.
---
## 🔧 Technologies & Libraries
- [ReactJS](https://react.dev/)
- [Typescript](https://www.typescriptlang.org/)
- [Cloudflare Workers - Serverless Backend](https://www.cloudflare.com/)
- [Aiven.io - PostgreSQL Database](https://www.aiven.io/)
- [Prisma - ORM](https://www.prisma.io/)
- [Hono](https://hono.dev/) - Small, simple, and ultra-fast web framework for the edges.
- [Zod](https://zod.dev/) - TypeScript-first schema validation with static type inference
---
## 🚀 Deployments
For detailed steps to deploy the application, refer to `backend/commands.md` and `common/commands.md` in their respective directories.
## 🤝 Contributors
<a href="https://github.com/aadeshkulkarni/medium-app/graphs/contributors">
<img src="https://contrib.rocks/image?repo=aadeshkulkarni/medium-app" />
</a>
| Opensource fullstack blogging app built using reactjs & serverless backend (cloudfare using honojs) | blog,cloudfare-workers,honojs,javascript,npm-library,reactjs,zod,blogging,nodejs,opensource | 2024-04-25T13:27:42Z | 2024-05-23T16:23:28Z | null | 12 | 34 | 131 | 17 | 26 | 31 | null | null | TypeScript |
Note-Vault/Note-Vault | main | # Note-Vault📝
Welcome to our project!👋
## Project Description
"Note Vault" is a comprehensive note-taking website designed with the users productivity and organization in mind. This versatile platform enables users to create, edit, delete, search, and seamlessly organize their notes, providing an all-around solution to their note-taking needs.
- Deployment Link : [Note-Vault](https://note-vault-tkco.onrender.com/)
## Features 🪶
- Create, Edit, Delete, Search, and Organize Notes
## Technologies Used ⚙️
- Frontend: HTML, CSS, JavaScript, Ejs
- Backend: Node.js, Express.js, MongoDB
- Version Control: Git, GitHub
<img width="959" alt="1" src="https://github.com/alishasingh06/Note-Vault/assets/114938485/02b7c3ae-5389-4eee-8bcb-ce85ea54e6e3">
<img width="959" alt="2" src="https://github.com/alishasingh06/Note-Vault/assets/114938485/660029a3-ead7-4cc7-ac9a-bbece2889f50">
<img width="959" alt="3" src="https://github.com/alishasingh06/Note-Vault/assets/114938485/8a331d15-75a8-4e56-86fa-4d6a68a13dd8">
# How to make a PR in our Project 🤔
If you are interested in this project how to start contributing:
<!-- in detail -->
1. Fork the repo.
2. After forking, clone the repo to your local machine.
To clone the repo to your local machine, run the following command in your terminal:
```bash
git clone https://github.com/Note-Vault/Note-Vault.git
```
3. Add a remote upstream to the original repo.
To add a remote upstream, run the following command in your terminal:
```bash
git remote add upstream https://github.com/Note-Vault/Note-Vault
```
4. Create a new branch.
To create a new branch, run the following command in your terminal:
```bash
git checkout -b <your-branch-name>
```
5. Make changes in source code.
6. Add your changes
To add your changes, run the following command in your terminal:
```bash
git add <File1 changed> <File2 changed> ...
```
7. Commit your changes.
To commit your changes, run the following command in your terminal:
```bash
git commit -m "<your-commit-message>"
```
8. Push your changes.
To push your changes, run the following command in your terminal:
```bash
git push origin <your-branch-name>
```
9. Create a PR ✅ .
__________________________________________________________________________________________________________________________________________________________________
## Alternatively Using GitHub Desktop🧑💻
1. Open GitHub Desktop and log in to your GitHub account.
2. Make sure you are on the "Current Repository" view. If not, go to "File" and select "Add Local Repository" to add your repository.
3. In the "Current Repository" view, ensure you are on the branch which you want to submit a pull request for. If you're not on the correct branch, use the "Branch" menu to switch to the correct branch.
4. Once you're on the correct branch, make your changes and commit them to the branch. You can do this by clicking the "+" button in the upper-left corner of the GitHub Desktop window, making your changes, and then entering a commit message.
5. After you've made your changes and committed them, click the "Push origin" button in the top-right corner of the GitHub Desktop window. This will push your changes to the remote repository on GitHub.
6. Now, go to the GitHub website, navigate to your fork of the repository, and you should see a button to "Compare & pull request" between your fork and the original repository, click on it.
7. On the pull request page, you can review your changes and add any additional information, such as a title and a description, that you want to include with your pull request.
8. Once you are satisfied with your pull request, click the "Create pull request" button to submit it.
**Note:** To create a pull request, you must have a fork of the original repository in your GitHub account and you must have made the changes in that forked repository.
## Usage 👀
To get started, simply clone the repository and open the `terminal` in your code editor.
- ```bash
npm install
```
- ```bash
npm start
```
## MongoDB connection:
1. Connect MongoDB Compass:
Open MongoDB Compass and connect to the MongoDB server at mongodb://localhost:27017.
![image](https://github.com/Chelseasingla1/Note-Vault/assets/129886894/2c796637-752f-4a49-a7e9-ec8069eee5e4)
2. Click on Connect.
![image](https://github.com/Chelseasingla1/Note-Vault/assets/129886894/b75f1efe-4ada-40fd-afe5-167242ec37d0)
3. In terminal it would be mentioned as "Connected to MongoDB".
4. After database connection you can see database collections:(database name (NoteVault), collection name (notebooks , users)):
![image](https://github.com/Chelseasingla1/Note-Vault/assets/129886894/6f6d14ce-ce27-4abd-b41c-026585846614)
## Contributing 🧑💻
- Fork the repository.
- Create your feature branch: git checkout -b feature-name
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin feature-name
- Submit a pull request.
## 🤝 Our Contributors
<div>
<a href="https://github.com/Note-Vault/Note-Vault/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Note-Vault/Note-Vault"/>
</a>
</div>
<br>
Thank you for contributing to our project! We appreciate any contributions, whether it's bug fixes, new features, or documentation improvements.
We value the time and effort you put into contributing, and we look forward to reviewing and merging your contributions. Join us on this exciting journey of creativity and collaboration, and let your projects shine on NestOndc!
<div align=center>
<h2>This Project is the part of</h2>
<img alt="GSSoC" src="https://raw.githubusercontent.com/GirlScriptSummerOfCode/MentorshipProgram/master/GSsoc%20Type%20Logo%20Black.png#gh-light-mode-only" width=87%>
<img alt="GSSoC" src="https://user-images.githubusercontent.com/63473496/213306279-338f7ce9-9a9f-4427-8c2a-3e344874498f.png#gh-dark-mode-only"/>
</div>
## License
This project is licensed under the [ISC License](LICENSE).
## Acknowledgements :)
We extend our heartfelt gratitude to the organizers of GSSoC for offering this invaluable platform to exhibit our talents and make meaningful contributions to the open-source community. Your efforts in fostering a collaborative environment for budding developers are commendable, and we are privileged to be a part of such an esteemed event. Thank you for providing us with the opportunity to showcase our skills and contribute to the advancement of open-source technology.
⭐ Don't forget to give us a star! ⭐
| "Note Vault" is a comprehensive note taking website designed with user’s productivity and organization in mind. This versatile platform enables users to create, edit, delete, search, and seamlessly organize their notes, providing an all-round solution to their note-taking needs. | gssoc,ejs,javascript,open-source | 2024-04-30T14:12:58Z | 2024-05-23T10:10:51Z | null | 46 | 110 | 257 | 65 | 75 | 30 | null | null | EJS |
EdgarDegas/DSBridge-Swift | main | [^1]
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/EdgarDegas/DSBridge-Swift/assets/12840982/ed61fed2-a356-4772-a0b0-38a39bd0d5a9">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/EdgarDegas/DSBridge-Swift/assets/12840982/8c1ad005-6866-4ea3-a690-d33e564fde57">
<img alt="Logo" src="https://github.com/EdgarDegas/DSBridge-Swift/assets/12840982/e1e1d27c-efe4-401d-87a2-3b5c371e0af9">
</picture>
[^1]: Designed by [Freepik](https://freepik.com)
[简体中文版](https://github.com/EdgarDegas/DSBridge-Swift/blob/main/README.zh-Hans.md)
DSBridge-Swift is a [DSBridge-iOS](https://github.com/wendux/DSBridge-IOS) fork in Swift. It allows developers to send method calls back and forth between Swift and JavaScript.
# Usage
Check out [wiki](https://github.com/EdgarDegas/DSBridge-Swift/wiki) for docs.
## Installation
DSBridge is available on both iOS and Android.
This repo is a pure Swift version. You can integrate it with Swift Package Manager.
> It's totally OK to use Swift Package Manager together with CocoaPods or other tools. If Swift Package Manager is banned, use [the original Objective-C version DSBridge-iOS](https://github.com/wendux/DSBridge-IOS).
For Android, see [DSBridge-Android](https://github.com/wendux/DSBridge-Android).
You can link the JavaScript with CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/dsbridge@3.1.4/dist/dsbridge.js"></script>
```
Or install with npm:
```shell
npm install dsbridge@3.1.4
```
#
## Brief
First of all, use `DSBridge.WebView` instead of `WKWebView`:
```swift
import class DSBridge.WebView
class ViewController: UIViewController {
// ......
override func loadView() {
view = WebView()
}
// ......
}
```
Declare your `Interface` with the `@Exposed` annotation. All the functions will be exposed to JavaScript:
```swift
import Foundation
import typealias DSBridge.Exposed
import protocol DSBridge.ExposedInterface
@Exposed
class MyInterface {
func addingOne(to input: Int) -> Int {
input + 1
}
}
```
For functions you do not want to expose, add `@unexposed` to it:
```swift
@Exposed
class MyInterface {
@unexposed
func localMethod()
}
```
Aside from `class`, you can declare your `Interface` in `struct` or `enum`:
```swift
@Exposed
enum EnumInterface {
case onStreet
case inSchool
func getName() -> String {
switch self {
case .onStreet:
"Heisenberg"
case .inSchool:
"Walter White"
}
}
}
```
You then add your interfaces into `DSBridge.WebView`.
The second parameter `by` specifies namespace. `nil` or an empty string indicates no namespace. There can be only one non-namespaced `Interface` at once. Also, there can be only one `Interface` under a namespace. Adding an `Interface` to an existing namespace replaces the original one.
```swift
webView.addInterface(MyInterface(), by: nil) // `nil` works the same as ""
webView.addInterface(EnumInterface.onStreet, by: "street")
webView.addInterface(EnumInterface.inSchool, by: "school")
```
Done. You can call them from JavaScript now. Do prepend the namespace before the method names:
```javascript
bridge.call('addingOne', 5) // returns 6
bridge.call('street.getName') // returns Heisenberg
bridge.call('school.getName') // returns Walter White
```
> DSBridge supports multi-level namespaces, like `a.b.c`.
Asynchronous functions are a little bit different. You have to use a completion handler to send your response:
```swift
@Exposed
class MyInterface {
func asyncStyledFunction(callback: (String) -> Void) {
callback("Async response")
}
}
```
Call from JavaScript with a function accordingly:
```javascript
bridge.call('asyncStyledFunction', function(v) { console.log(v) });
// ""
// Async response
```
As you can see, there is a empty string returned. The response we sent in the interface is printed by the `function`.
DSBridge allows us to send multiple responses to a single invocation. To do so, add a `Bool` parameter to your completion. The `Bool` means `isCompleted` semantically. If you pass in a `false`, you get the chance to repeatedly call it in future. Once you call it with `true`, the callback function will be deleted from the JavaScript side:
```swift
@Exposed
class MyInterface {
func asyncFunction(
input: Int,
completion: @escaping (Int, Bool) -> Void
) {
// Use `false` to ask JS to keep the callback
completion(input + 1, false)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
completion(input + 2, false)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
// `true` to ask JS to delete the callback
completion(input + 3, true)
}
// won't have any effect from now
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
completion(input + 4, true)
}
}
}
```
Call from JavaScript:
```javascript
bridge.call('asyncFunction', 1, function(v) { console.log(v) });
// ""
// 2
// 3
// 4
```
# Differences with DSBridge-iOS
## Seamless `WKWebView` Experience
When using the old DSBridge-iOS, in order to implement `WKWebView.uiDelegate`, you'd have to set `dsuiDelegate` instead. In DSBridge-Swift, you can just set `uiDelegate`.
The old `dsuiDelegate` does not respond to new APIs, such as one that's released on iOS 16.4:
```swift
@available(iOS 16.4, *)
func webView(
_ webView: WKWebView,
willPresentEditMenuWithAnimator animator: any UIEditMenuInteractionAnimating
) {
}
```
Even if your `dsuiDelegate` does implement it, it won't get called on text selections or editing menu animations. The reason is that the old DSBridge-iOS relay those API calls to you by implementing them ahead of time and calling `dsuiDelegate` inside those implementations. This causes it to suffer from iOS iterations. Especially that it crashes when it tries to use the deprecated `UIAlertView`.
DSBridge-Swift, instead, makes better use of iOS Runtime features to avoid standing between you and the web view. You can set the `uiDelegate` to your own object just like what you do with bare `WKWebView` and all the delegation methods will work as if DSBridge is not there.
On the contrary, you'd have to do the dialog thing yourself. And all the dialog related APIs are removed, along with the `dsuiDelegate`.
## Static instead of Dynamic
When using the old DSBridge-iOS, your *JavaScript Object* has to be an `NSObject` subclass. Functions in it have to be prefixed with `@objc`. DSBridge-Swift, however, is much more Swift-ish. You can use pure Swift types like `class` or even `struct` and `enum`.
## Customizable
DSBridge-Swift provides highly customizable flexibility which allows you to change almost any part of it. You can even extends it to use it with another piece of completely different JavaScript. See section *Open / Close Principle* below.
## API Changes
### Newly added
A new calling method that allows you to specify the expected return type and returns a `Result<T, Error>` instead of an `Any`.
```swift
call<T>(
_: String,
with: [Any],
thatReturns: T.Type,
completion: @escaping (Result<T, any Swift.Error>) -> Void
)
```
### Renamed
- `callHandler` is renamed to `call`
- `setJavascriptCloseWindowListener` to `dismissalHandler`
- `addJavascriptObject` to `addInterface`
- `removeJavascriptObject` to `removeInterface`
### Removed
- `loadUrl(_: String)` is removed. Define your own one if you need it
- `onMessage`, a public method that's supposed to be private, is removed
- `dsuiDelegate`
- `disableJavascriptDialogBlock`
- `customJavascriptDialogLabelTitles`
- and all the `WKUIDelegate` implementations
### Not Implemented
- Debug mode not implemented yet.
# Open / Close Principle
DSBridge-Swift has a Keystone that holds everything together.
> A keystone is a stone at the top of an arch, which keeps the other stones in place by its weight and position. -- Collins Dictionary
Here is how a synchronous method call comes in and returns back:
<img src="https://github.com/EdgarDegas/DSBridge-Swift/blob/main/assets/image-20240326210400582.png?raw=true" width="500" />
## Resolving Incoming Calls
The `Keystone` converts raw text into an `Invocation`. You can change how it resolves raw text by changing `methodResolver` or `jsonSerializer` of `WebView.keystone`.
```swift
import class DSBridge.Keystone
// ...
(webView.keystone as! Keystone).jsonSerializer = MyJSONSerializer()
// ...
```
There might be something you don't want in the built-in JSON serializer. For example it won't log details about an object or text in production environment. You can change this behavior by defining your own errors instead of using the ones defined in `DSBridge.Error.JSON`.
`methodResolver` is even easier. It simply reads a text and finds the namespace and method name:
```swift
(webView.keystone as! Keystone).methodResolver = MyMethodResolver()
```
## Dispatching
After being resolved into an `Invocation`, the method call is sent to `Dispather`, where all the interfaces you added are registered and indexed.
You can, of course, replace the dispatcher. Then you would have to manage interfaces and dispatch calls to different interfaces in your own `InvocationDispatching` implementation.
```swift
(webView.keystone as! Keystone).invocationDispatcher = MyInvocationDispatcher()
```
## JavaScript Evaluation
To explain to you how we can customize JavaScript evaluation, here's how an asynchronous invocation works.
Everything is the same before the invocation reaches the dispatcher. The dispatcher returns an empty response immediately after it gets the invocation, so that the webpage gets to continue running. From now on, the synchronous chain breaks.
<img src="https://github.com/EdgarDegas/DSBridge-Swift/blob/main/assets/image-20240326210427127.png?raw=true" width="500" />
Dispatcher sends the invocation to `Interface` at the same time. But since the way back no longer exists, DSBridge-Swift has to send the repsonse by evaluating JavaScript:
<img src="https://github.com/EdgarDegas/DSBridge-Swift/blob/main/assets/image-20240326210448065.png?raw=true" width="500" />
The `JavaScriptEvaluator` is in charge of all the messages towards JavaScript, including method calls initiated from native. The default evaluator evaluates JavaScript every 50ms to avoid getting dropped by iOS for evaluating too frequently.
If you need further optimization or you just want the vanilla experience instead, you can simply replace the `Keystone.javaScriptEvaluator`.
## Keystone
As you can see from all above, the keystone is what holds everything together. You can even change the keystone, with either a `Keystone` subclass or a completely different `KeystoneProtocol`. Either way, you will be able to use DSBridge-Swift with any JavaScript.
| DSBridge-iOS in Swift. Allows developers to send synchronous/asynchronous method calls between Swift and JavaScript code. | javascript,javascriptbridge,jsbridge,swift,wkwebview,wkwebview-javascript-bridge,wkwebview-js | 2024-03-22T10:49:14Z | 2024-04-23T15:39:19Z | null | 1 | 3 | 22 | 0 | 1 | 30 | null | MIT | Swift |
keyurparalkar/render-million-rows | main | # Render One Million Rows By Drawing
This project is a demonstration of how you can render 1 million rows in a table by drawing. I made use of the canvas API to achieve this task.
I have also demonstrated this project as a part of the talk in Reactjs-pune meetup. Details about the talk can be found below:
* Slides - [Render Million Rows.pdf](https://github.com/keyurparalkar/render-million-rows/files/15064694/Render.Million.Rows.pdf)
* [Talk](https://www.meetup.com/reactjs-and-friends/events/299595472/)
## Data Source
I took this repository as my data source - [https://github.com/datablist/sample-csv-files](https://github.com/datablist/sample-csv-files). It contains sample CSV data for a range of rows, i.e., 0.5M, 1M rows, etc.
## Inspiration
I got inspired to do this project when I was exploring how Google Sheets are able to render 0.5 million rows. I also got inspired by the Glide Apps Data Grid library, which helped me understand the concept of canvas drawing: [https://github.com/glideapps/glide-data-grid](https://github.com/glideapps/glide-data-grid).
## Approach
I took an approach of drawing each and every row of a CSV file onto a target canvas that displays these rows. Once the CSV data is loaded, a worker is created that creates an offscreen canvas based on the scroll top value. This offscreen canvas will have 100 rows drawn onto it.
I make use of the `drawImage` function to blit the rows from the offscreen canvas to the target canvas. This happens on every scroll.
Here is a short video that demonstrates ~1 Million rows drawn:
[https://github.com/keyurparalkar/render-million-rows/assets/14138515/348a7267-651a-4b47-aa42-9472318effa4](https://github.com/keyurparalkar/render-million-rows/assets/14138515/348a7267-651a-4b47-aa42-9472318effa4)
Also, I was able to render ~2 Million rows as well:
[https://github.com/keyurparalkar/render-million-rows/assets/14138515/1cf80b9d-bd0c-449c-a0de-0322e1536a7b](https://github.com/keyurparalkar/render-million-rows/assets/14138515/1cf80b9d-bd0c-449c-a0de-0322e1536a7b)
## Future Enhancement
- Improve the current blitting approach by self-blitting the target canvas.
| A project to demonstrate rendering 1 million rows in React | canvas,css,html5,javascript,papaparse,reactjs,typescript | 2024-03-15T05:59:28Z | 2024-04-22T14:51:53Z | null | 1 | 0 | 35 | 0 | 2 | 28 | null | null | TypeScript |
the-illarionov/the-superviral-word-game | master | # The Superviral Word Game
![](./frontend/public/img/og:image_en.jpg)
You can play this game [right here](https://the-superviral-word-game.com).
What can be interesting here for developers:
1. [How I used XState to save the world of managing game state](#xstate).
2. [How I wrote my own mini WebGL-engine inspired by pixijs](#webgl).
3. [How I made CloudFlare Worker to behave like normal server](#cloudflare-worker).
4. [JSON array of 108092 english nouns](#english-nouns).
5. [How to develop your own version of this game](#development).
Stack:
Frontend: vue 3, xstate, typescript, vite-ssg, tailwind
Backend: cloudflare pages (static hosting), cloudflare workers (websocket), twilio (STUN/TURN servers)
## XState
[XState is a state management and orchestration solution for JavaScript and TypeScript apps](https://stately.ai/docs/xstate).
One of it's many killer features is that it allows you to have a graphical representation of your business logic.
![](./frontend/src/machines/MachineApp/MachineApp.png)
[Check how all of the game logic sits on fancy graceful diagrams](./frontend/src/machines/).
Moreover, I use XState for E2E-testing solution too, [check it here](./frontend/e2e/).
Visual representation is so cool that even non-programmer can actually understand what the hell is happening in your code.
Also, you can forget about documentation, because, well, XState produces it automatically.
And, as if this were not enough, XState has an [awesome inspector](https://stately.ai/docs/inspector), which allows you to visually observe how your machines transitions in realtime and debug them.
https://github.com/the-illarionov/the-superviral-word-game/assets/3993003/bdd267e3-e6e1-478a-bf59-6dd40dfa2dd0
I MEAN HOW COOL IS THAT?
## WebGL
I am a big fan of computer graphics, so it was very fun to toy with native WebGL.
I wrote custom graphics engine inspired by [pixijs](https://pixijs.com/), you can [check it here](./frontend/src/machines/MachineGraphics/Engine/).
## CloudFlare Worker
Nothing special actually, but there is one trick to make worker behave like normal server.
Worker sits on distributed edge and doesn't exist as one instance so it's pretty tricky to share state. And that's the exact problem [CloudFlare Durable Objects](https://developers.cloudflare.com/durable-objects/) solve.
So you have a [storage](https://developers.cloudflare.com/durable-objects/reference/in-memory-state/) which is consistent and shares state between multiple worker instances. But the problem is it must be serializable, so we can't hold a direct reference to an object there.
So i've come with solution which utilizes [alarms](https://developers.cloudflare.com/durable-objects/api/alarms/). It pings my Durable Object instance every 10 seconds so it keeps alive.
The cost of it is 300k requests per month, but it's totally fine for me, because CloudFlare provides 10 million requests per month at a basic paid plan.
You can check worker source code [here](./backend/src/).
# English nouns
You can use my custom list of 108 092 english nouns in [JSON array](./.dictionaries/txttojson/volume/json/en.json).
At first, I've collected all of the available english nouns in [txt format](./txttojson/volume/txt_additional/en.txt).
Then I generated another [txt file](./txttojson/volume/txt/en.txt) using [nltk](./nltk/).
And then combined them into [JSON array](./txttojson/volume/json/en.json), excluding duplicates using [nodejs](./txttojson/volume/change.js).
# Development
If you want tp create your own version of this game, you need to have [docker](https://www.docker.com/) and [taskfile](https://taskfile.dev/) installed. The rest is fully dockerized.
If you launch for the first time:
```
cd .dev
task env
task init
task up
```
If not:
```
cd .dev
task up
```
And that's all!
But remember that accoding to [license](./LICENSE), you can distribute your version of the game only on non-commercial open-source conditions.
| A Vue word game based on the Yakut national sport "Mas-wrestling". Uses XState for state management, WebRTC for multiplayer and has custom WebGL engine | cloudflare,game-development,gamedev,javascript,javascript-game,webrtc,websocket,xstate,vue,vue3 | 2024-04-19T01:41:11Z | 2024-05-10T23:43:21Z | null | 1 | 0 | 2 | 0 | 1 | 26 | null | GPL-3.0 | TypeScript |
liyupi/daily-good-code | master | # daily-good-code
每日优质代码分享,代码小抄:https://codecopy.cn
## 2404
[240416_Java 实现归并排序算法_代码小抄.md](code%2F2404%2F240416_Java%20%E5%AE%9E%E7%8E%B0%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240415_Python 实现二分查找算法_代码小抄.md](code%2F2404%2F240415_Python%20%E5%AE%9E%E7%8E%B0%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE%E7%AE%97%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240414_Java 实现二分查找算法_代码小抄.md](code%2F2404%2F240414_Java%20%E5%AE%9E%E7%8E%B0%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE%E7%AE%97%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240413_Python 实现归并排序算法_代码小抄.md](code%2F2404%2F240413_Python%20%E5%AE%9E%E7%8E%B0%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240412_我成功复刻了安卓 6 彩蛋 Flappy Droid !_代码小抄.md](code%2F2404%2F240412_%E6%88%91%E6%88%90%E5%8A%9F%E5%A4%8D%E5%88%BB%E4%BA%86%E5%AE%89%E5%8D%93%206%20%E5%BD%A9%E8%9B%8B%20Flappy%20Droid%20%21_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240411_Java 实现快速排序算法_代码小抄.md](code%2F2404%2F240411_Java%20%E5%AE%9E%E7%8E%B0%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240410_Java 使用递归反转句子_代码小抄.md](code%2F2404%2F240410_Java%20%E4%BD%BF%E7%94%A8%E9%80%92%E5%BD%92%E5%8F%8D%E8%BD%AC%E5%8F%A5%E5%AD%90_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240409_Java 实现字符串转为日期_代码小抄.md](code%2F2404%2F240409_Java%20%E5%AE%9E%E7%8E%B0%E5%AD%97%E7%AC%A6%E4%B8%B2%E8%BD%AC%E4%B8%BA%E6%97%A5%E6%9C%9F_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240408_Java 实现冒泡排序算法_代码小抄.md](code%2F2404%2F240408_Java%20%E5%AE%9E%E7%8E%B0%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240407_Java 打印数组_代码小抄.md](code%2F2404%2F240407_Java%20%E6%89%93%E5%8D%B0%E6%95%B0%E7%BB%84_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240406_Java 反转数字_代码小抄.md](code%2F2404%2F240406_Java%20%E5%8F%8D%E8%BD%AC%E6%95%B0%E5%AD%97_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240405_arrayCopy 优雅使用_代码小抄.md](code%2F2404%2F240405_arrayCopy%20%E4%BC%98%E9%9B%85%E4%BD%BF%E7%94%A8_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240404_优雅提取表达式_代码小抄.md](code%2F2404%2F240404_%E4%BC%98%E9%9B%85%E6%8F%90%E5%8F%96%E8%A1%A8%E8%BE%BE%E5%BC%8F_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240403_位运算代替乘除法_代码小抄.md](code%2F2404%2F240403_%E4%BD%8D%E8%BF%90%E7%AE%97%E4%BB%A3%E6%9B%BF%E4%B9%98%E9%99%A4%E6%B3%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240402_try-catch 优雅使用_代码小抄.md](code%2F2404%2F240402_try-catch%20%E4%BC%98%E9%9B%85%E4%BD%BF%E7%94%A8_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240401_Guava 重试_代码小抄.md](code%2F2404%2F240401_Guava%20%E9%87%8D%E8%AF%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
## 2403
[240331_后端跨域配置_代码小抄.md](code%2F2403%2F240331_%E5%90%8E%E7%AB%AF%E8%B7%A8%E5%9F%9F%E9%85%8D%E7%BD%AE_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240329_markdown 转纯文本_代码小抄.md](code%2F2403%2F240329_markdown%20%E8%BD%AC%E7%BA%AF%E6%96%87%E6%9C%AC_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240328_Redisson 限流_代码小抄.md](code%2F2403%2F240328_Redisson%20%E9%99%90%E6%B5%81_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240327_获取字符串第 n 次出现的索引_代码小抄.md](code%2F2403%2F240327_%E8%8E%B7%E5%8F%96%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%AC%AC%20n%20%E6%AC%A1%E5%87%BA%E7%8E%B0%E7%9A%84%E7%B4%A2%E5%BC%95_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240326_根据 code 获取小程序登录信息_代码小抄.md](code%2F2403%2F240326_%E6%A0%B9%E6%8D%AE%20code%20%E8%8E%B7%E5%8F%96%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%99%BB%E5%BD%95%E4%BF%A1%E6%81%AF_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240325_富文本转纯文本_代码小抄.md](code%2F2403%2F240325_%E5%AF%8C%E6%96%87%E6%9C%AC%E8%BD%AC%E7%BA%AF%E6%96%87%E6%9C%AC_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240324_统一响应结果_代码小抄.md](code%2F2403%2F240324_%E7%BB%9F%E4%B8%80%E5%93%8D%E5%BA%94%E7%BB%93%E6%9E%9C_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240323_处理 Spring 事务导致的锁失效_代码小抄.md](code%2F2403%2F240323_%E5%A4%84%E7%90%86%20Spring%20%E4%BA%8B%E5%8A%A1%E5%AF%BC%E8%87%B4%E7%9A%84%E9%94%81%E5%A4%B1%E6%95%88_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240322_使用 try-with-resources 关闭资源_代码小抄.md](code%2F2403%2F240322_%E4%BD%BF%E7%94%A8%20try-with-resources%20%E5%85%B3%E9%97%AD%E8%B5%84%E6%BA%90_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240321_避免循环查库_代码小抄.md](code%2F2403%2F240321_%E9%81%BF%E5%85%8D%E5%BE%AA%E7%8E%AF%E6%9F%A5%E5%BA%93_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240320_使用 Optional 判空_代码小抄.md](code%2F2403%2F240320_%E4%BD%BF%E7%94%A8%20Optional%20%E5%88%A4%E7%A9%BA_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240319_Java 中使用正则表达式_代码小抄.md](code%2F2403%2F240319_Java%20%E4%B8%AD%E4%BD%BF%E7%94%A8%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240318_优雅统计耗时_代码小抄.md](code%2F2403%2F240318_%E4%BC%98%E9%9B%85%E7%BB%9F%E8%AE%A1%E8%80%97%E6%97%B6_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240317_日期时间处理_代码小抄.md](code%2F2403%2F240317_%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%E5%A4%84%E7%90%86_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240316_MyBatis-Plus 优雅查询_代码小抄.md](code%2F2403%2F240316_MyBatis-Plus%20%E4%BC%98%E9%9B%85%E6%9F%A5%E8%AF%A2_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240315_集合高阶操作_代码小抄.md](code%2F2403%2F240315_%E9%9B%86%E5%90%88%E9%AB%98%E9%98%B6%E6%93%8D%E4%BD%9C_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240314_饿汉式单例模式_代码小抄.md](code%2F2403%2F240314_%E9%A5%BF%E6%B1%89%E5%BC%8F%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240313_快速排序_代码小抄.md](code%2F2403%2F240313_%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240312_阶乘_代码小抄.md](code%2F2403%2F240312_%E9%98%B6%E4%B9%98_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240311_全局异常处理_代码小抄.md](code%2F2403%2F240311_%E5%85%A8%E5%B1%80%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240310_接口日志输出_代码小抄.md](code%2F2403%2F240310_%E6%8E%A5%E5%8F%A3%E6%97%A5%E5%BF%97%E8%BE%93%E5%87%BA_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240309_SpringBoot优雅创建客户端对象_代码小抄.md](code%2F2403%2F240309_SpringBoot%E4%BC%98%E9%9B%85%E5%88%9B%E5%BB%BA%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%AF%B9%E8%B1%A1_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md)
[240308_bean 与 url 的 query 参数相互转换_代码小抄.md](code%2F2403%2F240308_bean%20%E4%B8%8E%20url%20%E7%9A%84%20query%20%E5%8F%82%E6%95%B0%E7%9B%B8%E4%BA%92%E8%BD%AC%E6%8D%A2_%E4%BB%A3%E7%A0%81%E5%B0%8F%E6%8A%84.md) | 每日优质代码分享,代码小抄:https://codecopy.cn | backend,code,cpp,frontend,go,java,javascript,programmer,python | 2024-04-02T10:11:40Z | 2024-04-19T03:06:12Z | null | 2 | 2 | 10 | 0 | 2 | 25 | null | null | null |
omrajsharma/bigohhh.com | main |
![Logo](https://github.com/omrajsharma/bigohhh.com/blob/main/client/public/images/logo.png?raw=true)
<div align="center">
<h3>Website for BigOhhh.com: <a href="https://bigohhh.com/">Click Here!🚀</a></h3>
<h3>Don't forget to drop a ⭐</h3>
</div>
<div align="center">
![GitHub contributors](https://img.shields.io/github/contributors/omrajsharma/bigohhh.com?style=for-the-badge&color=blue)
![GitHub Closed issues](https://img.shields.io/github/issues-closed-raw/omrajsharma/bigohhh.com?style=for-the-badge&color=brightgreen)
![GitHub PR Open](https://img.shields.io/github/issues-pr/omrajsharma/bigohhh.com?style=for-the-badge&color=aqua)
![GitHub PR closed](https://img.shields.io/github/issues-pr-closed-raw/omrajsharma/bigohhh.com?style=for-the-badge&color=blue)
![GitHub language count](https://img.shields.io/github/languages/count/omrajsharma/bigohhh.com?style=for-the-badge&color=brightgreen)
![GitHub top language](https://img.shields.io/github/languages/top/omrajsharma/bigohhh.com?style=for-the-badge&color=aqua)
![GitHub last commit](https://img.shields.io/github/last-commit/omrajsharma/bigohhh.com?style=for-the-badge&color=blue)
![GitHub Maintained](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg?style=for-the-badge)
![Github Repo Size](https://img.shields.io/github/repo-size/omrajsharma/bigohhh.com?style=for-the-badge&color=aqua)
</div>
---
## 👋 Welcome contributors!
### Fuel your coding journey with free, high-quality resources. BigOhhh is your one-stop shop for learning in-demand coding skills. Explore our open-source library of articles, tutorials, and projects. Dive deep with expert-crafted blogs and contribute your own knowledge to our growing community. BigOhhh empowers you to learn at your own pace. Start coding, collaborating, and building your future today!
![Website](https://github.com/omrajsharma/bigohhh.com/blob/main/client/public/images/image_processing20220419-31825-1yzr3x9.png?raw=true)
## Please follow the [Code of Conduct](https://github.com/omrajsharma/bigohhh.com/blob/main/client/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/omrajsharma/bigohhh.com/blob/main/client/CONTRIBUTION.md) while contributing in this project repository.
## 🧮 Workflow
- Go through the project repository and the [README](https://github.com/omrajsharma/bigohhh.com/blob/main/README.md) to get an idea about this repository.
- Check out the existing issues present there in the [Issues](https://github.com/omrajsharma/bigohhh.com/issues) section.
- Comment out in the issue, you wanna work on.
- Wait for the issue to be assigned to you. Once it's assigned to you, start working on it.
- Fork the repository.
- Clone your forked repository using terminal or gitbash. Also you can simply use the web version of GitHub to add your files.
- Make changes to the cloned repository.
- Add, Commit and Push.
- Then in Github, in your cloned repository find the option to make a pull request.
- Project admin will evaluate your PR and provide remarks accordingly. If it satisfies all the criteria, your PR will be merged and your contributions will be counted.
---
## ❄️Open Source Programs!
<table>
<tr>
<td align="center">
<a href="https://gssoc.girlscript.tech/"><img src="https://media.licdn.com/dms/image/C510BAQGSObrO0QPlMQ/company-logo_200_200/0/1630597186826/girlscriptsoc_logo?e=1722470400&v=beta&t=riGIryHFCH81TLbHmS3YZhyuz4ymzuYKgIXY0MpP14M" width=100px height=100px /><br /><sub><b>GSSoC 2024</b></sub></a>
</td>
</tr>
</table>
## 🤔 New to Open Source programs/events!
Here are few articles which will help you to get an idea on how you start contributing in open source projects,
You can refer to the following articles on the basics of Git and Github.
- [Watch this video to get started, if you have no clue about open source](https://youtu.be/SYtPC9tHYyQ)
- [Forking a Repo](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
- [Cloning a Repo](https://help.github.com/en/desktop/contributing-to-projects/creating-a-pull-request)
- [How to create a Pull Request](https://opensource.com/article/19/7/create-pull-request-github)
- [Getting started with Git and GitHub](https://towardsdatascience.com/getting-started-with-git-and-github-6fcd0f2d4ac6)
---
<h2>✔Project Admin</h2>
<table>
<tr>
<td align="center"><a href="https://github.com/omrajsharma"><img src="https://avatars.githubusercontent.com/u/60071210?v=4" width="80px;" alt=""/><br /><sub><b>Omraj Sharma</b></sub></a></td>
</tr>
</table>
---
<h2>✨ Contributors</h2>
Thanks goes to these Wonderful People. Contributions of any kind are welcome!🚀
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<a href="https://github.com/omrajsharma/bigohhh.com/graphs/contributors">
<img src="https://contrib.rocks/image?repo=omrajsharma/bigohhh.com" />
</a>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
---
<h2>⭐Give this Project a Star</h2>
[![Portfolio](https://img.shields.io/badge/Omraj_Sharma_Portfolio-blue)](https://omrajsharma.github.io/)
[![GitHub Follow](https://img.shields.io/github/followers/omrajsharma?label=Follow%20@omrajsharma&style=social)](https://github.com/omrajsharma)
[![Twitter Follow](https://img.shields.io/twitter/follow/omrajsharma?style=social)](https://twitter.com/om_raj_sharma)
If you liked working on this project, do ⭐ and share this repository.
🎉 🎊 😃 Happy Contributing 😃 🎊 🎉
<h2>📬 Contact</h2>
If you want to contact me, you can reach me through social handles.
<a href="https://twitter.com/om_raj_sharma"><img src="https://seeklogo.com/images/T/twitter-icon-circle-blue-logo-0902F48837-seeklogo.com.png" width="25"></img></a> <a href="https://www.linkedin.com/in/omraj-sharma/"><img src="https://www.felberpr.com/wp-content/uploads/linkedin-logo.png" width="25"></img></a> | Frontend codebase for a coding bootcamp website. | frontend,gssoc24,javascript,js,nextjs,reactjs | 2024-03-30T18:14:01Z | 2024-05-21T20:27:38Z | null | 20 | 43 | 36 | 100 | 43 | 24 | null | null | TypeScript |
kubit-ui/kubit-react-components | main | <p align="center">
<a href="https://kubit-ui.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./assets/banner_kubit_readme.png">
<img src="./assets/banner_kubit_readme.png" width="70%">
</picture>
</a>
</p>
<div align='center'>
<a href='#'>
<img src='./assets/version.png' width="150px">
</a>
<a href='#'>
<img src='./assets/license.png' width="230px">
</a>
</div>
<br />
---
<br />
# Getting Started
## Installation
To install the package, run the following command:
### npm
```bash
npm install @kubit-ui-web/react-components
```
### yarn
```bash
yarn add @kubit-ui-web/react-components
```
This will install the package and its dependencies. Now you can import the components and use them in your application.
## Usage
To use the components, import them from the package and use them in your application.
```tsx
import { Button, KubitProvider } from '@kubit-ui-web/react-components';
import React from 'react';
const App = () => {
return (
<KubitProvider>
<Button variant="PRIMARY" size="MEDIUM">
Click me
</Button>
</KubitProvider>
);
};
export default App;
```
This will render the button with the default styles and functionality.
> Note: The `KubitProvider` is required to use the components. It provides the theme and other context to the components.
You can foud more information about change the theme and other options in the [Customize theme](https://kubit-ui.com)
## Documentation
You can find the documentation for the web components in the [Kubit UI website](https://kubit-ui.com)
## Storybook
To run the storybook, first of all clone the repository and install the dependencies. Then run the following command:
```bash
npm run storybook
yarn storybook
```
This will start the storybook server and you can see the components in action.
## Tests
To run the tests, you can use the following command:
```bash
npm run test
yarn test
```
This will run the tests and show the results in the terminal.
## Contributing
We are open to contributions. If you want to contribute to the project, please follow the steps below:
1. **Fork the Repository**: Click the "Fork" button in the upper right corner of the repository's page on GitHub. This will create a copy of the repository in your account.
2. **Clone the Repository**: Use `git clone` to clone the repository to your local machine.
```sh
git clone
```
3. **Create a Branch**: Use `git checkout` to create a new branch for your changes.
```sh
git checkout -b <branch-name>
```
4. **Make Changes**: Make any necessary changes to the codebase. And **test** the changes.
5. **Commit Changes**: Use `git commit` to commit your changes to the branch.
```sh
git commit -m "Your commit message"
```
6. **Push Changes**: Use `git push` to push your changes to your forked repository.
```sh
git push origin <branch-name>
```
7. **Open a Pull Request**: Go to the original repository on GitHub and click the "New pull request" button. Fill out the form with details about your changes and submit the pull request.
Once your pull request has been submitted, a maintainer will review your changes and provide feedback. If everything looks good, your pull request will be merged and your changes will become part of the project.
For more information on contributing to our projects, please refer to the `CONTRIBUTING.md` file.
| Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience. | accesibility,components,components-library,components-react,design-pattern,design-system,javascript,react,storybook,typescript | 2024-03-20T15:12:02Z | 2024-05-12T06:29:17Z | 2024-05-12T06:29:17Z | 2 | 10 | 86 | 0 | 3 | 24 | null | Apache-2.0 | TypeScript |
agencyenterprise/px-cli | main | # px
[![npm version](https://img.shields.io/npm/v/%40ae-studio%2Fpx)](https://www.npmjs.com/package/@ae-studio/px)
[![npm license](https://img.shields.io/npm/l/%40ae-studio%2Fpx)](./LICENSE)
[![monthly downloads](https://img.shields.io/npm/dm/%40ae-studio%2Fpx)](https://www.npmjs.com/package/@ae-studio/px)
**px** is a CLI tool used to run commands across different JavaScript package managers.
With **px**, you no longer need to switch between package managers when working on different projects. It detects the project's package manager and forwards the command for you. The command is not changed, just forwarded.
## Features
- Execute the same set of commands without needing to switch package managers
- Automatically installs and uninstalls **TypeScript declaration packages** with their corresponding npm packages
- For npm, **px** automatically adds the `run` prefix for npm scripts (e.g. `px dev` results in `npm run dev`)
- Compatible with **npm, pnpm, and yarn**
## Install
Before installing **px**, ensure you have **Node.js >= 16** installed on your machine.
```sh
npm install -g @ae-studio/px
```
## Usage
To use **px**, simply replace your package manager command with `px` followed by the usual arguments you would pass. For example:
```sh
px install # Installs dependencies
px dev # Runs the 'dev' script, automatically adding 'run' for npm
px test # Executes the 'test' script
px build # Builds the project
```
**px** will detect the package manager your project is using and execute the command as if you had used the package manager's native CLI.
## Automatic TypeScript Declarations
**px** improves the experience of working in TypeScript projects by making it easier to manage TypeScript declaration packages. When you install or uninstall npm packages in a TypeScript project, **px** will:
- **On install**: Automatically search for and install the corresponding TypeScript declaration packages (`@types/*`) if they exist.
- **On uninstall**: Check for any installed declaration packages associated with the npm packages being removed and uninstall them as well.
This feature saves time and ensures your TypeScript types stay in sync with your installed packages, all without the need for manual intervention.
## License
This tool is open-source and available under the MIT License. See the [LICENSE](./LICENSE) file for details.
---
Built with 🧡 by [AE Studio](https://ae.studio/join-us?utm_source=sds&utm_medium=referral&utm_campaign=px-cli&utm_content=footer&utm_term=3ff5251a-e107-4d47-bfb8-b2962debd252)
| 🪄 Package manager eXecutor for JavaScript projects | javascript,nodejs,npm,pnpm,typescript,yarn | 2024-04-28T18:50:00Z | 2024-05-02T15:57:21Z | null | 26 | 0 | 33 | 0 | 0 | 24 | null | MIT | JavaScript |
SB2318/UltimateHealth | main | # UltimateHealth
## About:
UltimateHealth is an innovative open-source project that aims to provide a comprehensive online library and article management application focused on health. The project is designed to cater to users who are looking for reliable and trustworthy information on various health-related topics.
## Features:
From the beginner perspective, the project consists of three main modules: Article Section, Chat Section, and Podcasts. The Article Section includes:
* Diseases-related information
* General health-related guidance
* Survival experiences from critical diseases
* Backend Development
Users can also listen to articles(audio features) if they prefer. The Chat Section features a guider bot that helps users solve their health-related problems.
Hello! Congratulations to all the GSSOC'24 contributors and mentors!🎉
I'm thrilled to be a part of this amazing team and I'm excited to work together to make the Ultimate Health project a huge success. Let's collaborate, learn, and grow together!
## Getting Started:
Follow these steps to get started with UltimateHealth:
**Clone the repository:**
```
https://github.com/SB2318/UltimateHealth.git
cd UltimateHealth
```
**Checkout develop branch and select your preferences (backend or frontend)**.
```
git checkout develop
```
## For Frontend:
**Install dependencies:**
```
npm install --legacy-peer-deps
```
**Configure the application: (For IOS and Backend)**
Update configuration files if necessary. Ensure the Ethereum wallet connection details are set.
**Run the applications**.
To run the frontend server use:
For android :
`npm run android`
For ios:
`npm run ios`
## For Backend:
## MongoDB Installation
1. **Install MongoDB**
- Download the appropriate MongoDB installation package for your operating system from the official MongoDB website: https://www.mongodb.com/try/download
- Follow the installation instructions for your specific platform.
2. **Set up a MongoDB database**
- After installation, start the MongoDB server by running the `mongod` command.
- MongoDB will create a default data directory to store your databases.
- Use the `mongo` shell or a GUI client like MongoDB Compass to interact with your databases.
3. **Follow the Steps to Initialize the backend server**
## Setting up a Backend Server
Follow the steps to setup backend in your system
```
cd backend
```
Create .env file if not present and add the following variables in the file
```
PORT=
MONGODB_URL=""
JWT_SECRET=""
```
**Install necessary dependency from package.json**
`npm install -s`
**Once dependencies are installed, run the server using following command**
`npm run dev`
Alternate Command to run the server once
`node server.js`
**Backend API URL**
```
http://localhost:{PORT}/api/
```
**Make Sure to replace the proper PORT value for Backend API**
**Access the application:**
Open your web browser and navigate to (LOCAL_HOST_URL).
If you would like to contribute to the project, please follow the contribution guidelines.
## Testing Frontend with Localhost Backend Server
When working with a backend server running on localhost, frontend developers can follow these guidelines to test their application:
1. **Start the backend server**
- Before testing the frontend application, ensure that the backend server is running on localhost.
- Navigate to the backend project directory and start the server (e.g., `node server.js` for a Node.js server).
- The server should be listening on a specific port (e.g., `http://localhost:{PORT}`).
2. **Configure the frontend application**
- In the frontend application, locate the configuration file or the section where the API base URL is defined.
- Set the API base URL to point to the local backend server.
3. **Use appropriate HTTP clients**
- During development, frontend developers can use browser tools like the Network tab in the developer tools or dedicated HTTP clients like Postman or Insomnia to test the backend API endpoints.
- Send HTTP requests to the local backend server and observe the responses.
4. **Handle CORS (Cross-Origin Resource Sharing)**
- If the frontend application is running on a different port or domain than the backend server, the browser may block the requests due to CORS restrictions.
- To handle CORS, the backend server should be configured to allow cross-origin requests from the frontend application's origin.
- CORS is handled in the current backend server
5. **Proxy requests (optional)**
- Some frontend frameworks (e.g., Create React App, Vue CLI) provide a built-in proxy feature that forwards requests from the frontend application to the backend server.
- Configure the proxy in the frontend application's development settings to automatically forward API requests to the local backend server.
6. **Use environment variables**
- Avoid hardcoding the backend server URL in the frontend application.
- Instead, use environment variables to store the backend server URL and read it during runtime.
7. **Test different scenarios**
- Test various user flows and interactions with the backend API, such as creating, reading, updating, and deleting data.
- Simulate different scenarios, including error cases and edge cases, to ensure the frontend application and backend server handle them correctly.
**Access the application:**
Open your web browser and navigate to (LOCAL_HOST_URL).
If you would like to contribute to the project, please follow the contribution guidelines.
## Contribution GuideLines:
* **Checkout and make your changes for the develop branch only:** When working on your contributions, switch to the **develop** branch in your local repository. This ensures that you are working on the latest version of the codebase.
* **Create pull requests only for the develop branch:** When you are ready to submit your changes, create a pull request (PR) targeting the **develop** branch. This allows the maintainers to review and merge your code into the main development branch.
* **Maintain contribution guidelines:** Each project may have its own specific contribution guidelines. It's important to familiarize yourself with these guidelines before submitting your contributions. Adhering to these guidelines ensures consistency and helps maintain the quality of the codebase.
* **Format your commit message with the issue number:** When making commits related to an issue, follow the format **Fixes: #32 in your commit message. Replace 32 with the issue number you are addressing.** This helps track and manage issues more efficiently.
* **Attach a Postman response screenshot for backend tasks:** For tasks related to the backend, it is recommended to include a screenshot of the Postman response along with your pull request. This provides additional context and helps reviewers understand the changes made and their impact on the backend functionality.
* **Make your pull request descriptive and include examples:** When creating a pull request, provide a clear and descriptive explanation of the changes you made. This helps reviewers understand the purpose and significance of your contribution. Additionally, including at least one example that demonstrates the intended usage or effect of your changes can be beneficial.
* **Rebase your commits and optimize file changes:** When submitting your pull request, consider rebasing your commits into one commit and optimizing your file changes. This helps keep the commit history clean and makes it easier for reviewers to understand your changes.
Remember, following these guidelines will help ensure a smooth and efficient contribution process. Happy coding!
## Contact:
Discord Server (Susmita Bhattacharya, user_name: susmita_)
| UltimateHealth is an innovative open source project that serves as an online library and article management application focused on health. | android,javascript,node-js,react-native,express-js,gssoc | 2024-04-29T17:15:15Z | 2024-05-23T11:49:01Z | null | 9 | 30 | 41 | 14 | 30 | 23 | null | MIT | TypeScript |
HasmikSarg/CalcOldVersion | main | # CalcOldVersion
A simple calculator project developed with HTML, CSS, and JavaScript.
---
## Usage
1. Clone or download the repository.
2. Open `index.html` in your web browser.
3. Start calculating!
---
## Features
- Basic arithmetic operations (addition, subtraction, multiplication, division).
- Clear and backspace functionality.
- User-friendly interface.
| A calculator project made with HTML, CSS, and JavaScript, offering basic math functions | calculator-javascript,calcultor,javascript | 2024-03-27T10:46:53Z | 2024-03-27T10:59:47Z | null | 1 | 0 | 1 | 1 | 1 | 22 | null | null | JavaScript |
shahradelahi/p-safe | master | # p-safe
[![npm](https://img.shields.io/npm/v/p-safe)](https://www.npmjs.com/package/p-safe)
[![npm bundle size](https://packagephobia.now.sh/badge?p=p-safe)](https://packagephobia.now.sh/result?p=p-safe)
> Safely handle promise rejections
Useful for codes that are way out of your league and you want to handle everything! (e.g. API calls)
### Install
```bash
npm install p-safe
```
### Usage
```typescript
import { trySafe } from 'p-safe';
const { error } = trySafe<void, CustomError>(async (_, reject) => {
await promiseThatMightReject();
const { statusText } = await fetch('...');
if (statusText !== 'OK') {
reject(new CustomError('Request failed for a silly reason'));
}
});
// Return type is `SafeReturn<void, CustomError>`
if (error) {
// Handle error
return console.error(error);
}
console.log(error); // undefined
```
Or implement your function and only use `SafeReturn` type:
```typescript
import type { SafeReturn } from 'p-safe';
async function foo(): Promise<SafeReturn<object, Error>> {
const resp = await fetch('...');
if (!resp.ok) {
return { error: new Error('Request failed for a silly reason') };
}
return { data: await resp.json() };
}
const { data, error } = await foo();
if (error) {
console.log(error); // ERROR
console.log(data); // undefined
return;
}
console.log(error); // undefined
console.log(data); // { ... }
```
Are you still confused? Let me explain it in a simple way. `p-safe` is a simple utility that helps you to safely handle
promise rejections. It's a simple and clean way to handle promise rejections without using `try/catch` blocks.
Check out the [tests](/index.test.ts) for more examples.
### Related
- [p-catch-if](https://github.com/sindresorhus/p-catch-if) - Conditional promise catch handler
- [p-if](https://github.com/sindresorhus/p-if) - Conditional promise chains
- [p-tap](https://github.com/sindresorhus/p-tap) - Tap into a promise chain without affecting its value or state
- [p-log](https://github.com/sindresorhus/p-log) - Log the value/error of a promise
- [More…](https://github.com/sindresorhus/promise-fun)
### License
[MIT](/LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi)
| Safely handle promise rejections | async,javascript,nodejs,promises | 2024-03-15T08:28:57Z | 2024-05-23T12:53:13Z | 2024-05-23T12:53:13Z | 1 | 1 | 7 | 0 | 0 | 22 | null | MIT | TypeScript |
boywithkeyboard/deno.re | main | null | The immutable Deno module registry for GitHub repositories. | deno,immutable,javascript,module-registry,modules,registry,typescript,cdn,permanent | 2024-04-02T14:39:41Z | 2024-05-18T07:40:07Z | null | 1 | 74 | 125 | 0 | 0 | 21 | null | MIT | TypeScript |
vontanne/handwritten-digit-recognition | master | # Handwritten Digit Recognition
## Overview
The "Handwritten Digit Recognition" is a simple yet effective tool for recognizing handwritten digits. This project is powered by a machine learning model originally trained with PyTorch, and the outputs have been adapted to JavaScript format for use in the browser. The application utilizes arrays and matrices to represent biases and weights, allowing for quick and efficient digit recognition.
## Live Demo
Experience the "Handwritten Digit Recognition" directly in your browser [here](https://vontanne.github.io/handwritten-digit-recognition).
## How It Works
The core of the "Handwritten Digit Recognition" is a neural network, which is a computational model inspired by the human brain. It consists of layers of interconnected nodes or "neurons" that process input data, learn from it, and make predictions. In this case, the model predicts handwritten digits from 0 to 9 using learned weights and biases from the training phase.
## Running the Project
To use the "Handwritten Digit Recognition":
1. Clone the project from the GitHub repository.
2. Ensure you have Node.js installed on your local machine.
3. Navigate to the project directory in your terminal.
4. Run the project using the command `npm run start` or `node app.js`.
5. Open your web browser and go to `localhost:8080`.
You'll be greeted with a canvas where you can draw a digit using your mouse or touchscreen. Upon drawing, the prediction chart next to the canvas will display the recognized digit, with the height of the columns representing the model's confidence in its prediction.
## Technologies Used
The project is built with HTML, CSS, and JavaScript, running on Node.js without the need for any third-party dependencies or Node.js frameworks. For digit drawing, the HTML5 Canvas API is employed.
## About PyTorch and Neural Networks
[PyTorch](https://pytorch.org/) is an open-source machine learning library used for applications such as computer vision and natural language processing. It's known for its flexibility and ease of use in building and training neural networks.
## License
This project is open-sourced under the MIT license. For more details, see the [LICENSE](./LICENSE) file in the project repository.
---
We believe in the power of JavaScript in machine learning to create accessible and efficient applications. By leveraging modern web technologies, we bring AI capabilities directly to your browser, making it easy for anyone to benefit from the advancements in machine learning.
Enjoy using the "Handwritten Digit Recognition", and feel free to contribute or provide feedback!
| Web-based application for recognizing handwritten digits in real-time, powered by a JavaScript neural network | deep-learning,digit-recognition,javascript,js,machie-learning,neural-network,node,nodejs,javascript-ai | 2024-04-08T19:55:29Z | 2024-04-16T19:44:51Z | null | 1 | 0 | 6 | 0 | 2 | 19 | null | MIT | JavaScript |
azuresphere7/Mantis-React-Admin | main | # Mantis Free React Material UI Dashboard Template [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Download%20Mantis%20React%20-%20The%20professional%20Material%20designed%20React%20Admin%20Dashboard%20Template%20&url=https://mantisdashboard.io&via=codedthemes&hashtags=reactjs,webdev,developers,javascript)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Price](https://img.shields.io/badge/price-FREE-0098f7.svg)](https://github.com/azuresphere7/Mantis-Admin-Template/blob/main/LICENSE)
[![GitHub package version](https://img.shields.io/github/package-json/v/azuresphere7/Mantis-Admin-Template)](https://github.com/azuresphere7/Mantis-Admin-Template/)
Mantis is a free and open source React redux dashboard template made using the Material UI React component library with aim of flexibility and better customizability.
### Name Derived From Nature
Mantis Logo is inspired from the insect name - 'Mantises' as they have triangular heads with flexible Necks. Also, the name is derived from two popular UI frameworks, Material UI and Ant Design (M-Ant-is).
Mantis has Ant Design principal on top of the MAterial UI React component library.
:star: :star: :star: Support us by giving star (Top right of this page) if you like the theme :star: :star: :star:
![mantis-free-react-dashboard-template.jpg](https://mantisdashboard.io/adv-banner-images/og-social-v1.1.0.png)
The [Pro version](https://mantisdashboard.io) of Mantis react template includes features such as TypeScript, apps, authentication methods (i.e. JWT, Auth0, Firebase), advance components, form plugins, layouts, widgets, and more.
| [Mantis Free](https://mantisdashboard.io/free) | [Mantis Pro](https://mantisdashboard.io) |
| ---------------------------------------------- | :------------------------------------------------------------------------------- |
| **7** Demo pages | **85+** Demo pages |
| - | ✓ Multi-language |
| - | ✓ Dark/Light Mode 🌓 |
| - | ✓ TypeScript version |
| - | ✓ Design files (Figma) |
| - | ✓ Multiple color options |
| - | ✓ RTL |
| - | ✓ JWT, Firebase, Auth0, AWS authentication |
| - | ✓ [More components](https://mantisdashboard.io/components-overview/autocomplete) |
| ✓ MIT License | ✓ [Pro License](https://mui.com/store/license/) |
## Why Mantis?
Mantis offers everything needed to build an advanced dashboard application. In the initial release, we included following high-end features,
- Support React18.
- Professional user interface.
- Material UI React components.
- Fully responsive, all modern browser supported.
- Easy to use code structure
- Flexible & high-Performance code
- Simple documentation
## Free Mantis React version
#### Preview
- [Demo](https://mantisdashboard.io/free)
#### Download
- [Download from GitHub](https://github.com/azuresphere7/Mantis-Admin-Template)
## Mantis Pro version
#### Preview
- [Demo](https://mantisdashboard.io)
#### Purchase
- [Buy now](https://mui.com/store/items/mantis-react-admin-dashboard-template/)
## Table of contents
- [Getting started](#getting-started)
- [Documentation](#documentation)
- [Technology stack](#technology-stack)
- [Author](#author)
- [Issues?](#issues)
- [License](#license)
- [More Free React Templates](#more-free-react-material-admin-dashboard-templates)
- [More Pro React Templates](#more-premium-react-material-admin-dashboard-templates)
- [Follow us](#follow-us)
## Getting Started
1. Clone from Github
```
git clone https://github.com/azuresphere7/Mantis-Admin-Template.git
```
2. Install packages
```
yarn
```
3. Run project
```
yarn start
```
## Documentation
[Mantis documentation](https://codedthemes.gitbook.io/mantis/) helps you out in all aspects from Installation to deployment.
## Technology stack
- [Material UI V5](https://mui.com/core/)
- Built with React Hooks API.
- Redux & React context API for state management.
- Redux toolkit.
- React Router for navigation routing.
- Support for react-script.
- Code splitting.
- CSS-in-JS.
## Author
Mantis is managed by team [CodedThemes](https://codedthemes.com).
## Issues
Please generate a [GitHub issue](https://github.com/azuresphere7/Mantis-Admin-Template/issues) if you found a bug in any version. We are try our best to resolve the issue.
## License
- Licensed under [MIT](https://github.com/codedthemes/datta-able-bootstrap-dashboard/blob/master/LICENSE)
## More Free React Material Admin Dashboard Templates
- [Free Materially](https://codedthemes.com/item/materially-free-reactjs-admin-template/)
- [Free Berry](https://mui.com/store/items/berry-react-material-admin-free/)
## More premium React Material Admin Dashboard Templates
- [Materially](https://codedthemes.com/item/materially-reactjs-admin-dashboard/)
- [Berry](https://mui.com/store/items/berry-react-material-admin/)
## Follow us
- Website [https://mantisdashboard.io](https://mantisdashboard.io)
- Blog [https://blog.mantisdashboard.io](https://blog.mantisdashboard.io)
- CodedThemes [https://codedthemes.com](https://codedthemes.com)
- Dribbble [https://dribbble.com/codedthemes](https://dribbble.com/codedthemes)
- Facebook [https://www.facebook.com/codedthemes](https://www.facebook.com/codedthemes)
- Twitter [https://twitter.com/codedthemes](https://twitter.com/codedthemes)
| 🖥 Mantis is a free and open source React redux dashboard template made using the Material UI React component library with aim of flexibility and better customizability. | admin-dashboard,javascript,material-ui,react,redux,yarn | 2024-03-23T11:47:39Z | 2024-03-23T11:55:11Z | null | 3 | 0 | 28 | 0 | 0 | 19 | null | MIT | JavaScript |
Zemerik/Portfolio-v2 | main | ## PORTFOLIO V2 - [Website](https://zemerik.vercel.app)
## ABOUT:
This the second and latest version of my Portfolio created using HTML, CSS, Javascript, Typescript, React and Tailwind.
## USAGE:
- Feel Free to use my portfolio as a template for yours, however the **distribution of images and information is not allowed in any form.**
- Proper Credit must be given in either your website or your website's README.md
### CLONING:
- Use GIT to store the files of this Repository on your machine:
```
git clone https://github.com/Zemerik/Portfolio-v2
```
### CUSTOMIZING:
- The Favicon and title of the website can be changed in the [index.html](https://github.com/Zemerik/Portfolio-v2/blob/main/index.html) file, while the rest of the information can be changed in the [main.js](https://github.com/Zemerik/Portfolio-v2/blob/main/src/main.js) file.
#### Thanks for visiting. Don't forget to leave a ⭐
| This the second and latest version of my Portfolio | javascript,portfolio,react,tailwindcss,template,typescript | 2024-04-22T10:05:10Z | 2024-04-28T01:42:42Z | null | 1 | 0 | 10 | 0 | 1 | 18 | null | BSD-2-Clause | TypeScript |
EchoTechFE/dangoui | main | <div align="center"><a name="readme-top"></a>
<img height="166" src="https://cdn.qiandaoapp.com/interior/images/928db35e88a094cd3bd77f03d5c01867.svg">
<h1>Dango UI</h1>
<a href="https://www.npmjs.org/package/dangoui">
<img src="https://img.shields.io/npm/v/dangoui.svg" />
</a>
<a href="https://github.com/EchoTechFE/dangoui">
<img src="https://img.shields.io/github/license/EchoTechFE/dangoui" />
</a>
<br>
一套适用于 uni-app 小程序和 Web 的 Vue 3 移动端组件库
</div>
## 🚧🚧 This repo is under heavy development 🚧🚧
## 特性
- 多平台兼容,uni-app、Web 都可以使用
- 默认就很好看,业务上久经考验
- 🚧 易于扩展主题,满足定制需求(开发中)
## 安装
```bash
npm install dangoui
yarn add dangoui
pnpm add dangoui
```
## 开发
```bash
# 编译组件库
pnpm run build
# 文档站 dev 模式
cd docs
# 在 run dev 前,要编译组件库,要查看最新组件库更改,也要编译组件库
pnpm run dev
```
## 链接
- [Dango UI 文档](https://dumpling.echo.tech/)
## 发布
### 发布 packages
1. 做出更改后,`git add`,然后执行 `npx changeset`,并把变更提交到仓库
2. 发布
1. 手动发布(不推荐),`npx changest version`、`pnpm run build`、`npx changeset publish`
2. 自动发布(GitHub Action),提交/合并到 main 的代码,如果含有 changeset 文件,会更新版本并提交一个 PR,合并 PR 后,会进行版本发布
### 发布文档站
在 GitHub Actions 中,选择 Doc,并点 Run workflow
## 同步到 npmmirror
因为我们的项目用的 npmmirror 镜像,当我们想立刻使用最新版本的时候,可以执行 `pnpm run sync`
## 活动
![Alt](https://repobeats.axiom.co/api/embed/aaf46fe1722cdeeffdf18619e14c1fa43ac66863.svg "Repobeats analytics image")
| A Vue 3 Mobile Component Library for Web and UniApp | component,vue,vue3,javascript,uikit,uniapp | 2024-03-26T08:22:27Z | 2024-05-22T09:23:12Z | 2024-05-22T09:30:00Z | 13 | 36 | 663 | 0 | 2 | 18 | null | MIT | Vue |
chrisburnell/relative-time | main | # `<relative-time>`
A Web Component to display an event countdown.
**[Demo](https://chrisburnell.github.io/relative-time/demo.html)** | **[Further reading](https://chrisburnell.com/relative-time/)**
## Usage
### General usage example
```html
<script type="module" src="relative-time.js"></script>
<relative-time><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
### Explicit locale
```html
<script type="module" src="relative-time.js"></script>
<relative-time lang="fr"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
### Inherited locale
```html
<script type="module" src="relative-time.js"></script>
<p lang="fr">
<relative-time><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
</p>
```
### Update frequency
```html
<script type="module" src="relative-time.js"></script>
<!-- Updates every 1 second -->
<relative-time update="1"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
<!-- Disable updates -->
<relative-time update="false"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
### Specific division
```html
<script type="module" src="relative-time.js"></script>
<!-- Always format using seconds -->
<relative-time division="second"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
### Maximum division
```html
<script type="module" src="relative-time.js"></script>
<!-- Format using seconds up to minutes -->
<relative-time max-divions="minute"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
### Numeric format
```html
<script type="module" src="relative-time.js"></script>
<!-- Automatically choose when to use numbers vs. words in formatting -->
<relative-time format-numeric="auto"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
<!-- Always use numbers in time formatting -->
<relative-time format-numeric="always"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
### Style format
```html
<script type="module" src="relative-time.js"></script>
<!-- Long formatting (e.g. 1 second) -->
<relative-time format-style="long"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
<!-- Short formatting (e.g. 1 sec.) -->
<relative-time format-style="short"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
<!-- Narrow formatting (e.g. 1s) -->
<relative-time format-style="narrow"><time datetime="2024-04-09T00:00:00+14:00">9 April 2024</time></relative-time>
```
## Installation
You have a few options (choose one of these):
1. Install via [npm](https://www.npmjs.com/package/@chrisburnell/relative-time): `npm install @chrisburnell/relative-time`
1. [Download the source manually from GitHub](https://github.com/chrisburnell/relative-time/releases) into your project.
1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)
## Usage
Make sure you include the `<script>` in your project (choose one of these):
```html
<!-- Host yourself -->
<script type="module" src="relative-time.js"></script>
```
```html
<!-- 3rd party CDN, not recommended for production use -->
<script
type="module"
src="https://www.unpkg.com/@chrisburnell/relative-time/relative-time.js"
></script>
```
```html
<!-- 3rd party CDN, not recommended for production use -->
<script
type="module"
src="https://esm.sh/@chrisburnell/relative-time"
></script>
```
## Credit
With thanks to the following people:
- [David Darnes](https://darn.es) for creating this [Web Component repo template](https://github.com/daviddarnes/component-template)
| A Web Component to display a relative time. There are many like it, but this one is mine. | custom-element,custom-elements,customelement,customelements,javascript,web-component,web-components,webcomponent,webcomponents | 2024-04-12T11:40:40Z | 2024-05-20T13:10:27Z | 2024-05-09T11:02:41Z | 1 | 0 | 11 | 1 | 0 | 18 | null | MIT | HTML |
swagging-post/Blooket-Cheat-GUI | main | ## NEW / FIXED CHEATS | Supported Website: (anything).blooket.com/(anything)
### GLOBAL: BYPASS NICKNAME FILTER, PIN GUESSER, USE ANY BLOOK, USE ANY BANNER
### CRYPTO: ANTI-HACK, SCREEN FLOODING
![blooketcheatgui](https://github.com/swagging-post/Blooket-Cheat-GUI/assets/160811072/7f842fb9-9c94-480b-b594-55850b091fe3)
# READ FOR IMPORTANT INFO! | V1.1
A reupload, but currently being fixed of **Minesraft2** & **05Konz's** Blooket Cheats due to the cease and desist and webpack attempting to be disabled from the official Blooket website.
<p align="center">Cheats now being managed by SC0TT until further notice.</p>
<h3 align="center"><a href="https://discord.gg/">Support Server | #tickets </a></h2>
<h3 align="center"><a href="#list-of-cheats-1">List Of Cheats</a></h3>
## Information
<details>
<summary><h3>How to use</h3></summary>
There are 2 good methods to using these scripts:
1. Copying the main GUI and running it in the inspect element console
2. Copying the .min.js GUI and using it as a bookmarklet
<details>
<summary>What can I do if JavaScript is blocked?</summary>
We don't actually know what to do about this or how to fix it, sorry.
</details>
</details>
<details><summary><h3>(script) is not working?</h3></summary>
Make sure you're running it properly (see [How to use](https://github.com/swagging-post/Blooket-Cheeto#how-to-use)), if it still doesn't work and other cheats do, then [make an issue](https://github.com/swagging-post/Blooket-Cheeto/issues)
</details>
<details><summary><h3>Which script should I use to make a bookmarklet?</h3></summary>
You should use the scripts ending in ".min.js", as using the others will have errors due to formatting.
</details>
<details><summary><h3>Can you give me infinite tokens / bypass daily limit / permanently give me blooks / change pack luck?</h3></summary>
No, these are things we would've already done if they were possible, they're managed on the backend of Blooket so we can't modify them
</details>
<details><summary><h3>Can you make hacks for (game)</h3></summary>
No
</details>
<details><summary><h3>Can you make more Battle Royale cheats</h3></summary>
Battle Royale is a gamemode that works almost entirely on the host's end. The only thing we have control over is answering questions.
</details>
<details><summary><h3>What happened to Minesraft2 and 05Konz?</h3></summary>
Minesraft2 was sent a cease and desist from Blooket and 05Konz was perm banned, so I took over since they wouldn't be able to and try to fix the cheats.
</details>
<details>
<summary><h3>How do I do this on mobile?</h3></summary>
These scripts aren't made for mobile, so we don't really know how to get them to work on it.
<details>
<summary><h3>What's the Mobile GUI?</h3></summary>
The mobile GUI is the first GUI Minesraft2 ever made. Some people said it worked on mobile and it's a lot neater for mobile use apparently so we just called it that.
</details>
</details>
<details><summary><h2>List of Cheats</h2></summary>
<h3>GUIs<h3>
* [GUI](cheats/gui/gui.js)
* [GUI Bookmarklet](cheats/gui/gui.min.js)
* [Mobile GUI outdated](cheats/gui/mobileGui.js)
* [Mobile GUI Bookmarklet outdated](cheats/gui/mobileGui.min.js)
### Monster Brawl
* Double Enemy XP
* Half Enemy Speed
* Instant Kill
* Invincibility
* Kill Enemies
* Magnet
* Max Current Abilities
* Next Level
* Remove Obstacles
* Reset Health
### Cafe
* Max Items
* Remove Customers
* Reset Abilities
* Set Cash
* Stock Food
### Crypto Hack
* Always Triple
* Auto Guess
* Choice ESP
* Password ESP
* Remove Hack
* Set Crypto
* Set Password
* Steal Players Crypto
* Anti-Hack
* Screen Flooding
### Deceptive Dinos
* Auto Choose
* Rock ESP
* Set Fossils
* Set Multiplier
* Stop Cheating
### Tower of Doom
* Fill Deck
* Max Cards
* Max Health
* Max Stats
* Min Enemy
* Set Coins
### Factory
* Choose Blook
* Free Upgrades
* Max Blooks
* Remove Glitches
* Send Glitch
* Set All Mega Bot
* Set Cash
### Fishing Frenzy
* Frenzy
* Remove Distraction
* Send Distraction
* Set Lure
* Set Weight
### Flappy Blook
* Set Score
* Toggle Ghost
### Global
* Auto Answer
* Change Blook Ingame
* Every Answer Correct
* Flood Game
* Get Daily Rewards
* Highlight Answers
* Host Any Gamemode
* Remove Name Limit
* Remove Random Name
* Bypass Name Filter
* Sell Cheap Duplicates
* Sell Duplicate Blooks
* Simulate Pack
* Simulate Unlock
* Spam Buy Blooks
* Subtle Highlight Answers
* Use Any Blook
* Use Any Banner
* Pin Guesser
#### Intervals
* Auto Answer
* Highlight Answers
* Percent Auto Answer
* Subtle Highlight Answers
### Gold Quest
* Always Triple
* Auto Choose
* Chest ESP
* Reset All Gold
* Reset Players Gold
* Set Gold
* Swap Gold
### Crazy Kingdom
* Choice ESP
* Choice ESP Loop
* Disable Toucan
* Max Stats
* Set Guests
* Skip Guest
### Racing
* Instant Win
### Battle Royale
* Auto Answer
#### Intervals
* Auto Answer
### Blook Rush
* Set Blooks
* Set Defense
### Tower Defense
* Earthquake
* Max Towers
* Remove Ducks
* Remove Enemies
* Remove Obsticles
* Set Damage
* Set Round
* Set Tokens
### Tower Defense 2
* Max Towers
* Remove Enemies
* Set Coins
* Set Health
* Set Round
### Pirate's Voyage
* Max Levels
* Set Doubloons
* Start Heist
* Swap Doubloons
* Take Doubloons
### Santa's Workshop
* Remove Distractions
* Send Distraction
* Set Toys
* Set Toys Per Question
* Swap Toys
</details>
| Reuploaded, upgraded version of unpatched Blooket Cheats. (Credits in README.md) | blooket,cheats,hacks,javascript,js,blooket-gui,blooket-game,blooket-unblocked,blooketjs,gui | 2024-04-18T23:10:53Z | 2024-05-15T02:53:47Z | null | 1 | 0 | 41 | 6 | 3 | 17 | null | NOASSERTION | HTML |
Gersigno/gersigno.github.io | main | <div align="center">
<img src="https://raw.githubusercontent.com/Gersigno/gersigno.github.io/main/resources/gwp_logo_alpha.PNG" alt="A huge banner logo on my enterprise.">
</div>
<h1 align="center">My <i>Online</i> portfolio</h1>
<h3 align="center">A beautiful, fluent, web OS like online portfolio !</h3>
<p align="center"> <small> <i>Make sure to star ⭐ this repo if you enjoy my work !</i> </small> </p>
![Preview](https://raw.githubusercontent.com/Gersigno/gersigno.github.io/main/previews/portfolio_preview.png)
<div align="center">
<a href="https://gersigno.github.io/">Test it right now</a>
</div>
# 📍 Introduction
<b>Welcome to my portfolio's repository!</b>
Discover a unique and intuitive experience through my portfolio thanks to a familiar desktop interface !
> [!NOTE]
> This project is still in **Beta**, some features may not work as intended and the code is still a bit messy in some places. <br>
> *Feel free to report any bugs [here](https://github.com/Gersigno/gersigno.github.io/issues/new)* 👍
# 📑 Table of content
<dl><dd>
- [📦Features](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#features)
<dl><dd><dl><dd>
- [🎨Design](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#design)
- [✍Customization](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#customization)
- [⏳Comming soon](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#comming-soon)
</dd></dl></dd></dl>
- [💻For developpers](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#for-developpers)
<dl><dd><dl><dd>
- [🏁Getting started](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#getting-started)
- [📲Create your own application](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#create-your-own-application)
- [📩Popup](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#-how-to-use-pop-ups)
- [💭Toast notifications.](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#-how-to-use-pop-ups)
</dd></dl></dd></dl>
- [🧰Technologies](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#technologies)
- [🧠Credits](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#credits)
- [🧐Support](https://github.com/Gersigno/gersigno.github.io/edit/main/README.md#support)
</dd></dl>
# 📦 Features
<dl><dd>
## 🎨 Design
### Glass translucency
This effect was archived by mixing blur effect and a noise texture in the background to create some depth.
![GlassEffect](https://raw.githubusercontent.com/Gersigno/gersigno.github.io/main/previews/portfolio_blur.png)
It's heavly inspired of [Microsoft](https://github.com/microsoft)'s [Acrylic effect](https://learn.microsoft.com/en-us/windows/apps/design/style/acrylic)
## ✍ Customization
You can **customize** your experience from the **settings application**.
![Settings](https://raw.githubusercontent.com/Gersigno/gersigno.github.io/main/previews/portfolio_settings.gif) <br>
💾 *All settings are **saved** in your local storage.*
## ⏳ Comming soon
These features are work-in-progress and will come in future updates:
- **Game development** page content
- Responsive
- Translations *(localization)*
- More web development projects.
</dd></dl>
# 💻 For developpers
<dl><dd>
The code is partially commented and documented.
### 🏁 Getting started
> [!IMPORTANT]
> Do not forget that this project is still in development, functions could be modified in future updates.
### 📲 Create your own application
<dl><dd>
🚨 ***Your whole application needs to be usable in a html type file.*** <br>
First, create a folder of your project's name in the `_subpages` folder.
Then, in the `desktop.js` file located at `scripts\desktop\desktop.js`, create a new **`DesktopIcon`** object instance.<br>
<ins>Syntax:</ins>
```js
new DesktopIcon((String)title, (String)icon, (function)funcPtr, (String)shandler);
```
```css
title: The text shown at the bottom of the shortcut;
icon: The relative path of your icon's image file;
funcPtr: The function to call on any left click event (can have parameters);
shandler: Unique text to distinguish between different icons.;
```
You will need to call the **`createWindow(...)`** function on your icon's click event to create your window.
<ins>Exemple:</ins>
```js
new DesktopIcon("Title", "icons/myIcon.png", ()=>createWindow("icons/myIcon.png", "Title","_subpages\\my_app\\index.html","myApp"), "myApp_shortcut");
```
</dd></dl>
### 📩 How to use pop-ups.
<dl><dd>
To create a pop-up, you can simply use the `UI_CreatePupup()` function. <br>
<ins>Syntax:</ins>
```js
UI_CreatePupup((String)icon, (String)title, (String)message, (String)okText, (function)okFunction, (String)cancelText, (function)cancelFunction);
```
```css
icon: The relative path of your icon's image file;
title: The title of the pop-up;
message: the message shown at the center of the pop-up;
okText: The text of the primary (left) button;
okFunction: The function to call when the primary button is clicked by the user;
cancelText: [not required] The text of the secondary (right) button;
cancelFunction: [not required] The function to call when the secondary button is clicked by the user;
```
Exemple:
```js
UI_CreatePupup("icons/myIcon.png", "Pop-up Title", "Pop-up description", "Ok",()=>ok_function(), "Cancel", ()=>cancel_function());
```
</dd></dl>
### 💭 How to use Toast notifications.
<dl><dd>
To create toast notifications, you can simply use the `UI_CreatePupup()` function. <br>
<ins>Syntax:</ins>
```js
new ToastNotify(icon, title, description);
```
```css
icon: The relative path of your icon's image file;
title: The title of the toast notification;
description: [not required] The description (secondary text) of the notification.
```
Exemple:
```js
new ToastNotify("icons/myIcon.png", "Toast notification", "A simple notification");
```
</dd></dl>
</dd></dl>
# 🧰 Technologies
![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=flat&logo=html5&logoColor=white)
![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=flat&logo=css3&logoColor=white)
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=flat&logo=javascript&logoColor=white)
![Visual Studio Code Logo](https://img.shields.io/badge/Visual%20Code-1.85-007ACC?logo=visualstudiocode)
# 🧠 Credits
<dl><dd>
- Author [@Gersigno](https://www.github.com/gersigno)
Online resources
- *Switch elements style* by [Marcus Burnette](https://codepen.io/mburnette)
- *Simple date format* by [Emil S. Jørgensen](https://stackoverflow.com/users/5242739/emil-s-j%c3%b8rgensen)
Thanks to
- [David R.](https://github.com/69sazuke) for his help on the project.
- [Zen design](https://www.designbyzen.fr/) for his advice on ui/ux design.
- All icons used in this project come from [icons8](https://icones8.fr/)
</dd></dl>
# 🧐 Support
For support, email contact.gersigno@gmail.com or join the ***[discord server](https://discord.gg/kr3mwwg8jR)***.
| A beautiful, fluent, web OS like online portfolio ! | css,desktop,fluent,html,javascript,os,portfolio,web,windows-11 | 2024-03-26T20:47:50Z | 2024-05-14T08:36:03Z | null | 1 | 3 | 9 | 0 | 0 | 17 | null | null | JavaScript |
lineage2js/server | main | in progress... | Node.js server emulator for lineage 2 chronicle 1 harbingers of war | javascript,lineage2,mmorpg,nodejs,server-emulator | 2024-04-09T21:12:20Z | 2024-04-15T10:16:02Z | null | 1 | 0 | 5 | 0 | 1 | 17 | null | MIT | JavaScript |
iByteABit256/tic-tac-toes | main | # Tic Tac Toes
<img src="media/tic-tac-toes-screenshot.png" width="350" height="500">
<br>
Inspired by [VSauce](https://www.youtube.com/shorts/_Na3a1ZrX7c)
## Description
Tic Tac Toes is the classic Tic Tac Toe game with a twist. Instead of a single 3x3 board, there are 9 boards arranged in a 3x3 grid. Players take turns marking spaces in these boards, aiming to win individual boards and ultimately achieve the highest total score.
The game follows the following rules:
- Each player plays on one board during their turn.
- The next player must play on the board that matches the position of the square the previous player filled.
- If the next board is finished, the player can choose any available board to play on.
- Once all boards are finished, the player with the most wins is the total winner, or it's a draw if both players have the same number of wins.
- The first move can be played on any board.
## PWA Installation
The game is available as a [PWA](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app).
You can install it as an app on your device from the browser like [this](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Installing).
## Local Installation
To run the project locally, follow these steps:
1. **Clone the repository:**
```bash
git clone https://github.com/iByteABit256/tic-tac-toes.git
```
2. **Navigate to the project directory:**
```bash
cd tic-tac-toes
```
3. **Install dependencies:**
```bash
npm install
```
4. **Launch the application:**
```bash
npm start
```
5. **Open your web browser and visit http://localhost:3000 to play the game.**
## Contributing
Contributions are welcome! If you'd like to contribute to the project, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bug fix: `git checkout -b feature-name`.
3. Make your changes and commit them: `git commit -am 'Add new feature'`.
4. Push to your forked repository: `git push origin feature-name`.
5. Submit a pull request detailing your changes.
Please ensure that your contributions adhere to the GNU AGPL v3 license and follow the code of conduct.
## License
This project is licensed under the GNU Affero General Public License v3.0. See the [LICENSE](LICENSE) file for details.
## Credits
### Free Icons
- <a href="https://www.flaticon.com/free-icons/home-button" title="home button icons">Home button icons created by Freepik - Flaticon</a>
- <a href="https://www.flaticon.com/free-icons/mute" title="mute icons">Mute icons created by pictranoosa - Flaticon</a>
- <a href="https://www.flaticon.com/free-icons/speaker" title="speaker icons">Speaker icons created by Pixel perfect - Flaticon</a>
| Super Tic Tac Toe | javascript,react,tic-tac-toe,vsauce,minimax,game,p2p | 2024-03-17T14:01:56Z | 2024-04-03T15:45:51Z | 2024-04-02T21:57:23Z | 4 | 14 | 90 | 4 | 5 | 17 | null | AGPL-3.0 | JavaScript |
blckclov3r/use-postal-ph | main | # use-postal-ph
This utility library is specifically designed for the Philippines, providing comprehensive information on postal codes,
municipalities, locations, and regions. Moreover, searching within the library is case insensitive.
![use-postal-ph](https://raw.githubusercontent.com/blckclov3r/use-postal-ph/main/img/use-postal-ph.png)
[![npm version](https://img.shields.io/npm/v/use-postal-ph?style=flat-square&alt=use-postal-ph)](https://www.npmjs.com/package/use-postal-ph)
[![Bundlephobia](https://img.shields.io/bundlephobia/min/use-postal-ph)](https://bundlephobia.com/result?p=use-postal-ph)
[![Downloads](https://img.shields.io/npm/dt/use-postal-ph.svg?style=flat-square)](https://www.npmjs.com/package/use-postal-ph)
[![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/blckclov3r)
[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/use-postal-ph)
[![Playwright Tests](https://github.com/blckclov3r/use-postal-ph/actions/workflows/playwright.yml/badge.svg)](https://github.com/blckclov3r/use-postal-ph/actions/workflows/playwright.yml)
## Contents
* [Installation](#installation)
* [Usage](#usage)
* [Demo](#demo)
* [Importing Types](#importing-types)
* [Type Definitions](#type-definitions)
* [Query Options](#query-options)
* [ECMAScript Module (ESM) Entry Point](#ecmascript-module-esm-entry-point)
* [Contribution Guidelines](#contribution-guidelines)
* [References](#references)
* [License](#license)
## Installation
Install via NPM:
```bash
npm install use-postal-ph
```
Or via Yarn:
```bash
yarn add use-postal-ph
```
## Usage
To start using the `use-postal-ph` library, follow these steps:
```typescript
import usePostalPH from 'use-postal-ph';
```
You can now utilize the library's methods to retrieve postal code, municipality, location, and region information.
```typescript
const postalPH = usePostalPH();
// Fetch a list of municipalities
const municipalities = postalPH.fetchMunicipalities();
console.log(municipalities);
// Fetch postal codes
const postalCodes = postalPH.fetchPostCodes();
console.log(postalCodes);
// Fetch locations
const locations = postalPH.fetchLocations();
console.log(locations);
// Fetch regions
const regions = postalPH.fetchRegions();
console.log(regions);
// Fetch all data lists
const dataLimit = postalPH.fetchDataLists();
console.log(dataLimit);
```
You can also specify search criteria and limit the number of results returned:
```typescript
// Fetch a list of municipalities starting with 'Manila' and limit the result to 10
const municipalities = postalPH.fetchMunicipalities({search: 'Manila', limit: 10});
console.log(municipalities);
// Fetch postal code for 6045
const postalCodes = postalPH.fetchPostCodes({search: 6045});
console.log(postalCodes);
// Fetch postal codes with a limit of 5
const postalCodesLimit = postalPH.fetchPostCodes({limit: 5});
console.log(postalCodesLimit);
// Fetch locations containing 'Cebu' and limit the result to 3
const locations = postalPH.fetchLocations({search: 'Cebu', limit: 3});
console.log(locations);
// Fetch regions starting with 'NCR' and limit the result to 8
const regions = postalPH.fetchRegions({search: 'NCR', limit: 8});
console.log(regions);
// Fetch all data lists with a limit of 15
const dataLimit = postalPH.fetchDataLists({limit: 15});
console.log(dataLimit);
// Fetch data based on the search criteria
const dataList = postalPH.fetchDataLists({
post_code: 6045,
location: "Talisay",
region: "VII",
municipality: "Cebu"
});
console.log(dataList);
```
## Demo
Explore the live demo to experience fetching and searching functionalities for municipalities, post codes, locations,
and regions. Interact with the application to witness its efficiency and responsiveness in action.
https://use-postal-ph.vercel.app
## Importing Types
You can also import specific types provided by use-postal-ph:
```typescript
import type {PlaceProps, SearchCriteriaProps, PlaceListCriteriaProps} from "use-postal-ph";
```
## Type Definitions
Here are the type definitions provided by `use-postal-ph`:
```typescript
export type PlaceDataProps = {
data: PlaceProps[];
};
export type PlaceProps = {
municipality?: string;
location?: string;
post_code?: number | string;
region?: string;
};
export type SearchCriteriaProps = {
search?: number | string;
limit?: number;
};
export type PlaceListCriteriaProps = PlaceProps & {
limit?: number;
};
```
## Query Options
When using the library's methods, you have the option to include an object containing parameters for more specific
queries:
- **search**: This parameter is used to find specific information. For postal codes, search directly for the code
itself. You can also search for municipalities, locations, and regions based on your query.
- **limit**: This parameter restricts the number of results returned for municipalities, locations, and regions.
However, it does not affect the results when searching for postal codes.
- **municipality**: Search by the name of the municipality.
- **post_code**: Search by the postal code.
- **location**: Search by the specific district or neighborhood.
- **region**: Search by the region where the place is located.
## ECMAScript Module (ESM) Entry Point
If you prefer not to install the package and want to include the ECMAScript module (ESM) entry point directly in your
project, you can use the following script tag:
- CDN (
jsDelivr): [`https://cdn.jsdelivr.net/npm/use-postal-ph@1.1.7/dist/index.mjs`](https://cdn.jsdelivr.net/npm/use-postal-ph@1.1.7/dist/index.mjs)
- NPM: [`https://unpkg.com/use-postal-ph@1.1.7/dist/index.mjs`](https://unpkg.com/use-postal-ph@1.1.7/dist/index.mjs)
Import Statement:
```html
<script type="module">
import usePostalPH from 'https://unpkg.com/use-postal-ph@1.1.7/dist/index.mjs';
const {
fetchDataLists,
fetchLocations,
fetchMunicipalities,
fetchPostCodes,
fetchRegions
} = usePostalPH();
console.log(fetchPostCodes({search: "6045"}))
</script>
```
This script imports the `fetchPostCodes` function from the `use-postal-ph` package and retrieves information for the
postal code '6045'. It then logs the result to the console.
```json
{
"location": "Cebu",
"region": "VII",
"municipality": "Talisay",
"post_code": 6045
}
```
## Contribution Guidelines
Contributions are highly appreciated! To contribute, fork the repository, create a new branch for your changes, and
submit a pull request. Please ensure your code adheres to the existing coding standards and conventions. While this
library provides information, it may not be comprehensive. Contributions aimed at enhancing the comprehensiveness of the
data are welcome.
## References
The `use-postal-ph` library utilizes data sourced from Wikipedia, including information on regions, provinces, and
municipalities of the Philippines.
- [Wikipedia - Regions of the Philippines](http://en.wikipedia.org/wiki/Regions_of_the_Philippines)
- [Wikipedia - Provinces of the Philippines](http://en.wikipedia.org/wiki/Provinces_of_the_Philippines)
- [Wikipedia - List of Cities and Municipalities in the Philippines](http://en.wikipedia.org/wiki/List_of_cities_and_municipalities_in_the_Philippines)
## License
MIT © [blckclov3r](https://github.com/blckclov3r/use-postal-ph?tab=MIT-1-ov-file)
| This utility library is specifically designed for the Philippines, providing comprehensive information on postal codes, municipalities, locations, and regions. Moreover, searching within the library is case insensitive. | library,municipality,npm,npm-package,philippines,postal,postal-code,postcode,psgc,typescript | 2024-03-23T18:18:36Z | 2024-04-13T01:21:34Z | 2024-03-30T11:50:44Z | 1 | 0 | 32 | 0 | 5 | 16 | null | MIT | TypeScript |
ComPDFKit/compdfkit-api-samples | main | ## ComPDFKit PDF API
[ComPDFKit PDF API](https://api.compdf.com/) is organized around the REST standard and provides you with a simple document-upload, document-process, document-download workflow. Supporting various programming languages (such as [Java](https://api.compdf.com/api-libraries/in-java), [Python](https://api.compdf.com/api-libraries/in-python), [C#](https://api.compdf.com/api-libraries/in-net), [PHP](https://api.compdf.com/api-libraries/in-php), [Swift](https://api.compdf.com/api-libraries/in-swift), JavaScript, etc.), ComPDFKit API offers rich PDF functionalities, including conversion, document editor, data extraction, and so forth.
Before integrating the below PDF capabilities, you can register a free [ComPDFKit API](https://api.compdf.com/signup) account to process 1,000 files per month without costs and limitations.
| [PDF to Word](https://api.compdf.com/api-reference/pdf-to-word) | [PDF to Excel](https://api.compdf.com/api-reference/pdf-to-excel) | **[PDF to PPT](https://api.compdf.com/api-reference/pdf-to-ppt)** | [PDF to HTML](https://api.compdf.com/api-reference/pdf-to-html) |
| :----------------------------------------------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- | :----------------------------------------------------------- |
| [PDF to RTF](https://api.compdf.com/api-reference/pdf-to-rtf) | [PDF To Image](https://api.compdf.com/api-reference/pdf-to-image) | [PDF to CSV](https://api.compdf.com/api-reference/pdf-to-csv) | [PDF to TXT](https://api.compdf.com/api-reference/pdf-to-txt) |
| [Data Extraction](https://api.compdf.com/api-reference/pdf-to-json) | [PDF to Editable PDF](https://api.compdf.com/api-reference/pdf-to-editable-pdf-tool-guide) | [Image to Word](https://api.compdf.com/api-reference/image-to-word) | [Image to Excel](https://api.compdf.com/api-reference/image-to-excel) |
| [Image to PPT](https://api.compdf.com/api-reference/image-to-ppt) | [Image to HTML](https://api.compdf.com/api-reference/image-to-html) | [Image to RTF](https://api.compdf.com/api-reference/image-to-rtf) | [Image to CSV](https://api.compdf.com/api-reference/image-to-csv) |
| [Image to TXT](https://api.compdf.com/api-reference/image-to-txt) | [Word to PDF](https://api.compdf.com/api-reference/word-to-pdf) | [Excel to PDF](https://api.compdf.com/api-reference/excel-to-pdf) | [PPT to PDF](https://api.compdf.com/api-reference/ppt-to-pdf) |
| [HTML to PDF](https://api.compdf.com/api-reference/html-to-pdf) | [RTF to PDF](https://api.compdf.com/api-reference/rtf-to-pdf) | [PNG to PDF](https://api.compdf.com/api-reference/image-to-pdf) | [CSV to PDF](https://api.compdf.com/api-reference/csv-to-pdf) |
| [TXT to PDF](https://api.compdf.com/api-reference/txt-to-pdf) | [Merge PDF](https://api.compdf.com/api-reference/merge) | [Split PDF](https://api.compdf.com/api-reference/split) | [Rotate PDF](https://api.compdf.com/api-reference/rotate) |
| [Delete PDF](https://api.compdf.com/api-reference/delete) | [Insert PDF](https://api.compdf.com/api-reference/insert) | [Extract PDF](https://api.compdf.com/api-reference/extract) | [Compare PDF](https://api.compdf.com/api-reference/compare-documents) |
| [OCR](https://api.compdf.com/api-reference/ocr) | [Layout Analysis](https://api.compdf.com/api-reference/layout-analysis) | [Image Sharpening Enhancement](https://api.compdf.com/api-reference/image-processing) | [Form Recognizer](https://api.compdf.com/api-reference/form-recognizer) |
| [Trim Correction](https://api.compdf.com/api-reference/trim-correction) | [Stamp Inspection](https://api.compdf.com/api-reference/stamp-inspection) | [Add Watermark](https://api.compdf.com/api-reference/watermark-guides) | [Compression PDF](https://api.compdf.com/api-reference/compress-guides) |
## Getting Started with Code Samples
This GitHub repository provides public access to code examples that demonstrate how to programmatically submit requests to the [ComPDFKit API](https://api.compdf.com/) service.
Before you begin, you may need to do some preparatory work.
- [Register](https://api.compdf.com/signup) a free ComPDFKit API account using email only.
- Obtain the project ID and its related key from the [API Keys](https://api-dashboard.compdf.com/api/keys) section of the console.
- To start requesting the ComPDFKit API, please read the comprehensive [API reference](https://api.compdf.com/api-reference/overview) for the function you need to call.
## Instructions for Running Code Demo
### Authentication
You can get **accessToken** and related verification information by sending your **publicKey** and **SecretKey** . AccessToken will expire after **12** hours. **When calling the subsequent interface, you must carry this token in the request header**: `Authorization: Bearer {accessToken}`.
Before running each sample program, look for a comment that reads:
> `public_key_******`
>
> ` secret_key_******`
and replace `******` with your API Keys.
### Create task
A task ID is automatically generated for you based on the type of PDF tool you choose. You can provide the callback notification URL. After the task processing is completed, we will notify you of the task result through the callback interface. You can perform other operations according to the task result, such as downloading the result file.
### Upload files
Upload the original file and bind the file to the task ID. The field **parameter** is used to pass the JSON string to set the processing parameters for the file. Each file will generate automatically a unique **filekey**.
Please note that a maximum of five files can be uploaded for a task ID and no files can be uploaded for that task after it has started.
### Execute task and get task information
After the file is uploaded, the file processing starts and the download link of the corresponding result file is obtained according to the **filekey** of each file
## API Documentation
After you've successfully sent an API Call using these examples, take a look at the [Documentation](https://api.compdf.com/api-reference/overview) for each API endpoint for a full description of parameters you can adjust to customize your solution.
## Support
ComPDFKit has a professional R&D team that produces comprehensive technical documentation and guides to help developers. Also, you can get an immediate response when reporting your problems to our support team.
- For detailed information, please visit our [API Reference](https://api.compdf.com/api-reference/overview) page.
- Stay updated with the latest improvements through our [Changelog](https://www.compdf.com/api/changelog-compdfkit-api).
- For technical assistance, please reach out to our [Technical Support](https://www.compdf.com/support).
- To get more details and an accurate quote, please contact our [Sales Team](https://api.compdf.com/contact-us).
## Related
- Convert PDF to/ from other formats using [PDF online tools](https://www.compdf.com/pdf-tools)
- [Convert PDF to Image (JPG, PNG) with ComPDFKit API and Java](https://www.compdf.com/blog/convert-pdf-to-image-in-java-compdfkit-api)
- [Convert Excel to PDF Using Java - Free PDF Converter API](https://www.compdf.com/blog/convert-excel-to-pdf-using-java-api)
- Experience [ComPDFKit Web Demo](https://www.compdf.com/webviewer/demo) on any browser | ComPDFKit PDF API is organized around the REST standard and supports various programming languages with rich PDF features, including conversion, document editor, data extraction, and so forth. | api,curl,dotnet,java,javascript,pdf-converter,pdf-editor,pdf-viewer,php,python | 2024-04-29T08:27:01Z | 2024-04-30T07:42:47Z | null | 2 | 0 | 13 | 0 | 2 | 16 | null | Apache-2.0 | Java |
tiagovtristao/jsplaygrounddev | main | # JSPlayground.dev
A no-fuss JavaScript playground with instant feedback.
## Goal
It was created with the goal to provide a simple, fast and elegant playground for quickly prototyping JavaScript (and other web technologies) with instant feedback — without relying on any server dynamism.
## New features
Any feature request is open to consideration, as long as it does not require more than what a static web server can offer.
| A no-fuss JavaScript playground with instant feedback. | javascript | 2024-03-30T00:00:22Z | 2024-04-04T17:56:52Z | null | 1 | 0 | 11 | 0 | 0 | 16 | null | MIT | TypeScript |
adreaskar/javascript-handbook | master | # Ο κόσμος της JavaScript
Η JavaScript είναι μια γλώσσα προγραμματισμού που χρησιμοποιείται κυρίως για εισαγωγή διαδραστικότητας στις ιστοσελίδες μας. Είναι όμως αρκετά ιδιαίτερη στον τρόπο με τον οποίο λειτουργεί, με κανόνες που πιθανώς δεν συμβαδίζουν με άλλες γλώσσες τις οποίες να έχετε συναντήσει (π.χ. Java ή C).
Σε αυτό τον οδηγό θα δούμε τα βασικά στοιχεία της JavaScript και θα κατανοήσουμε καλύτερα τα κομμάτια τα οποία την κάνουν να ξεχωρίζει από άλλες γλώσσες.
# Περιεχόμενα
<!-- prettier-ignore -->
1. [Εισαγωγή](#εισαγωγή)
- [Φταίει η JavaScript;](#φταίει-η-javascript)
- [Spec & Manuals](#spec--manuals)
- [Specification](#specification)
- [MDN Web Docs](#mdn-web-docs)
- [Compiled ή Interpreted;](#compiled-ή-interpreted)
2. [Μεταβλητές](#μεταβλητές)
- [Δήλωση Μεταβλητών](#δήλωση-μεταβλητών)
- [Ανάθεση Τιμής](#ανάθεση-τιμής)
- [Εμβέλεια](#εμβέλεια)
- [var](#var)
- [let](#let)
- [const](#const)
3. [Τύποι Δεδομένων](#τύποι-δεδομένων)
- [typeof](#typeof)
- [Primitive Types](#primitive-types)
- [Number](#number)
- [String](#string)
- [Boolean](#boolean)
- [Undefined](#undefined)
- [Null](#null)
- [BigInt](#bigint)
- [Symbol](#symbol)
- [Objects](#objects)
- [Αλλαγή Τύπου](#αλλαγή-τύπου)
- [Type Conversion](#type-conversion)
- [Type Coercion](#type-coercion)
- [Συνένωση Τύπων](#συνένωση-τύπων)
- [Truthy & Falsy](#truthy-falsy)
- [Χαλαρή Ισότητα](#χαλαρή-ισότητα)
- [Αυστηρή Ισότητα](#αυστηρή-ισότητα)
4. [Αντικείμενα](#αντικείμενα)
- [Δημιουργία Αντικειμένου](#δημιουργία-αντικειμένου)
- [Πρόσβαση σε Ιδιότητες](#πρόσβαση-σε-ιδιότητες)
- [Προσθήκη Ιδιοτήτων](#προσθήκη-ιδιοτήτων)
- [Διαγραφή Ιδιοτήτων](#διαγραφή-ιδιοτήτων)
- [Αλλαγή Ιδιοτήτων](#αλλαγή-ιδιοτήτων)
- [Εμφώλευση Αντικειμένων](#εμφώλευση-αντικειμένων)
5. [Πίνακες](#πίνακες)
- [Πρόσβαση σε Στοιχεία](#πρόσβαση-σε-στοιχεία)
- [Μήκος Πίνακα](#μήκος-πίνακα)
- [Προσθήκη Στοιχείων](#προσθήκη-στοιχείων)
- [Αφαίρεση Στοιχείων](#αφαίρεση-στοιχείων)
- [Οι Πίνακες είναι Αντικείμενα](#οι-πίνακες-είναι-αντικείμενα)
6. [Συναρτήσεις](#συναρτήσεις)
- [Δήλωση Συνάρτησης](#δήλωση-συνάρτησης)
- [Οι Συναρτήσεις είναι Αντικείμενα](#οι-συναρτήσεις-είναι-αντικείμενα)
- [Ανώνυμες Συναρτήσεις](#ανώνυμες-συναρτήσεις)
- [Συναρτήσεις Υψηλότερης Τάξης](#συναρτήσεις-υψηλότερης-τάξης)
- [Arrow Functions](#arrow-functions)
7. [Αντικειμενοστραφής Προγραμματισμός](#αντικειμενοστραφής-προγραμματισμός)
- [this keyword](#this-keyword)
- [Κλάσεις](#κλάσεις)
- [Prototype](#prototype)
- [Κληρονομικότητα](#κληρονομικότητα)
- [class keyword](#class-keyword)
8. [DOM](#dom)
- [Επιλογή Στοιχείων](#επιλογή-στοιχείων)
- [Αλλαγή Περιεχομένου](#αλλαγή-περιεχομένου)
- [Αλλαγή Στυλ](#αλλαγή-στυλ)
- [Δημιουργία Στοιχείων](#δημιουργία-στοιχείων)
- [Αφαίρεση Στοιχείων](#αφαίρεση-στοιχείων)
- [Event Listeners](#event-listeners)
[Χρήσιμες Πηγές](#χρήσιμες-πηγές)
Μελλοντικά θα προστεθούν και άλλα κεφάλαια στον οδηγό.
- [ ] Closure
- [ ] Ασύγχρονος Προγραμματισμός
- [ ] Μέθοδοι Πίνακα
- [ ] ...
# Εισαγωγή
## Φταίει η JavaScript;
Στην πορεία σου γράφοντας κώδικα σε JavaScript, πολλές φορές θα συναντήσεις καταστάσεις που θα σε κάνουν να αναρωτηθείς αν φταίει η δομή της γλώσσας για λάθη που σταματούν τον κώδικα σου απο το να εκτελεστεί. Θα σκεφτείς οτι είναι κακογραμμένη και οτι δεν βγάζει κανένα νόημα ο τρόπος με τον οποίο δουλεύει. Αυτό είναι κάτι που συμβαίνει σε όλους τους προγραμματιστές, ακόμα και σε αυτούς που έχουν χρόνια εμπειρίας.
Είναι μια γλώσσα που έχει πολλές παραδοχές και περίπλοκες λειτουργίες, οι οποίες μπορεί να σε μπερδέψουν αν δεν τις κατανοήσεις σωστά. Αυτό όμως δεν σημαίνει ότι η JavaScript είναι κακή γλώσσα, απλά πρέπει να μάθεις να την χρησιμοποιείς σωστά.
Οπότε μην κατηγορείς την γλώσσα για τα λάθη που θα εμφανίζονται στον κώδικα σου. Η JavaScript είναι μια γλώσσα που ναι μεν είναι εύκολο να τη μάθεις, αλλά δύσκολο να τη μάθεις <ins>σωστά</ins>. Αυτό σημαίνει ότι μπορείς να γράψεις κώδικα που να λειτουργεί, αλλά να μην είναι καλός κώδικας.
_Σαν προγραμματιστές έχουμε την ευθύνη να γνωρίζουμε τα εργαλεία που επιλέγουμε και να τα χρησιμοποιούμε σωστά._
## Spec & Manuals
Σε αυτή την ενότητα θέλω να εξηγήσω κάποιες έννοιες που μπορεί να συναντήσεις στην αναζήτηση σου για πληροφορίες σχετικά με τη JavaScript.
### Specification
---
Το πρότυπο της JavaScript είναι καθορισμένο από τον οργανισμό [ECMA International](https://ecma-international.org/). Άλλα παραδείγματα προτύπων που ίσως έχεις ακούσει είναι τα ISO, IETF, W3C κλπ.
Όταν αναφερόμαστε στο πρότυπο της JavaScript, αναφερόμαστε στο [ECMA-262](https://ecma-international.org/publications-and-standards/standards/ecma-262/) ή αλλιώς ECMAScript / ES. Με όποιον συμβολισμό και αν το αναφέρουμε, εννοούμε το ίδιο πράγμα.
Χρησιμοποιώντας έναν αριθμό στο τέλος του προτύπου, μπορούμε να δούμε την έκδοση της JavaScript που χρησιμοποιούμε. Για παράδειγμα, η έκδοση του 2015 είναι γνωστή ως ECMAScript 6 ή ES6. Η έκδοση του 2016 είναι γνωστή ως ECMAScript 7 ή ES7 και ούτω καθεξής. Μπορείς να βρεις την τελευταία Stable έκδοση του προτύπου εδώ https://tc39.es/ecma262/.
Καταλαβαίνεις λοιπόν ότι αυτό το πρότυπο καθορίζει τη συμπεριφορά της γλώσσας και τις νέες λειτουργίες που προστίθενται σε κάθε νέα έκδοση. Είναι λοιπόν η καλύτερη πηγή για να μάθεις τον τρόπο με τον οποίο λειτουργεί η JavaScript, ακόμα και σε αλγοριθμικό επίπεδο behind the scenes.
### MDN Web Docs
---
Πέρα απο το specification, ένα πολύ καλό manual για την JavaScript είναι το [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript). Εκεί θα βρεις πληροφορίες και παραδείγματα που χρειάζεσαι για να μάθεις καλύτερα τη γλώσσα.
## Compiled ή Interpreted;
Η JavaScript θεωρείται συνήθως ως interpreted γλώσσα, ενώ είναι στην πραγματικότητα μια <ins>Just-In-Time</ins> compiled γλώσσα. Οι σύγχρονες JavaScript engines (π.χ. V8 engine) χρησιμοποιούν έναν JIT μεταγλωττιστή (compiler) για τη βελτιστοποίηση του κώδικα πριν την εκτέλεση. Αυτός ο μεταγλωττιστής επιτρέπει στην JavaScript να εκτελείται πολύ πιο γρήγορα και με αποτελεσματικό τρόπο σε σχέση με τις παραδοσιακές interpreted γλώσσες.
Ο κώδικας JavaScript αναλύεται πριν από την εκτέλεση και μετατρέπεται στην πραγματικότητα σε δυαδική μορφή (κώδικας μηχανής που εκτελείται απευθείας από το hardware του υπολογιστή).
Έτσι, η απάντηση στην ερώτηση _<ins>"Η JavaScript είναι compiled ή interpreted γλώσσα;"</ins>_ είναι λίγο και από τα δύο. Είναι interpreted σε παλαιότερα προγράμματα περιήγησης, αλλά στα σύγχρονα προγράμματα περιήγησης, γίνεται compile με τη βοήθεια ενός JIT compiler.
# Μεταβλητές
Οι μεταβλητές είναι οι βασικές μονάδες αποθήκευσης πληροφορίας σε ένα πρόγραμμα. Μια μεταβλητή είναι ένα όνομα (label) που αναφέρεται σε μια τιμή.
## Δήλωση Μεταβλητών
Στην JavaScript, οι μεταβλητές δηλώνονται με την εντολή `var`. Μπορούμε να δηλώσουμε μια μεταβλητή χωρίς να της αναθέσουμε τιμή, αλλά αυτό σημαίνει ότι η τιμή της μεταβλητής θα είναι `undefined`.
<!-- prettier-ignore -->
```javascript
var x; // Δήλωση μεταβλητής
console.log(x); // undefined
```
## Ανάθεση Τιμής
Μια μεταβλητή μπορεί να περιέχει οποιαδήποτε τιμή, όπως αριθμούς, αλφαριθμητικά, boolean, κλπ.
<!-- prettier-ignore -->
```javascript
var x = 5; // Ταυτόχρονη δήλωση και ανάθεση αριθμητικής τιμής
var y = "Hello"; // Αλφαριθμητική τιμή
var z = true; // Boolean τιμή
console.log(x); // 5
console.log(y); // "Hello"
console.log(z); // true
```
## Εμβέλεια
Η εμβέλεια μιας μεταβλητής αναφέρεται στο πόσο μακριά από το σημείο δήλωσης της μπορεί να χρησιμοποιηθεί. Οι μεταβλητές μπορεί να έχουν είτε `τοπική (local)` εμβέλεια, είτε `καθολική (global)` εμβέλεια.
### var
---
Οι μεταβλητές που δηλώνονται με το με το λεκτικό `var` έχουν είτε global εμβέλεια, είτε εμβέλεια στα πλαίσια μιας συνάρτησης, ανάλογα με το σημείο δήλωσης τους.
<!-- prettier-ignore -->
```javascript
var x = 5; // Global μεταβλητή
function myFunction() {
var y = 10; // Local μεταβλητή
console.log(x); // 5
console.log(y); // 10
}
console.log(x); // 5
console.log(y); // ReferenceError: y is not defined
```
<br />
<!-- prettier-ignore -->
> [!NOTE]
> Αν μια μεταβλητή var δηλώνεται μέσα σε ένα code block (π.χ. μέσα σε ένα if statement), τότε η εμβέλεια της μεταβλητής δεν περιορίζεται στο block αυτό, αλλά είναι η συνάρτηση στην οποία ανήκει το code block. Αν το code block δεν ανήκει σε κάποια συνάρτηση, τότε η μεταβλητή έχει global εμβέλεια.
<br />
<!-- prettier-ignore -->
```javascript
if (true) {
var x = 5; // Η x έχει global εμβέλεια
}
function myFunction() {
if (true) {
var y = 10; // Η y έχει local εμβέλεια στην myFunction
}
}
console.log(x); // 5
console.log(y); // ReferenceError: y is not defined
```
### let
---
Η εντολή `let` εισήχθη στην ES6 και χρησιμοποιείται για τη δήλωση μεταβλητών με block scope. Αυτό σημαίνει ότι οι μεταβλητές που δηλώνονται με το λεκτικό `let` έχουν εμβέλεια μόνο στο block στο οποίο δηλώνονται.
<!-- prettier-ignore -->
```javascript
let x = 5; // Global μεταβλητή
function myFunction() {
let y = 10; // Local μεταβλητή στην myFunction
console.log(x); // 5
console.log(y); // 10
for (let i = 0; i < 5; i++) {
console.log(i); // Local μεταβλητή i μέσα στο for loop
}
console.log(i); // ReferenceError: i is not defined
}
console.log(x); // 5
console.log(y); // ReferenceError: y is not defined
```
Επίσης μια μεταβλητή που δηλώνεται με το λεκτικό `let` δεν μπορεί να ξαναδηλωθεί μέσα στο ίδιο block, κάτι το οποίο είναι δυνατό με το λεκτικό `var`.
<!-- prettier-ignore -->
```javascript
let x = 5;
let x = 10; // SyntaxError: Identifier 'x' has already been declared
```
### const
---
Η εντολή `const` χρησιμοποιείται για τη δήλωση μεταβλητών με block scope, οι οποίες δεν μπορούν να αλλάξουν τιμή μετά την αρχική ανάθεση.
<!-- prettier-ignore -->
```javascript
const x = 5; // Η x είναι μια σταθερά
x = 10; // TypeError: Assignment to constant variable
```
Όπως και με το `let`, μια μεταβλητή που δηλώνεται με το λεκτικό `const` δεν μπορεί να ξαναδηλωθεί μέσα στο ίδιο block.
<!-- prettier-ignore -->
```javascript
const x = 5;
const x = 10; // SyntaxError: Identifier 'x' has already been declared
```
Μια μεταβλητή που δηλώνεται με το λεκτικό `const` πρέπει να αρχικοποιηθεί με μια τιμή.
<!-- prettier-ignore -->
```javascript
const x; // SyntaxError: Missing initializer in const declaration
```
Το λεκτικό `const` είναι λίγο παραπλανητικό. Στην ουσία δεν ορίζει μία σταθερή τιμή, αλλά μια σταθερή αναφορά σε μια τιμή.
Αυτό σημαίνει οτι ΔΕΝ μπορούμε να:
- Εκχωρήσουμε ξανά μια constant τιμή
- Εκχωρήσουμε ξανά ένα constant πίνακα
- Εκχωρήσουμε ξανά ένα constant αντικειμένο
Αλλά μπορούμε να:
- Αλλάξουμε τα στοιχεία ενός constant πίνακα
- Αλλάξουμε τις ιδιότητες ενός constant αντικειμένου
<br />
<!-- prettier-ignore -->
> [!TIP]
Με την εισαγωγή των `let` και `const` στην ES6, η χρήση του `var` έχει μειωθεί σημαντικά. Συνιστάται να χρησιμοποιείς `let` για μεταβλητές που μπορεί να αλλάξουν τιμή και `const` για σταθερές.
<br />
# Τύποι Δεδομένων
H JavaScript είναι μια γλώσσα <u>δυναμικού τύπου</u>, που σημαίνει οτι στις μεταβλητές εισάγουμε δεδομένα χωρίς να χρειάζεται να δηλώσουμε τον τύπο τους. Μια μεταβλητή μπορεί να περιέχει δεδομένα διαφορετικού τύπου κατά τη διάρκεια της εκτέλεσης του προγράμματος.
Για παράδειγμα:
<!-- prettier-ignore -->
```javascript
let x = 5; // Η τιμή της x είναι τύπου Number
x = "Hello"; // Η τιμή της x τώρα είναι τύπου String
```
## typeof
Για να μάθουμε τον τύπο μιας τιμής μπορούμε να χρησιμοποιήσουμε τον operator `typeof`. Αυτή η εντολή επιστρέφει τον τύπο της τιμής σε μορφή string.
```javascript
const x = 5;
console.log(typeof x); // "number"
```
## Primitive Types
Η JavaScript έχει κάποιους προκαθορισμένους τύπους δεδομένων, οι οποίοι ονομάζονται Primitive Data Types. Αυτοί οι τύποι είναι οι εξής:
### Number
---
Ο τύπος `Number` χρησιμοποιείται για αριθμητικές τιμές. Μπορεί να είναι ακέραιος αριθμός ή δεκαδικός αριθμός. Στην JavaScript δεν υπάρχει διαφορά μεταξύ αυτών των δύο τύπων.
<!-- prettier-ignore -->
```javascript
const x = 5; // Ακέραιος αριθμός
const y = 5.5; // Δεκαδικός αριθμός
console.log(typeof x); // "number"
console.log(typeof y); // Επίσης "number"
```
Δύο ειδικές τιμές που μπορούν να αντιστοιχιστούν στον τύπο Number είναι το `Infinity` και το `NaN`.
<br />
Το `Infinity` χρησιμοποιείται όταν ένας αριθμός υπερβαίνει το μέγιστο επιτρεπτό όριο.
<!-- prettier-ignore -->
```javascript
const x = 1 / 0;
console.log(x); // Infinity
const y = -1 / 0;
console.log(y); // -Infinity
console.log(typeof x); // "number"
console.log(typeof y); // Επίσης "number"
```
<br />
Το `NaN` (Not-a-Number) χρησιμοποιείται όταν μια αριθμητική πράξη δεν μπορεί να εκτελεστεί (Invalid Number). Καλή πρακτική είναι να ελέγχουμε αν μια τιμή είναι `NaN` πριν την χρησιμοποιήσουμε.
<!-- prettier-ignore -->
```javascript
const x = 100 / "Apple";
console.log(x); // NaN
console.log(typeof(x)); // "number"
```
<br />
<!-- prettier-ignore -->
> [!CAUTION]
> Το `NaN` είναι η μόνη τιμή στην JavaScript που δεν είναι ίση με τον εαυτό της. Αυτό σημαίνει ότι αν χρησιμοποιήσουμε τον τελεστή `===` για να συγκρίνουμε μια τιμή με το `NaN`, το αποτέλεσμα θα είναι `false`. Δηλαδή `NaN === NaN` επιστρέφει `false`.
<br />
Για να ελέγξουμε αν μια τιμή δεν είναι αριθμός ή δεν μπορεί να μετατραπεί σε αριθμό (περισσότερα στο κεφάλαιο "Αλλαγή Τύπου"), μπορούμε να χρησιμοποιήσουμε την συνάρτηση `isNaN()`.
<!-- prettier-ignore -->
```javascript
const x = 100 / "Apple";
isNaN(x); // true
```
Παρατηρούμε οτι η συνάρτηση `isNaN()` επιστρέφει `false` αν η τιμή είναι αριθμός σε μορφή `String`. Αυτό γίνεται γιατί η συνάρτηση `isNaN()` προσπαθεί πρώτα να μετατρέψει την τιμή σε αριθμό πριν επιστρέψει κάποιο αποτέλεσμα.
<!-- prettier-ignore -->
```javascript
const x = "100";
isNaN(x); // false
```
Μπορούμε επίσης να χρησιμοποιήσουμε την συνάρτηση `Number.isNaN()` για να ελέγξουμε αν μια τιμή είναι αμιγώς `NaN`.
<!-- prettier-ignore -->
```javascript
const x = "bar" / "foo";
const y = NaN;
Number.isNaN(x); // true
Number.isNaN(y); // true
```
### String
---
Ο τύπος `String` χρησιμοποιείται για αλφαριθμητικές τιμές. Μπορεί να περιέχει οποιοδήποτε κείμενο μέσα σε εισαγωγικά.
<!-- prettier-ignore -->
```javascript
const x = "Hello World!";
console.log(typeof x); // "string"
```
Μπορούμε να χρησιμοποιήσουμε είτε μονά είτε διπλά εισαγωγικά για να δηλώσουμε μια τιμή τύπου `String`.
<!-- prettier-ignore -->
```javascript
const x = 'Hello World!';
const y = "Hello World!";
```
Αν θέλουμε να χρησιμοποιήσουμε εισαγωγικά μέσα σε μια τιμή τύπου `String`, μπορούμε να χρησιμοποιήσουμε τον χαρακτήρα `\` για να δηλώσουμε ότι το εισαγωγικό δεν είναι το τέλος της τιμής.
<!-- prettier-ignore -->
```javascript
const x = "He said \"Hello\"";
console.log(x); // He said "Hello"
```
### Boolean
---
Ο τύπος `Boolean` χρησιμοποιείται για τις τιμές `true` και `false`.
<!-- prettier-ignore -->
```javascript
const x = true;
const y = false;
console.log(typeof x); // "boolean"
console.log(typeof y); // Επίσης "boolean"
```
### Undefined
---
Η τιμή `undefined` χρησιμοποιείται όταν μια μεταβλητή δεν έχει αρχικοποιηθεί.
<!-- prettier-ignore -->
```javascript
var x;
console.log(x); // undefined
console.log(typeof x); // "undefined"
const y = undefined;
console.log(y); // undefined
const arr = [1, 2, 3];
console.log(arr[3]); // undefined
function foo() {
return;
}
console.log(foo()); // undefined
```
### Null
---
Η τιμή `null` χρησιμοποιείται όταν θέλουμε να δηλώσουμε ότι μια μεταβλητή δεν περιέχει τίποτα.
<!-- prettier-ignore -->
```javascript
const x = null;
console.log(x); // null
console.log(typeof x); // "object" (???)
```
<br />
<!-- prettier-ignore -->
> [!WARNING]
> Η τιμή `null` επιστρέφει `"object"` όταν χρησιμοποιήσουμε τον operator `typeof`. Αυτό είναι ένα bug στην JavaScript που υπάρχει απο τις πρώτες κιόλας εκδόσεις της γλώσσας. Αυτό το bug διατηρείται μέχρι και σημερα για λόγους συμβατότητας με παλαιότερες εκδόσεις της γλώσσας.
<br />
<p align="center">
<img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5XFJVMi_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1627256711813/d4FV_NtKb.jpeg" alt="null typeof bug" width="250px"/>
</p>
### BigInt
---
Ο τύπος `BigInt` χρησιμοποιείται για ακέραιους αριθμούς με μεγάλη ακρίβεια. Μπορούμε να δηλώσουμε μια τιμή τέτοιου τύπου προσθέτοντας τον χαρακτήρα `n` στο τέλος της τιμής.
<!-- prettier-ignore -->
```javascript
const x = 237n;
console.log(x); // 237n
console.log(typeof x); // "bigint"
```
### Symbol
---
Ο τύπος `Symbol` χρησιμοποιείται για τη δημιουργία μοναδικών τιμών. Ένα `Symbol` δεν μπορεί να συγκριθεί με άλλες τιμές.
<!-- prettier-ignore -->
```javascript
const x = Symbol("Hello");
console.log(x); // Symbol(Hello)
console.log(typeof x); // "symbol"
const y = Symbol("Hello");
console.log(x === y); // false
const z = Symbol("World");
console.log(x === z); // false
```
## Objects
Ο τύπος `Object` χρησιμοποιείται για τη δημιουργία αντικειμένων. Ένα αντικείμενο είναι μια συλλογή από ζεύγη κλειδιών-τιμών.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
console.log(person); // { name: "John", age: 30, city: "New York" }
console.log(typeof person); // "object"
```
Σε αυτή τη κατηγορία ανήκουν επίσης οι `Πίνακες (Arrays)` και οι `Συναρτήσεις (Functions)`, τα οποία θα μελετήσουμε σε επόμενα κεφάλαια. Περισσότερα για τα αντικείμενα στο κεφάλαιο "Αντικείμενα".
## Αλλαγή Τύπου
Όπως είπαμε στην αρχή, η JavaScript είναι μια γλώσσα δυναμικού τύπου, που σημαίνει ότι μια μεταβλητή μπορεί να περιέχει δεδομένα διαφορετικού τύπου κατά τη διάρκεια της εκτέλεσης του προγράμματος.
Υπάρχουν δύο τρόποι για να αλλάξει ο τύπος μιας τιμής:
- Type Conversion (Type Casting)
- Type Coercion (Implicit Type Conversion)
### Type Conversion
---
Η `Type Conversion` είναι η εξαναγκασμένη αλλαγή τύπου μιας τιμής από τον προγραμματιστή. Αυτό γίνεται με τη χρήση των εντολών `Number()`, `String()`, `Boolean()`.
#### Number()
Η συνάρτηση `Number()` μετατρέπει μια τιμή σε αριθμό.
<!-- prettier-ignore -->
```javascript
const x = "10";
console.log(Number(x)); // 10
```
Αν η τιμή δεν μπορεί να μετατραπεί σε αριθμό, τότε η συνάρτηση επιστρέφει την τιμή `NaN`.
<!-- prettier-ignore -->
```javascript
const x = "Hello";
console.log(Number(x)); // NaN
```
#### String()
Η συνάρτηση `String()` μετατρέπει μια τιμή σε αλφαριθμητικό.
<!-- prettier-ignore -->
```javascript
const x = 10;
console.log(String(x)); // "10"
```
#### Boolean()
Η συνάρτηση `Boolean()` μετατρέπει μια τιμή σε boolean.
Οι εξής τιμές μετατρέπονται σε `false`:
- `false`
- `0`
- `""` (κενό string)
- `null`
- `undefined`
- `NaN`
Οποιαδήποτε άλλη τιμή μετατρέπεται σε `true`.
<!-- prettier-ignore -->
```javascript
const x = 0;
console.log(Boolean(x)); // false
const y = "Hello";
console.log(Boolean(y)); // true
```
### Type Coercion
---
Η `Type Coercion` είναι η αυτόματη αλλαγή τύπου μιας τιμής από την JavaScript. Αυτό συμβαίνει όταν δύο τιμές διαφορετικών τύπων συγκρίνονται μεταξύ τους.
Για παράδειγμα, όταν μια αριθμητική τιμή συγκρίνεται με μια αλφαριθμητική τιμή, η αλφαριθμητική τιμή μετατρέπεται σε αριθμό.
<!-- prettier-ignore -->
```javascript
const x = 10;
const y = "10";
console.log(x == y); // true
```
Στο παραπάνω παράδειγμα, η τιμή της μεταβλητής `y` μετατρέπεται σε αριθμό πριν γίνει η σύγκριση.
### Συνένωση Τύπων
---
Όταν συνενώνουμε δύο αλφαριθμητικές τιμές με τον τελεστή `+`, τότε οι τιμές μετατρέπονται σε αλφαριθμητικές.
<!-- prettier-ignore -->
```javascript
const x = "Hello";
const y = "World";
console.log(x + y); // "HelloWorld"
```
Αν η μία τιμή είναι αριθμός, τότε η αλλη τιμή μετατρέπεται σε αριθμό.
<!-- prettier-ignore -->
```javascript
const x = 10;
const y = "20";
console.log(x + y); // 30
```
Αν οι δύο τιμές είναι αριθμοί, τότε γίνεται αριθμητική πρόσθεση.
<!-- prettier-ignore -->
```javascript
const x = 10;
const y = 20;
console.log(x + y); // 30
```
### Truthy & Falsy
---
Στην JavaScript, υπάρχουν οι εξής τιμές που ερμηνεύονται ως `false`:
- `false`
- `0`
- `""` (κενό string)
- `null`
- `undefined`
- `NaN`
Οποιαδήποτε άλλη τιμή ερμηνεύεται ως `true`.
<!-- prettier-ignore -->
```javascript
const x = 0;
if (x) {
console.log("Truthy");
} else {
console.log("Falsy"); // Εκτυπώνει "Falsy"
}
```
### Χαλαρή Ισότητα
---
Η χαλαρή ισότητα (Loose Equality) είναι μια σύγκριση μεταξύ δύο τιμών χωρίς να λαμβάνεται υπόψη ο τύπος τους. Αυτό σημαίνει ότι οι τιμές με διαφορετικούς τύπους μπορούν να είναι ίσες.
Ο τελεστής για τη χαλαρή ισότητα είναι το `==`.
<!-- prettier-ignore -->
```javascript
const x = 10;
const y = "10";
if (x == y) {
console.log("Equal"); // Εκτυπώνει "Equal"
}
```
### Αυστηρή Ισότητα
---
Η αυστηρή ισότητα (Strict Equality) είναι μια σύγκριση μεταξύ δύο τιμών λαμβάνοντας υπόψη και τον τύπο τους. Αυτό σημαίνει ότι οι τιμές με διαφορετικούς τύπους δεν μπορούν να είναι ίσες.
Ο τελεστής για την αυστηρή ισότητα είναι το `===`.
<!-- prettier-ignore -->
```javascript
const x = 10;
const y = "10";
if (x === y) {
console.log("Equal");
} else {
console.log("Not Equal"); // Εκτυπώνει "Not Equal"
}
```
# Αντικείμενα
Τα αντικείμενα είναι μια συλλογή από ζεύγη κλειδιών-τιμών. Τα κλειδιά είναι strings και οι τιμές μπορούν να είναι οποιουδήποτε τύπου δεδομένων.
Ο τρόπος αναπαράστασης των αντικειμένων στη JavaScript καθιερώθηκε ώς ο πιο δημοφιλής τρόπος αναπαράστασης δεδομένων. Αυτός ο τρόπος αναπαράστασης είναι γνωστός ως `JSON (JavaScript Object Notation)`. Το JSON είναι ένα απλό και εύκολο στην κατανόηση σύνταξη για την ανταλλαγή δεδομένων μεταξύ εφαρμογών.
## Δημιουργία Αντικειμένου
Για να δημιουργήσουμε ένα αντικείμενο, χρησιμοποιούμε τις αγκύλες `{}`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
```
Το παραπάνω αντικείμενο έχει τρία κλειδιά: `name`, `age` και `city`. Κάθε κλειδί αντιστοιχίζεται σε μια τιμή.
Εναλλακτικός τρόπος δημιουργίας αντικειμένου είναι με τη χρήση της μεθόδου `Object()`.
<!-- prettier-ignore -->
```javascript
const person = new Object();
person.name = "John"; // person = { name: "John" }
person.age = 30; // person = { name: "John", age: 30 }
person.city = "New York"; // person = { name: "John", age: 30, city: "New York" }
```
## Πρόσβαση σε Ιδιότητες
Για να αποκτήσουμε πρόσβαση σε μια ιδιότητα ενός αντικειμένου, χρησιμοποιούμε τον τελεστή `.` ή τις αγκύλες `[]`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
console.log(person.name); // "John"
console.log(person["age"]); // 30
```
Αν η ιδιότητα που προσπαθούμε να αποκτήσουμε πρόσβαση δεν υπάρχει, τότε η τιμή που επιστρέφεται είναι `undefined`.
<!-- prettier-ignore -->
```javascript
console.log(person.city); // "New York"
console.log(person["job"]); // undefined
```
## Προσθήκη Ιδιοτήτων
Για να προσθέσουμε μια ιδιότητα σε ένα αντικείμενο, χρησιμοποιούμε τον τελεστή `.` ή τις αγκύλες `[]` ακολουθούμενο από το όνομα της ιδιότητας και την τιμή της.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
person.job = "Developer";
person["salary"] = 50000;
console.log(person); // { name: "John", age: 30, city: "New York", job: "Developer", salary: 50000 }
```
## Διαγραφή Ιδιοτήτων
Για να διαγράψουμε μια ιδιότητα από ένα αντικείμενο, χρησιμοποιούμε την εντολή `delete`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
delete person.city;
console.log(person); // { name: "John", age: 30 }
```
## Αλλαγή Ιδιοτήτων
Για να αλλάξουμε την τιμή μιας ιδιότητας ενός αντικειμένου, απλά προσπελαύνουμε την ιδιότητα και την αντικαθιστούμε με μια νέα τιμή.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
person.age = 35;
person["city"] = "Los Angeles";
console.log(person); // { name: "John", age: 35, city: "Los Angeles" }
```
## Εμφώλευση Αντικειμένων
Μπορούμε να ενσωματώσουμε ένα αντικείμενο μέσα σε ένα άλλο αντικείμενο, δημιουργώντας έτσι ένα σύνθετο αντικείμενο.
Αυτή η διαδικασία ονομάζεται `εμφώλευση αντικειμένων`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
const job = {
title: "Developer",
salary: 50000
};
person.job = job;
console.log(person); // { name: "John", age: 30, city: "New York", job: { title: "Developer", salary: 50000 } }
```
# Πίνακες
Οι πίνακες είναι μια συλλογή από τιμές, οι οποίες αποθηκεύονται σε μια μεταβλητή. Οι τιμές αυτές μπορούν να είναι οποιουδήποτε τύπου δεδομένων.
Για να δηλώσουμε έναν πίνακα, χρησιμοποιούμε τα αγκύλες `[]`.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
```
Οι τιμές ενός πίνακα μπορούν να αλλάξουν κατά τη διάρκεια της εκτέλεσης του προγράμματος. Αυτό σημαίνει ότι μπορούμε να προσθέσουμε, να αφαιρέσουμε ή να αλλάξουμε τις τιμές του πίνακα.
Επίσης οι τιμές ενός πίνακα μπορούν να είναι οποιουδήποτε τύπου δεδομένων.
<!-- prettier-ignore -->
```javascript
const arr = [10, "Hello", true, null, undefined];
```
## Πρόσβαση σε Στοιχεία
Για να αποκτήσουμε πρόσβαση σε ένα στοιχείο ενός πίνακα, χρησιμοποιούμε τον αριθμό της θέσης του στοιχείου μέσα στις αγκύλες `[]`.
Οι θέσεις των στοιχείων ενός πίνακα ξεκινούν από το 0.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
console.log(fruits[0]); // "Apple"
console.log(fruits[1]); // "Banana"
console.log(fruits[2]); // "Orange"
```
<br />
<!-- prettier-ignore -->
> [!NOTE]
> Αν προσπαθήσουμε να αποκτήσουμε πρόσβαση σε μια θέση που δεν υπάρχει, τότε η τιμή που επιστρέφεται είναι `undefined`.
<br />
<!-- prettier-ignore -->
```javascript
console.log(fruits[3]); // undefined
```
## Μήκος Πίνακα
Για να μάθουμε το μήκος ενός πίνακα, χρησιμοποιούμε την ιδιότητα `length`.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
console.log(fruits.length); // 3
```
## Προσθήκη Στοιχείων
Για να προσθέσουμε ένα στοιχείο στο τέλος ενός πίνακα, χρησιμοποιούμε τη μέθοδο `push()`.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
fruits.push("Strawberry");
console.log(fruits); // ["Apple", "Banana", "Orange", "Strawberry"]
```
## Αφαίρεση Στοιχείων
Για να αφαιρέσουμε το τελευταίο στοιχείο ενός πίνακα, χρησιμοποιούμε τη μέθοδο `pop()`.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
fruits.pop();
console.log(fruits); // ["Apple", "Banana"]
```
Για να αφαιρέσουμε το πρώτο στοιχείο ενός πίνακα, χρησιμοποιούμε τη μέθοδο `shift()`.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
fruits.shift();
console.log(fruits); // ["Banana", "Orange"]
```
## Οι Πίνακες είναι Αντικείμενα
Στην JavaScript, οι πίνακες είναι αντικείμενα. Αυτό σημαίνει ότι μπορούμε να προσθέσουμε ιδιότητες και μεθόδους σε έναν πίνακα.
<!-- prettier-ignore -->
```javascript
const fruits = ["Apple", "Banana", "Orange"];
fruits.color = "Red"; // Προσθήκη ιδιότητας
console.log(fruits.color); // "Red"
fruits.sayHello = function() { // Προσθήκη μεθόδου
console.log("Hello!");
};
fruits.sayHello(); // "Hello!"
for (let item in fruits) { // Εμφάνιση όλων των ιδιοτήτων (κλειδιών) του πίνακα
console.log(item); // "0", "1", "2", "color", "sayHello"
}
```
# Συναρτήσεις
## Δήλωση Συνάρτησης
Για να δηλώσουμε μια συνάρτηση στην JavaScript, χρησιμοποιούμε τη λέξη-κλειδί `function`.
<!-- prettier-ignore -->
```javascript
function myFunction() {
console.log("Hello World!");
}
```
Η συνάρτηση αυτή μπορεί να κληθεί με το όνομά της.
<!-- prettier-ignore -->
```javascript
myFunction(); // "Hello World!"
```
## Οι Συναρτήσεις είναι Αντικείμενα
Στην JavaScript, οι συναρτήσεις είναι αντικείμενα. Αυτό σημαίνει ότι μπορούμε να προσθέσουμε ιδιότητες και μεθόδους σε μια συνάρτηση.
<!-- prettier-ignore -->
```javascript
function myFunction() {
console.log("Hello World!");
}
myFunction.color = "Red"; // Προσθήκη ιδιότητας
console.log(myFunction.color); // "Red"
myFunction.sayHello = function() { // Προσθήκη μεθόδου
console.log("Hello!");
};
myFunction.sayHello(); // "Hello!"
for (let item in myFunction) { // Εμφάνιση όλων των ιδιοτήτων (κλειδιών) της συνάρτησης
console.log(item); // "color", "sayHello"
}
```
## Ανώνυμες Συναρτήσεις
Μπορούμε επίσης να αναθέσουμε τη συνάρτηση σε μια μεταβλητή. Σε αυτήν τη περίπτωση, η κλήση της συνάρτησης γίνεται με το όνομα της μεταβλητής. Οι συναρτήσεις που αναθέτουμε σε μεταβλητές ονομάζονται `Ανώνυμες Συναρτήσεις`.
<!-- prettier-ignore -->
```javascript
const myFunction = function() {
console.log("Hello World!");
};
myFunction(); // "Hello World!"
```
Η ανάθεση συνάρτησης σε μεταβλητή μας επιτρέπει επίσης να περάσουμε τη συνάρτηση ως όρισμα σε μια άλλη συνάρτηση.
<!-- prettier-ignore -->
```javascript
function sayHello(callbackFunction) {
callback();
}
sayHello(myFunction); // "Hello World!"
```
Οι συναρτήσεις που δίνονται ώς όρισμα σε μια άλλη συνάρτηση συχνά ονομάζονται `Συναρτήσεις Επανάκλησης (Callback Functions)`.
## Συναρτήσεις Υψηλότερης Τάξης
Οι συναρτήσεις που δέχονται μια άλλη συνάρτηση ως όρισμα ή επιστρέφουν μια συνάρτηση, ονομάζονται `Συναρτήσεις Υψηλότερης Τάξης (Higher-Order Functions)`.
Ένα παράδειγμα συνάρτησης υψηλότερης τάξης είναι η `filter()`, η οποία δέχεται μια συνάρτηση ως όρισμα και επιστρέφει ένα νέο πίνακα με τα στοιχεία που πληρούν τη συνθήκη που ορίζεται στη συνάρτηση. Η `filter()` είναι μια από τις πολλές ενσωματωμένες συναρτήσεις για πίνακες στη JavaScript.
<!-- prettier-ignore -->
```javascript
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const evenNumbers = numbers.filter(function(number) {
return number % 2 === 0;
});
console.log(evenNumbers); // [2, 4, 6, 8, 10]
```
## Arrow Functions
Οι `Arrow Functions` είναι μια συντομευμένη σύνταξη για τη δημιουργία συναρτήσεων στη JavaScript. Είναι συνήθως πιο σύντομες από τις συναρτήσεις που δηλώνονται με τη λέξη-κλειδί `function`. Οι Arrow Functions εισήχθησαν στην JavaScript με την ES6.
Όλοι οι παρακάτω ορισμοί συναρτήσεων είναι ισοδύναμοι.
<!-- prettier-ignore -->
```javascript
function addOne(input) { return input + 1; }
// ή
const addOne = function(input) { return input + 1; };
// ή
const addOne = (input) => { return input + 1; };
// ή
const addOne = (input) => input + 1;
// ή
const addOne = input => input + 1;
```
Αν η συνάρτηση δέχεται όρισμα, τότε δεν χρειάζεται να χρησιμοποιήσουμε παρενθέσεις, όπως στο τελευταίο παράδειγμα.
<!-- prettier-ignore -->
```javascript
const myFunction = name => {
console.log(`Hello ${name}!`);
};
myFunction("John"); // "Hello John!"
```
# Αντικειμενοστραφής Προγραμματισμός
Ο `Αντικειμενοστραφής Προγραμματισμός (Object-Oriented Programming - OOP)` είναι μια μεθοδολογία προγραμματισμοϋ, η οποία βασίζεται στην αναπαράσταση εννοιών ως αντικείμενα. Στην JavaScript, όπως είδαμε, τα αντικείμενα είναι συλλογές από ιδιότητες και μεθόδους.
Οι βασικές αρχές του Αντικειμενοστραφής Προγραμματισμοϋ είναι:
- `Κλάσεις (Classes)`: Ορίζουν τη δομή ενός αντικειμένου.
- `Αντικείμενα (Objects)`: Είναι συγκεκριμένα στιγμιότυπα μιας κλάσης.
- `Ιδιότητες (Properties)`: Χαρακτηρίζουν τα χαρακτηριστικά ενός αντικειμένου.
- `Μέθοδοι (Methods)`: Είναι συναρτήσεις που ανήκουν σε ένα αντικείμενο.
## This Keyword
Η λέξη-κλειδί `this` χρησιμοποιείται για να αναφερθούμε στο τρέχον αντικείμενο. Η τιμή του `this` εξαρτάται από τον τρόπο με τον οποίο καλείται η συνάρτηση.
Στον παρακάτω κώδικα, το `this` αναφέρεται στο αντικείμενο `person`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York",
sayHello: function() {
console.log(`Hello, my name is ${this.name}`);
}
};
person.sayHello(); // "Hello, my name is John"
```
Αν καλέσουμε τη μέθοδο `sayHello()` χωρίς το `this`, τότε το `name` δεν θα αναφέρεται στο όνομα του αντικειμένου `person`, αλλά σε μια μεταβλητή με το όνομα `name`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York",
sayHello: function() {
console.log(`Hello, my name is ${name}`);
}
};
person.sayHello(); // "Hello, my name is "
```
## Κλάσεις
Στην JavaScript χρησιμοποιούμε τις συναρτήσεις για να ορίσουμε μια κλάση. Οι συναρτήσεις αυτές ονομάζονται `Συναρτήσεις Κατασκευής (Constructor Functions)`. Η κλάση αυτή ορίζει τις ιδιότητες και τις μεθόδους που θα έχουν τα αντικείμενα που δημιουργοϋνται από αυτήν. Συνηθισμένη πρακτική είναι η ονομασία των κλάσεων με κεφαλαίο πρώτο γράμμα.
<!-- prettier-ignore -->
```javascript
function Person(name, age) {
this.name = name;
this.age = age;
}
const john = new Person("John", 30);
```
Στο παραπάνω παράδειγμα, η συνάρτηση `Person` είναι μια κλάση που ορίζει τις ιδιότητες `name` και `age`. Το αντικείμενο `john` δημιουργείται από την κλάση `Person` με τις τιμές `"John"` και `30`.
Για να προσθέσουμε μια μέθοδο σε μια κλάση, χρησιμοποιούμε το πεδίο πρωτοτύπου (prototype) της κλάσης.
## Prototype
Στην JavaScript, όλα τα αντικείμενα έχουν ένα πεδίο πρωτοτύπου (prototype), το οποίο είναι ένα αντικείμενο από το οποίο κληρονομούνται ιδιότητες και μέθοδοι. Καθώς το πεδίο πρωτοτύπου είναι ένα αντικείμενο, αυτό σημαίνει ότι και αυτό έχει ένα πεδίο πρωτοτύπου, το οποίο μπορεί να έχει ένα άλλο πεδίο πρωτοτύπου και ούτω καθεξής. Αυτό ονομάζεται `Αλυσίδα Πρωτοτύπων (Prototype Chain)`.
Μπορούμε να προσπελάσουμε το πεδίο πρωτοτύπου ενός αντικειμένου με την ιδιότητα `__proto__`.
<!-- prettier-ignore -->
```javascript
const person = {
name: "John",
age: 30,
city: "New York"
};
console.log(person.__proto__); // { constructor: f Object(), __defineGetter__: f, __defineSetter__: f, ... }
```
Όταν καλούμε μια ιδιότητα ενός αντικειμένου, η JavaScript πρώτα ψάχνει την ιδιότητα στο ίδιο το αντικείμενο. Αν δεν βρει την ιδιότητα, τότε ψάχνει στο πεδίο πρωτοτύπου του αντικειμένου.
Στο παρακάτω παράδειγμα, η συνάρτηση `sayHello()` δεν ορίζεται στο αντικείμενο `john`, αλλά στο πεδίο πρωτοτύπου της κλάσης `Person`. Αυτό σημαίνει ότι όλα τα αντικείμενα που δημιουργοϋνται από την κλάση `Person` θα έχουν πρόσβαση στη μέθοδο `sayHello()`.
<!-- prettier-ignore -->
```javascript
function Person(name, age) {
this.name = name;
this.age = age;
}
Person.prototype.sayHello = function() {
console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
};
const john = new Person("John", 30);
john.sayHello(); // "Hello, my name is John and I am 30 years old."
```
## Κληρονομικότητα
Η κληρονομικότητα είναι η ικανότητα μιας κλάσης να κληρονομήσει ιδιότητες και μεθόδους από μια άλλη κλάση. Στην JavaScript, η κληρονομικότητα επιτυγχάνεται μέσω του πεδίου πρωτοτύπου.
Στο παρακάτω παράδειγμα, η κλάση `Developer` κληρονομεί τις ιδιότητες και τις μεθόδους της κλάσης `Person`.
<!-- prettier-ignore -->
```javascript
function Person(name, age) {
this.name = name;
this.age = age;
}
Person.prototype.sayHello = function() {
console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
};
function Developer(name, age, language) {
Person.call(this, name, age);
this.language = language;
}
Developer.prototype = Object.create(Person.prototype);
Developer.prototype.constructor = Developer;
Developer.prototype.sayLanguage = function() {
console.log(`I am a developer and I code in ${this.language}.`);
};
const john = new Developer("John", 30, "JavaScript");
john.sayHello(); // "Hello, my name is John and I am 30 years old."
john.sayLanguage(); // "I am a developer and I code in JavaScript."
```
Με την χρήση της μεθόδου `call()`, καλούμε τον κατασκευαστή της κλάσης `Person` με το `this` της κλάσης `Developer`. Αυτό είναι απαραίτητο για να μπορέσουμε να περάσουμε τις τιμές `name` και `age` στην κλάση `Person`.
Η μέθοδος `Object.create()` δημιουργεί ένα νέο αντικείμενο με το πεδίο πρωτοτύπου του αντικειμένου που περνάμε ως όρισμα. Στην περίπτωσή μας, δημιουργοϋμε ένα νέο αντικείμενο με το πεδίο πρωτοτύπου της κλάσης `Person`.
Τέλος, ορίζουμε την ιδιότητα `constructor` του πεδίου πρωτοτύπου της κλάσης `Developer` ώστε να δείχνει πάλι στην κλάση `Developer`.
## Class Keyword
Η λέξη-κλειδί `class` εισήχθηκε στην JavaScript με την ES6 για να διευκολύνει τη δημιουργία κλάσεων. Η σύνταξη της `class` είναι πιο συντομευμένη από τη χρήση των συναρτήσεων κατασκευής. Η `class` δημιουργεί μια συνάρτηση κατασκευής, η οποία ονομάζεται `constructor`.
Δεν έχει καμία διαφορά στην ουσία με τη χρήση των συναρτήσεων κατασκευής και του πεδίου πρωτοτύπου. Η `class` είναι απλά μια συντομευμένη μορφή για τη δημιουργία κλάσεων. Σην κοινότητα της JavaScript συχνά το ονομάζουν σαν syntactic sugar.
<!-- prettier-ignore -->
```javascript
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
sayHello() {
console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
}
}
// Κληρονομικότητα
class Developer extends Person {
constructor(name, age, language) {
super(name, age);
this.language = language;
}
sayLanguage() {
console.log(`I am a developer and I code in ${this.language}.`);
}
}
const john = new Developer("John", 30, "JavaScript");
john.sayHello(); // "Hello, my name is John and I am 30 years old."
john.sayLanguage(); // "I am a developer and I code in JavaScript."
```
Στο παραπάνω παράδειγμα, η κλάση `Developer` κληρονομεί τις ιδιότητες και τις μεθόδους της κλάσης `Person` με τη χρήση της λέξης-κλειδί `extends`.
Η μέθοδος `super()` καλεί τον κατασκευαστή της γονικής κλάσης με το `this` της κλάσης `Developer`. Αυτό είναι απαραίτητο για να μπορέσουμε να περάσουμε τις τιμές `name` και `age` στην κλάση `Person`.
# DOM
Το `Document Object Model (DOM)` είναι ένα αντικειμενοστραφές μοντέλο (γραμμένο σε C++) που αναπαριστά το έγγραφο HTML ως δέντρο αντικειμένων (nodes). Το DOM επιτρέπει στους προγραμματιστές να αλλάξουν το περιεχόμενο, τη δομή και το στυλ στα elements της σελίδας HTML.
## Επιλογή Στοιχείων
Επιλέγοντας ένα στοιχείο απο το DOM, μας επιστρέφεται στην JavaScript ένα αντικείμενο. Αυτό το αντικείμενο έχει πολλές μεθόδους και ιδιότητες που μας επιτρέπουν να αλλάξουμε το περιεχόμενο, τη δομή και το στυλ του.
Για να επιλέξουμε ένα στοιχείο στο DOM, μπορούμε να χρησιμοποιήσουμε τις παρακάτω μεθόδους:
- `getElementById()`: Επιστρέφει το στοιχείο που έχει το συγκεκριμένο `id`.
<!-- prettier-ignore -->
```javascript
// <div id="myElement">Hello World!</div>
const element = document.getElementById("myElement");
```
- `getElementsByClassName()`: Επιστρέφει ένα σύνολο στοιχείων που έχουν τη συγκεκριμένη κλάση. Το αποτέλεσμα είναι ένα `HTMLCollection`. Αυτό είναι πρακτικά ένας πίνακας που περιέχει όλα τα στοιχεία που έχουν τη συγκεκριμένη κλάση. Τα στοιχεία στο `HTMLCollection` μπορούν να προσπελαστούν με τη χρήση της θέσης τους στον πίνακα.
<!-- prettier-ignore -->
```javascript
// <div class="myClass">First Element</div>
// <div class="myClass">Second Element</div>
const elements = document.getElementsByClassName("myClass");
console.log(elements[0]); // <div class="myClass">First Element</div>
```
- `getElementsByTagName()`: Επιστρέφει ένα σύνολο στοιχείων που έχουν το συγκεκριμένο tag name. Το αποτέλεσμα είναι ένα πάλι ένα `HTMLCollection`.
<!-- prettier-ignore -->
```javascript
// <div>First Element</div>
// <div>Second Element</div>
const elements = document.getElementsByTagName("div");
console.log(elements[0]); // <div>First Element</div>
```
- `querySelector()`: Επιστρέφει το πρώτο στοιχείο που ταιριάζει με το συγκεκριμένο selector. Αν δεν υπάρχει κανένα στοιχείο που ταιριάζει με τον selector, τότε επιστρέφεται `null`.
<!-- prettier-ignore -->
```javascript
// <div id="myElement">Hello World!</div>
const element = document.querySelector("#myElement");
```
<!-- prettier-ignore -->
> [!CAUTION]
> Προσοχή όταν χρησιμοποιείτε το `querySelector()`, ο selector πρέπει να είναι σε μορφή CSS. Αυτό σημαίνει ότι πρέπει να χρησιμοποιήσετε το `#` για να επιλέξετε ένα στοιχείο με βάση το `id` ή την `.` για να επιλέξετε ένα στοιχείο με βάση την κλάση.
- `querySelectorAll()`: Επιστρέφει όλα τα στοιχεία που ταιριάζουν με το συγκεκριμένο selector. Το αποτέλεσμα είναι ένα `NodeList`. Το `NodeList` είναι παρόμοιο με το `HTMLCollection`, αλλά δεν είναι πίνακας. Τα στοιχεία στο `NodeList` μπορούν να προσπελαστούν με τη χρήση της μεθόδου `forEach()`.
<!-- prettier-ignore -->
```javascript
// <div class="myClass">First Element</div>
// <div class="myClass">Second Element</div>
const elements = document.querySelectorAll(".myClass");
elements.forEach(element => {
console.log(element); // <div class="myClass">First Element</div>
});
```
## Αλλαγή Περιεχομένου
Έστω οτι έχουμε το ακόλουθο html αρχείο:
<!-- prettier-ignore -->
```html
<div id="myList">
This is my <b>links collection</b>:
<ul>
<li><a href="https://katabetian.dev">Andreas <b>Karabetian</b> </a></li>
<li><a href="https://ds.unipi.gr">Welcome to <b>DS Unipi!</b></a></li>
<li style="display: none;">Hidden Link</li>
</ul>
</div>
```
Για να αλλάξουμε το περιεχόμενο ενός στοιχείου στο DOM, μπορούμε να χρησιμοποιήσουμε τις παρακάτω μεθόδους:
- `innerHTML`: Χρησιμοποιείται για να πάρει ή να ορίσει το HTML περιεχόμενο ενός στοιχείου.
> [!CAUTION]
> Προσοχή: Η χρήση του `innerHTML` μπορεί να οδηγήσει σε security vulnerabilities. Αν το HTML περιεχόμενο που περνάτε στο `innerHTML` προέρχεται από χρήστη, τότε πρέπει να είστε προσεκτικοί.
<!-- prettier-ignore -->
```javascript
const element = document.getElementById("myList");
console.log(element.innerHTML);
// Returns the whole HTML content of the element:
// This is my <b>links collection</b>:
// <ul>
// <li><a href="https://katabetian.dev">Andreas <b>Karabetian</b> </a></li>
// <li><a href="https://ds.unipi.gr">Welcome to <b>DS Unipi!</b></a></li>
// <li style="display: none;">Hidden Link</li>
// </ul>
```
- `innerText`: Χρησιμοποιείται για να πάρει ή να ορίσει το κείμενο ενός στοιχείου. Η διαφορά με το `innerHTML` είναι ότι το `innerText` αγνοεί το HTML περιεχόμενο.
<!-- prettier-ignore -->
```javascript
const element = document.getElementById("myList");
console.log(element.innerText);
// Returns the text content of the element:
// This is my links collection:
// Andreas Karabetian
// Welcome to DS Unipi!
```
- `textContent`: Χρησιμοποιείται για να πάρει ή να ορίσει το κείμενο ενός στοιχείου. Η διαφορά με το `innerText` είναι ότι το `textContent` επιστρέφει όλο το κείμενο, συμπεριλαμβανομένων των κειμένων που είναι κρυμμένα με CSS.
<!-- prettier-ignore -->
```javascript
const element = document.getElementById("myElement");
console.log(element.textContent);
// Returns the text content of the element:
// This is my links collection:
// Andreas Karabetian
// Welcome to DS Unipi!
// Hidden Link
```
## Αλλαγή Στυλ
Για να αλλάξουμε το στυλ ενός στοιχείου στο DOM, μπορούμε να χρησιμοποιήσουμε την ιδιότητα `style`. Η ιδιότητα `style` είναι ένα αντικείμενο που περιέχει όλα τα CSS attributes ενός στοιχείου.
<!-- prettier-ignore -->
```javascript
// <div id="myElement">Hello World!</div>
const element = document.getElementById("myElement");
element.style.color = "red";
element.style.fontSize = "24px";
```
Μπορούμε επίσης να χρησιμοποιήσουμε τη μέθοδο `setAttribute()` για να ορίσουμε τα CSS attributes ενός στοιχείου.
<!-- prettier-ignore -->
```javascript
// <div id="myElement">Hello World!</div>
const element = document.getElementById("myElement");
element.setAttribute("style", "color: red; font-size: 24px;");
```
## Δημιουργία Στοιχείων
Για να δημιουργήσουμε ένα στοιχείο στο DOM, μπορούμε να χρησιμοποιήσουμε τις παρακάτω μεθόδους:
- `createElement()`: Δημιουργεί ένα νέο στοιχείο με το συγκεκριμένο tag name.
<!-- prettier-ignore -->
```javascript
const element = document.createElement("div");
```
- `createTextNode()`: Δημιουργεί ένα νέο κείμενο.
<!-- prettier-ignore -->
```javascript
const text = document.createTextNode("Hello World!");
```
Για να προσθέσουμε το στοιχείο στο DOM, μπορούμε να χρησιμοποιήσουμε τις παρακάτω μεθόδους:
- `appendChild()`: Προσθέτει ένα στοιχείο ως τελευταίο παιδί ενός άλλου στοιχείου.
<!-- prettier-ignore -->
```javascript
// <div id="parentElement"></div>
const parentElement = document.getElementById("parentElement");
const element = document.createElement("div");
parentElement.appendChild(element);
```
- `insertBefore()`: Προσθέτει ένα στοιχείο πριν από ένα άλλο στοιχείο.
<!-- prettier-ignore -->
```javascript
// <div id="parentElement"></div>
const parentElement = document.getElementById("parentElement");
const element = document.createElement("div");
parentElement.insertBefore(element, parentElement.firstChild);
```
## Αφαίρεση Στοιχείων
Για να αφαιρέσουμε ένα στοιχείο από το DOM, μπορούμε να χρησιμοποιήσουμε τις παρακάτω μεθόδους:
- `removeChild()`: Αφαιρεί ένα στοιχείο από το DOM.
<!-- prettier-ignore -->
```javascript
// <div id="parentElement">
const parentElement = document.getElementById("parentElement");
const element = document.createElement("div");
parentElement.appendChild(element);
parentElement.removeChild(element);
```
- `remove()`: Αφαιρεί το στοιχείο από το DOM.
<!-- prettier-ignore -->
```javascript
// <div id="parentElement">
const parentElement = document.getElementById("parentElement");
const element = document.createElement("div");
parentElement.appendChild(element);
element.remove();
```
## Event Listeners
Για να προσθέσουμε ένα event σε ένα στοιχείο στο DOM, μπορούμε να χρησιμοποιήσουμε τη μέθοδο `addEventListener()`. Η `addEventListener()` παίρνει δύο ορίσματα: το όνομα του event και τη συνάρτηση που θα εκτελεστεί όταν συμβεί το event.
Ορισμένα από τα πιο συνηθισμένα events είναι:
- Mouse Events: click, dblclick, mousedown, mouseup, contextmenu, mouseout, mousewheel, mouseover
- Touch Events: touchstart, touchend, touchmove, touchcancel
- Keyboard Events: keydown, keyup, keypress
- Form Events: focus, blur, change, submit
- Window Events: resize, scroll, load, unload, hashchange
<!-- prettier-ignore -->
```javascript
// <button id="myButton">Click Me!</button>
const button = document.getElementById("myButton");
button.addEventListener("click", function() {
console.log("Button Clicked!");
});
```
Το παραπάνω παράδειγμα προσθέτει ένα event listener στο κουμπί. Όταν το κουμπί πατηθεί, τότε εκτελείται η συνάρτηση που είναι περασμένη ως δεύτερο όρισμα στη μέθοδο `addEventListener()`.
Μπορούμε επίσης να χρησιμοποιήσουμε τη μέθοδο `removeEventListener()` για να αφαιρέσουμε ένα event από ένα στοιχείο.
<!-- prettier-ignore -->
```javascript
// <button id="myButton">Click Me!</button>
const button = document.getElementById("myButton");
function handleClick() {
console.log("Button Clicked!");
}
button.addEventListener("click", handleClick);
button.removeEventListener("click", handleClick);
```
# Χρήσιμες Πηγές
- [You Don't Know JS](https://github.com/getify/You-Dont-Know-JS)
- [JavaScript.info](https://javascript.info/)
- [Free Programming JavaScript Books](https://github.com/EbookFoundation/free-programming-books/blob/main/books/free-programming-books-langs.md#javascript)
- [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript)
- [Eloquent JavaScript](https://eloquentjavascript.net/)
- [Optimizing Javascript](https://romgrk.com/posts/optimizing-javascript)
- [JavaScript Roadmap](https://roadmap.sh/javascript)
- [The Frontend Developer Handbook](https://frontendmasters.com/guides/front-end-handbook/2024/)
| 📖 Additional material for the University of Piraeus, dpt of Digital Systems, course: "Web and Mobile Information Systems" | javascript,language-guide,open-source-project | 2024-04-26T16:57:37Z | 2024-05-13T08:19:39Z | null | 1 | 0 | 18 | 0 | 0 | 15 | null | null | null |
armancodv/frontend-interview | main | # Frontend Interview Questions
Welcome to the Frontend Interview Questions repository! This repository aims to provide a comprehensive list of frontend interview questions to help you prepare for your next interview.
## Live Documentation
You can explore the live documentation here:
[Frontend Interview Questions](https://interview.armanko.com/)
## Issues
If you encounter any issues or have suggestions for improvement, please don't hesitate to report them [here](https://github.com/armancodv/frontend-interview/issues/new).
> Your contributions are invaluable! Feel free to contribute by creating a pull request for any reported issues or suggested enhancements.
> Before creating a new issue, please check the existing ones [here](https://github.com/armancodv/frontend-interview/issues) to avoid duplicates.
## Feedback
If you find this project helpful, consider showing your support by starring the repository. Your support motivates us to enhance and expand this project further. ❤️
## Contributing
We welcome contributions from everyone! Check out [contributing page](https://interview.armanko.com/about/contributing.html) to learn how you can contribute.
Alternatively, you can find the contributing guidelines [here](docs/about/contributing.md)
## Run Locally
To run this project locally, follow these simple steps:
1. Clone the project:
```bash
git clone https://github.com/armancodv/frontend-interview.git
```
2. Navigate to the project directory:
```bash
cd frontend-interview
```
3. Install dependencies:
```bash
yarn install
```
> If you don't have Yarn installed, you can download it [here](https://yarnpkg.com/).
4. Start the server:
```bash
yarn dev
```
5. Open [http://localhost:5173/](http://localhost:5173/) in your browser to see the result.
## License
This project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).
| This repository aims to provide a comprehensive list of frontend interview questions to help you prepare for your next interview. | javascript,react,typescript | 2024-03-23T17:15:35Z | 2024-04-15T15:55:52Z | 2024-04-15T15:55:52Z | 3 | 35 | 51 | 0 | 1 | 15 | null | null | TypeScript |
DIGOARTHUR/rfid-reader-input | main | <!---
doc: update README.md
---->
<!-------------------------------------------------->
<!------------------------------------ PROJECT BANNER-->
<!-------------------------------------------------->
<h1 align="center"> < RFIDReaderInput / > </h1>
<p align="center">
<!-------------------------------------------------->
<!---------------------PROJECT ICON-->
<!-------------------------------------------------->
<img src="https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/a6367195-e847-4157-bffb-5932d73bd076" alt="RFID-logo" width="150px" height="150px"/>
<br>
<br>
<i>Capture RFID reading from Your React app in an elegant and restricted way!!</i>
<br>
</p>
<br>
<br>
<!-------------------------------------------------->
<!------------------------------------SHIELDS PROJECT-->
<!-------------------------------------------------->
<div align="center">
![NPM Paackage](https://img.shields.io/npm/v/rfid-reader-input?color=brightgreen&label=NPM%20package&logo=NPM&logoColor=white)
![CodeFactor](https://img.shields.io/codefactor/grade/github/digoarthur/rfid-reader-input?color=brightgreen&label=Code%20Quality&logo=codefactor)
![GitHub](https://img.shields.io/github/license/digoarthur/rfid-reader-input)
</div>
<div align="center">
<img alt="ReactJS" width="50" height="50" src="https://github.com/DIGOARTHUR/github-automated-repos/assets/59892368/11fe7e24-b5d7-47bf-814a-c8d5855e7ca8"> ![ReactJS](https://img.shields.io/badge/-ReactJS-blue)
<img alt="ViteJS" width="50" height="50" src="https://github.com/DIGOARTHUR/github-automated-repos/assets/59892368/f85aeacd-cea4-4280-9096-194da03e758e"> ![Check](https://img.shields.io/badge/-ViteJS-violet)
<img alt="NextJS" width="50" height="50" src="https://github.com/DIGOARTHUR/github-automated-repos/assets/59892368/6b213e2e-213a-489d-bbda-1dec9dcda585"> ![Check](https://img.shields.io/badge/-NextJS-gray)
</div>
<br>
<br>
<!-------------------------------------------------->
<!------------------------------------QUICK START-->
<!--------------------------------------------------->
## 1. Installation
```shell
npm install rfid-reader-input
# or
yarn add rfid-reader-input
```
## 2. Using Component
```jsx
import { RFIDReaderInput } from 'rfid-reader-input'
...
<RFIDReaderInput
open={isOpenRFIDReaderInput}
onRequestClose={_handleCloseRFIDReaderInput}
handleCodeCardRFID={setCodecard}
/>
```
## 3. Connect RFID card reader
<div align="center">
<img alt="skills" width="480" src="https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/f12b6f8c-1943-4df5-9609-159e682e08ec">
</div>
## 4. Swipe the card on the reader
<div align="center">
![d20ac76d-b212-4730-955a-d6fa16efd887 (1) (1)](https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/1895e25c-a881-4148-be4e-a95bef1b5bd3)
</div>
<br>
<br>
<br>
<br>
<!-------------------------------------------------------------------->
<!------------------------------------SUMMARY------------------------->
<!--------------------------------------------------------------
<p align="center">
<a href="https://github.com/DIGOARTHUR/how-to-build-NPM-package/tree/main#--sobre-a-aplicação">About Aplication</a> |
<a href="https://github.com/DIGOARTHUR/how-to-build-NPM-package#--configurando-ambiente"> Library</a>
</p>
------>
<!-------------------------------------------------->
<!------------------------------------DESCRIPTION-->
<!-------------------------------------------------->
# <img alt="skills" width="40" height="40" src="https://user-images.githubusercontent.com/59892368/148622497-164365e8-f6b0-4f40-bc75-a0ed4da6059b.png"> About Library <!---write here : talk a little about project: what's does, example. -->
> This library has a React component, <RFIDReaderInput/>, to facilitate data entry while reading from your RFID device. Use in your Dashboard systems to control presence, record processes linked to people, etc.
## Advantages
- Component already made. Install, import and use.
- Void capturing digits from the keyboard.
- Intuitive and customizable layout
| RFIDReaderInput |
| :-------------------------------------------------------------------: |
| ![image](https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/97a940b0-21d2-4bb0-8fcc-79c8e98919b4) |
<br>
<br>
<br>
<!-------------------------------------------------->
<!------------------------------------LIBRARY -->
<!-------------------------------------------------->
# <img alt="skills" width="80" height="30" src="https://user-images.githubusercontent.com/59892368/216092858-a64d3a99-1b90-4946-b917-76eadefffb54.svg"> Library <!---write here : demonstration of the application layout. -->
## Import
```jsx
import { RFIDReaderInput } from 'rfid-reader-input'
```
## Component
```jsx
<RFIDReaderInput
open={isOpenRFIDReaderInput}
onRequestClose={handleClose}
handleCodeCardRFID={setCodecard}
textTitle='RFID Identification'
textBody='Hold your card'
/>
```
#### Props
> [!IMPORTANT]
> For the component to work, insert the properties correctly. You can follow the code example.
- (_mandatory_) `open` < boolean > : here a variable with the value of false or true is inserted to open the Input.
- (_mandatory_) `onRequestClose` < ( ) => void > : receives a function to change the variable to the true state, closing the Input.
- (_mandatory_) `handleCodeCardRFID` < (code: string) => void > : Here a function is inserted that will receive the value captured from the reading device. It can be a state function coming from the parent component, or from a contextAPI.
- (_optional_) `textTitle`: < string > : text to change the card title.
- (_optional_) `textBody`: < string > : text to change the card body.
<br>
<br>
<!-------------------------------------------------->
<!------------------------------------CODE EXAMPLE -->
<!-------------------------------------------------->
# Code Example
<!-------------------------------------------------
### Download Template
```npm
```
<!-------------------------------------------------->
> [!NOTE]
> Structured code in ViteJS <img alt="skills" height="30" src="https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/32fd8a60-654d-4b60-8f31-19f5cc715ca1">
### Template Online
[https://template-rfid-reader-input.vercel.app](https://template-rfid-reader-input.vercel.app)
### Code
#### <a href="https://typicode.github.io/husky/#/"><img alt="Javascript" width="35" height="35" src="https://user-images.githubusercontent.com/59892368/210762527-ae3afe1f-fe36-46a9-98ad-35dbae4d1adf.svg"><a/> <a href="https://typicode.github.io/husky/#/"><img alt="Javascript" width="35" height="35" src="https://user-images.githubusercontent.com/59892368/219095611-551d532a-30fc-4873-b00e-0a8bbf8bb5ec.svg"><a/>
```jsx
import { useState } from 'react'
import './App.css'
import { RFIDReaderInput } from 'rfid-reader-input';
function App() {
//CSS EFFECT
const [isHover, setIsHover] = useState(false);
const handleMouseEnter = () => {
setIsHover(true);
};
const handleMouseLeave = () => {
setIsHover(false);
};
const boxStyle = {
filter: isHover ? 'drop-shadow(0 0 5em #617874ee)' : ''
};
//RFIDReaderInput State
const [serialCard, setSerialcard] = useState('');
const [openCardReaderWindow, setOpenCardReaderWindow] = useState<boolean>(false)
function handleOpenRFID() {
setOpenCardReaderWindow(true);
}
function handleCloseRFID() {
setOpenCardReaderWindow(false);
}
return (
<>
<div>
<RFIDReaderInput isOpen={openCardReaderWindow} onRequestClose={handleCloseRFID} handleCodeCardRFID={ setSerialcard} />
<a href="https://github.com/DIGOARTHUR/rfid-reader-input" target="_blank">
<img src='https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/a6367195-e847-4157-bffb-5932d73bd076'
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
style={boxStyle} alt="React logo"
/>
</a>
</div>
<h1>{serialCard?serialCard:'‹ RFIDReaderInput /›'}</h1>
<div className="card">
<button onClick={handleOpenRFID}>
Open RFIDReaderInput
</button>
<p>
Edit <code>src/App.tsx</code> and save to test
</p>
</div>
<p className="read-the-docs">
Click on the RFIDReaderInput logo to learn more
</p>
</>
)
}
export default App
```
---
**Love rfid-reader-input? Give our repo a star ⭐ ⬆️.**
`by`: [@digoarthur](https://www.linkedin.com/in/digoarthur/)
`buy rfid reader device`: [rfid reader device](https://pt.aliexpress.com/item/1005006223111716.html?spm=a2g0o.productlist.main.9.298dlG1PlG1Pcy&algo_pvid=1cdd1d61-b417-4c92-adad-21983a1f853c&aem_p4p_detail=2024040608001417840825173963440008723047&algo_exp_id=1cdd1d61-b417-4c92-adad-21983a1f853c-4&pdp_npi=4%40dis%21EUR%2111.30%218.47%21%21%2186.59%2164.94%21%402101e62517124156146654903ebec3%2112000036353233564%21sea%21PT%21738581998%21&curPageLogUid=OYyStQk6kG9U&utparam-url=scene%3Asearch%7Cquery_from%3A&search_p4p_id=2024040608001417840825173963440008723047_1)
| Connect your RFID reader and already have a component to capture the value. | component,javascript,library,npm,reactjs,rfid-reader | 2024-03-30T11:44:43Z | 2024-05-11T15:27:26Z | null | 1 | 0 | 34 | 0 | 1 | 15 | null | MIT | TypeScript |
ErickWendel/cypress-for-begginers | main | # Example of how to run e2e and unit tests on serverless apps using LocalStack and Jest
[![Cypress Tests - Complete Project](https://github.com/ErickWendel/cypress-for-begginers/actions/workflows/cypress-complete-project.yml/badge.svg)](https://github.com/ErickWendel/cypress-for-begginers/actions/workflows/cypress-complete-project.yml)
[![Cypress Tests - In Class Project](https://github.com/ErickWendel/cypress-for-begginers/actions/workflows/cypress-in-class-project.yml/badge.svg)](https://github.com/ErickWendel/cypress-for-begginers/actions/workflows/cypress-in-class-project.yml)
Hi this is the repo containing code examples and challenges of my video on [Cypress for begginers - Creating e2e tests on frontend apps](https://bit.ly/mini-curso-cypress).
**First leave your star in the repo 🌟**
![Mini curso de Cypress para Iniciantes (1)](https://github.com/ErickWendel/cypress-for-begginers/assets/8060102/b898d7e2-d1bf-4210-a0d0-6e0e7f3dca7f)
There are two folders. In the [./in-class-project](./in-class-project) you''ll find the examples shown in class and challenges and on [./complete-project](./complete-project) the final project containing the answers of the challenge
The CI output of the solved challenges will look like below:
![ci print results](./ci-print.png)
| Examples and challenges of how to create e2e tests for frontend apps | bdd,behavior-driven-development,cypress,e2e-testing,github-actions,javascript,nodejs | 2024-04-05T21:09:42Z | 2024-04-09T13:08:58Z | null | 1 | 0 | 13 | 0 | 5 | 15 | null | null | JavaScript |
huanyingtianhe/EasyComfyUI | main | # Introduction
ComfyUI is the most powerful and modular stable diffusion GUI and backend. But it is not easy to use, and has a high learning curve. We build Apps
based on the workflows, and provide several interfaces, like input prompt, upload image, upload video. You do not need
to take care of the workflow details, what is your focus is only your content. We plan to
provide follow functionalities, but we only support "Text to image" and "Video to video" so far:
- Text to Image, Text to Video
- Image to Image, Image to video
- Video to video
We also support upload workflow to customize your app now, you can specify the parameters in your app at the same time.
## Roadmap
- [x] Base Text to image
- [x] DB model
- [x] Login and register
- [x] Add App
- [x] Video to video
- [x] Customize App to support parameters
- [x] Support vercel
- [ ] Add limitation for free users
- [ ] Add settings in UI
- [ ] Adapt to mobile devices
- [ ] Select model
- [ ] Select styles
- [ ] Text to video
- [ ] Image to video
# Screenshot
Home Page:
![home](https://github.com/huanyingtianhe/EasyComfyUI/assets/5997003/aa4ec2a8-bd96-44d9-8819-c2f7b3337454)
Apps Page:
![apps](https://github.com/huanyingtianhe/EasyComfyUI/assets/5997003/37bc33e9-96fb-436d-9c2f-da10fef03cb1)
Live demo:
[EasyComfyUI: 更容易上手的ComfyUI-哔哩哔哩](https://b23.tv/NTaFyoV)
# Install
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Prepare env file
Rename the env.template to .env, and fill in the value with your own. The first part is related with Auth, you do not need to take care at first. What you need to notice is the second section. ComfyUI_BASE_ADDRESS is the url of your ComfyUI service, no matter it is local or remote. We can get the DATABASE_URL following the steps described below.
## Prepare DB
If you already have a mysql instance, copy the mysql connection string, it is what DATABASE_URL variable need, and skip the section "Setup Mysql Instance".
### Setup Mysql Instance
Install Mysql in your machine if you do not have a mysql instance. The question is how to setup the mysql instance?
It is easy, just switch to the root folder of the project in command line tool, then run the command:
```bash
sudo docker compose up -d
```
It requires you install the docker, docker-compose and mysql in your machine. After the execution, it will create a mysql instance and a database named "easy_comfyui", you can connect it with below command:
```bash
mysql -h 127.0.0.1 -P 3306 -u root -p
```
The format of the connection string for a local mysql instance looks like this:
```bash
"mysql://root:password@localhost:3306/easy_comfyui"
```
## How to use Prisma
Then we need to create the table in the db instance, we use Prisma to help us do that. Prisma ORM is an open-source next-generation ORM. For development, you only need to run following commands, it will create tables and keys in your database.
```bash
yarn install
npx prisma migrate dev --name init
```
You can find more in the following documents:
[Getting started](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-node-mysql)
[CRUD document](https://www.prisma.io/docs/orm/prisma-client/queries/crud#read)
## Start the Website
Then, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
| An UI to integrate with ComfyUI backend for easy use | ai,comfyui,javascript,nextjs,nextjs14,stable,stable-diffusion,website | 2024-04-06T14:45:53Z | 2024-05-19T14:59:11Z | null | 2 | 0 | 45 | 1 | 1 | 14 | null | MIT | JavaScript |
glenau/awesome-backend | main | CLI tool for creating a backend with [Node.js](https://nodejs.org).
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-downloads-url]
[![NPM License][npm-license-image]][npm-license-url]
## Getting Started
This is a Node.js module available through the npm registry.
Before installing, [download and install Node.js](https://nodejs.org/en/download). Node.js 18 or higher is required.
### Installation
1. Run script package
```sh
npx awesome-backend
```
2. Select backend options
3. Start the project
```sh
npm start
```
## Changelog
For a detailed list of changes in each version, please refer to the [CHANGELOG](CHANGELOG.md) file.
## Roadmap
- [x] Databases
- [x] [MongoDB (Mongoose)](https://www.npmjs.com/package/mongoose)
- [x] [PostgreSQL (Sequelize)](https://www.npmjs.com/package/sequelize)
- [ ] Servers/Frameworks
- [x] [Express](https://www.npmjs.com/package/express)
- [ ] [NestJS](https://www.npmjs.com/package/@nestjs/core)
- [ ] [Koa](https://www.npmjs.com/package/koa)
- [ ] Tools
- [x] [PM2](https://www.npmjs.com/package/pm2)
- [x] [Docker](https://www.docker.com/)
- [x] [Compression](https://www.npmjs.com/package/compression)
- [ ] [TypeScript](https://www.npmjs.com/package/typescript)
- [ ] [WebSockets](https://www.npmjs.com/package/ws)
- [ ] [Redis](https://www.npmjs.com/package/redis)
- [x] Logging
- [x] [Pino + Pino-pretty](https://www.npmjs.com/package/pino)
- [x] Documentation
- [x] Installation and configuration
- [x] API Specification
- [x] Technical part
See the [open issues](https://github.com/glenau/awesome-backend/issues) for a full list of proposed features (and known issues).
## License
Distributed under the [MIT](LICENSE) License.
[npm-url]: https://npmjs.com/package/awesome-backend
[npm-version-image]: https://badgen.net/npm/v/awesome-backend
[npm-downloads-image]: https://badgen.net/npm/dw/awesome-backend
[npm-downloads-url]: https://npmcharts.com/compare/awesome-backend?minimal=true
[npm-license-image]: https://badgen.net/npm/license/awesome-backend
[npm-license-url]: LICENSE
## Contact
- [Support](mailto:glenaudev@gmail.com)
- [NPM](https://www.npmjs.com/package/awesome-backend)
- [GitHub](https://github.com/glenau/awesome-backend)
| CLI tool for creating a backend with Node.js. | backend,javascript,nodejs,cli | 2024-03-30T15:31:31Z | 2024-04-15T14:49:53Z | 2024-04-15T14:49:53Z | 1 | 5 | 40 | 0 | 0 | 14 | null | MIT | JavaScript |
charliegerard/fem-ml-workshop | main | # Machine Learning in JavaScript - workshop for FrontEnd Masters
Check out the [course website](https://fem-ml-workshop.netlify.app)
## Workshop projects
The workshop projects can be found in the `exercises` folder. Each exercise has a README file with instructions on how to run it.
You will find empty files called `part1.js`, `part2.js`, etc. for each sub project in which you should write your JavaScript code as you go through the workshop.
## Projects' solutions
There is a `solutions` folder with the solution to each exercise if you need to see the completed project at any time. This folder contains all the code written during the workshop.
You will also find a folder called `solutions-old` that contains the original code I was planning on writing in the workshop if you want to have a look. It is very close to what we ended up doing during the course, only with a few little adjustments, such as more layers in the custom model.
| Repository for my FrontEnd Masters workshop on Machine Learning in JavaScript | ai,javascript,machine-learning,tensorflowjs | 2024-04-08T21:13:50Z | 2024-04-19T20:12:55Z | null | 1 | 0 | 11 | 0 | 13 | 13 | null | null | JavaScript |
anguishjs/anguish | main | # Anguish.js
Anguish is a **2.4kB** (**1.2kB** gzipped, fyi) reactive framework, similar to Vue and Alpine. No VDOMs, and no
compilation needed!
``` html
<script src="//unpkg.com/anguishjs" defer></script>
<div x-data="{ count: 0 }">
<button @click="count++">Click me!</button>
<span x-text="count"></span>
</div>
```
- `x-data` defines the component’s data…
- `@click` updates `count` every click…
- `x-text` sets the `span`’s text…
Easy as! Just add the script tag in your `<head>`, and you can use components anywhere in the markup.
## Features
- 12 directives implemented: `x-data`, `x-name`, `x-text`, `x-html`, `x-show`, `x-bind`/`:bind`, `x-prop`/`.prop`,
`x-on`/`@event`, `x-model`, `x-ref`, `x-init` & `x-effect`
## Using components
As shown, `x-data` creates an inline component with the given scope. It’ll be rendered exactly where it is (rendering is
a bit misleading, everything is done in-place), and you can nest it as many times as you’d like.
It’s also not necessary to use an object literal, if things get too clumsy, you can move your data to a script:
``` html
<script>
const myApp = () => ({
size: 36,
topText: "Top text",
bottomText: "Bottom text",
});
</script>
<main x-data="myApp()">...</main>
```
There are no limitations on which types can be used, and you can even have functions and getters:
``` html
<div x-data="{
count: 0,
increment() {
count++
},
get square() {
return count ** 2
},
}">
...
</div>
```
Anguish is purely DOM-based. As such, you might find it weird that you don’t have something like an `x-for`, however,
named components render to simple elements which you can use!
``` html
<!-- this is a component! -->
<template x-name="item">
<li><span x-text="title"></span></li>
</template>
<input @change="list.append(item({ title: value }))" placeholder="Add an item...">
<ul x-ref="list"></ul>
```
Adding `x-name` to a `<template>` tag exposes a function with it’s name.
Anguish also features DOM reactivity – code that uses elements from `x-ref`s will automatically update when components
are added inside it are added inside it. You can access the component’s data through the `$data` property, which
contains everything in it’s scope.
Note that removing an element will not unmount the component. For that, `$unmount()` is available in the component’s
scope.
| The Regressive JavaScript framework | frontend,javascript,reactive,ui | 2024-04-11T22:25:45Z | 2024-05-20T10:52:38Z | 2024-04-24T21:00:59Z | 1 | 1 | 34 | 0 | 0 | 13 | null | Apache-2.0 | TypeScript |
sovenor/bitcoin-rocks | main | # bitcoin.rocks
## Mission
The mission of bitcoin.rocks is to accelerate Bitcoin adoption through education.
We accomplish this with several free resources:
- [An educational website](https://bitcoin.rocks) designed for people who are new to Bitcoin.
- [Bitcoin Stickers](https://bitcoin.rocks/stickers) that enable you to leave an orange pill in public.
- [Bitcoin Postcards](https://bitcoin.rocks/postcards) that enable you to orange pill someone you know via snail mail.
- [Bitcoin Business Kits](https://bitcoin.rocks/business/kit) that enable you to get a local business to accept bitcoin payments.
## Website Overview
bitcoin.rocks is an educational website designed for people who are new to bitcoin. The website was founded in 2022 as a "first link" to send to people who ask you about bitcoin.
The main focus of the website is [the homepage](https://bitcoin.rocks) which links out to a variety of internal and external sources depending on the user's interests.
You can view the website here: https://bitcoin.rocks
## Website Architecture
The website is written in raw HTML / CSS / JS. This eliminates the burden of a CMS.
All text content is localized using jquery.i18n translation strings. You can see which translations are in progress in the [Translations forum.](https://github.com/sovenor/bitcoin-rocks/discussions/categories/translations) The website will dynamically serve the proper content depending on the user's browser language.
The Apache server handles redirects and removing ".html" from the end of links in a simple .htaccess file. The latest merged code is uploaded on https://bitcoin.rocks
## License
This project is licensed under the MIT License. You are free to take any of the content within and use it for your own purposes. The goal is to make the project more public and open over time.
## Contribute
You can contribute to bitcoin.rocks even if you aren't a programmer! We currently have a strong focus on translations, but there are many ways you can help accelerate Bitcoin adoption.
Please read our [Contributor Guide](https://github.com/sovenor/bitcoin-rocks/blob/main/CONTRIBUTING.md) to learn more.
| bitcoin.rocks is an educational website designed for people who are new to bitcoin | bitcoin,education,css,html,javascript,open-source,translation,translations,i18n | 2024-04-02T15:23:47Z | 2024-05-23T14:21:11Z | null | 6 | 13 | 110 | 2 | 7 | 12 | null | MIT | HTML |
ronin-co/client | main | # RONIN Client
[![Tests](https://github.com/ronin-co/client/actions/workflows/validate.yml/badge.svg)](https://github.com/ronin-co/client/actions/workflows/validate.yml)
[![Install Size](https://packagephobia.com/badge?p=ronin)](https://packagephobia.com/result?p=ronin)
This package allows for querying data from [RONIN](https://ronin.co) with ease.
## Setup
First, install the [package](https://www.npmjs.com/package/ronin) with a package manager of your choice:
```bash
# Bun
bun add ronin
# npm
npm install ronin
```
Next, create a new app token on the [RONIN dashboard](http://ronin.co) (under "Apps" in the sidebar), and add it as a environment variable named `RONIN_TOKEN` to your project.
Afterward, you can start invoking RONIN from anywhere in your code:
```typescript
import { get } from 'ronin';
const posts = await get.posts();
```
That's it! 🎉
You can now start inserting records with the [RONIN query syntax](https://ronin.co/docs/queries), or add them on the [RONIN dashboard](http://ronin.co). Everything you can do with the RONIN client, you can also do on the dashboard (creating records, retrieving them, filtering them, updating them, etc).
## Contributing
We would be excited to welcome your suggestions for the RONIN client!
To start contributing code, first make sure you have [Bun](https://bun.sh) installed, which is a JavaScript runtime.
Next, [clone the repo](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) and install its dependencies:
```bash
bun install
```
Once that's done, link the package to make it available to all of your local projects:
```bash
bun link
```
Inside your project, you can then run the following command, which is similar to `bun add ronin` or `npm install ronin`, except that it doesn't install `ronin` from npm, but instead uses your local clone of the package:
```bash
bun link ronin
```
If your project is not yet compatible with [Bun](https://bun.sh), feel free to replace all of the occurances of the word `bun` in the commands above with `npm` instead.
You will just need to make sure that, once you [create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request) on the current repo, it will not contain a `package-lock.json` file, which is usually generated by npm. Instead, we're using the `bun.lockb` file for this purpose (locking sub dependencies to a certain version).
### Developing
In order to be compatible with a wide range of projects, the source code of the `client` repo needs to be compiled (transpiled) whenever you make changes to it. To automate this, you can keep this command running in your terminal:
```bash
bun run dev
```
Whenever you make a change to the source code, it will then automatically be transpiled again.
### Running Tests
The RONIN client has 100% test coverage, which means that every single line of code is tested automatically, to ensure that any change to the source code doesn't cause a regression.
Before you create a pull request on the `client` repo, it is therefore advised to run those tests in order to ensure everything works as expected:
```bash
# Run all tests
bun test
# Alternatively, run a single test
bun test -t 'your test name'
```
| Access RONIN via TypeScript. | bun,client,data,javascript,js,library,node,nodejs,query,ts | 2024-04-26T11:46:01Z | 2024-05-14T16:07:44Z | 2024-05-14T16:07:44Z | 5 | 29 | 34 | 0 | 0 | 12 | null | Apache-2.0 | TypeScript |
gaeljacquin/media-downloader | main | <h1 align="center">
<img src="public/images/splashscreen.png" width="510" alt="Media Downloader logo" />
<br>
Media Downloader
<br>
[![publish](https://github.com/gaeljacquin/media-downloader/actions/workflows/publish.yml/badge.svg)](https://github.com/gaeljacquin/media-downloader/actions/workflows/publish.yml)
</h1>
<h3 align="center">
GUI for <a href="https://github.com/yt-dlp/yt-dlp/">yt-dlp</a>
</h3>
## Features
- Cross platform
- Modern UI
- Dark mode
- Console logs
- Hide in system tray
- *__And more to come...__*
## Screenshots
![](/screenshots/win11_1.png)
![](/screenshots/win11_2.png)
![](/screenshots/win11_3.png)
![](/screenshots/win11_4.png)
![](/screenshots/win11_5.png)
## Instructions
### Install
1. Head over to [Releases](https://github.com/gaeljacquin/media-downloader/releases)
2. Add [yt-dlp](https://github.com/yt-dlp/yt-dlp/) to PATH
3. Add [FFmpeg](https://ffmpeg.org/download.html) to PATH (optional)
### Build
1. Clone the repository
2. Add [yt-dlp](https://github.com/yt-dlp/yt-dlp/) to PATH
3. Add [FFmpeg](https://ffmpeg.org/download.html) to PATH (optional)
4. Install other [prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites/)
5. Run the build command
## Important Notes
**Builds and installers were (so far) only tested on Windows 11.**
| Cross-platform audio/video downloader | tauri,nextjs,react,tailwindcss,typescript,javascript,rust | 2024-03-26T02:25:49Z | 2024-05-21T22:05:08Z | null | 1 | 15 | 78 | 0 | 1 | 12 | null | GPL-3.0 | TypeScript |
minseok128/2020-SwipeBrickBreaker-JS | main | # Swipe Brick Breaker from 2020
<div>
<image src="./readme/title_img.png" width=400 />
<image src="./readme/play0.png" width=400 />
</div>
## How to play
### [Play](https://minseok128.github.io/2020-SwipeBrickBreaker-JS/)
### [Play](https://minseok128.github.io/2020-SwipeBrickBreaker-JS/)
### [Play](https://minseok128.github.io/2020-SwipeBrickBreaker-JS/)
```bash
git clone https://github.com/minseok128/2020-SwipeBrickBreaker-JS
cd 2020-SwipeBrickBreaker-JS
open index.html
# or double click index.html
```
> <div>
> <image src="./readme/play3.gif" width=300 />
> <image src="./readme/play2.gif" width=300 />
> </div>
## 대체 이게 뭐죠?
때는 **2020년, 공군 일병이었던 20살의 나는** 본부 직할의 어느 한 부대에서 행정직을 수행하고 있었다.
18인치의 낡은 모니터와 컴퓨터를 앞에 두고 기본적인 행정 업무를 수행하는 것이 나의 일상이었다. 여기에 사소하다 못해 귀여운 개발 업무를 추가로 맡게 되었는데, 그 중 하나가 바로 부대 입구에 있는 (아마도 세상에서 가장 외로운) 키오스크를 개발하고 유지 보수하는 것이었다.
그러나 이 작은 업무 덕분에(!) `notepad++`라는 이름의 프로그램과 폐쇄망 인트라넷 접속이 가능한 크롬 브라우저를 자유롭게 사용할 수 있었다. 크롬의 `V8 엔진` 위에서 `Javascript`를 마음껏 컴파일할 수 있는 환경이 마련되었으니…
업무와 업무 사이의 틈을 적극적으로 활용하여 당시 처음 접했던 객체지향 설계를 공부하고자 `VanillaJS + canvas`를 사용한 작은 게임을 제작하기로 결심했다.
> <image src="./readme/notepad.png" width=400 />
>
> 기본적인 문법 검사 정도만 지원했던 당시의 notepadd++
### 시작은 반이고, 가만있으면 반은 간다?!
나의 첫 도전은 **만만한** 알카노이드like 게임이었다. 게임을 만들어 본 적도 없고, `JS` 초짜인 내가 만들어낸 게임은 정말 형편없었다. 옆 사무실의 모 일병의 혹평과 함께 첫 게임은 이틀만에 쓸쓸한 은퇴의 길을 걷게 된다.
> <image src="./readme/mini_game.png" width=400 />
>
> 망한 나의 첫 게임이 지향한 알카노이드
그럼에도 실패에 굴할 수 없다. 근무 후 시간을 활용해 싸지방에서 개발 유튜브를 이리저리 찾아보았다. 그러던 중 나에게 게임의 가장 중요한 요소가 무엇인지 고민하게 되는 영상을 찾았으니, 해당 유튜버의 영상들은 게임 자체에 대한 영상은 아니었지만, 원초적 재미의 기반이 되는 움직임(animation)에 대한 정석을 배울 수 있었다. 나는 비로소 나의 첫 게임은 재미없는 움직임에 때문에 망했음을 파악했다. 그리고 플레이하기 좋고 지켜보기도 좋은 역동적인 게임을 꿈꾸게 되었다.
> 나의 영원한 영감 [interactive developer](https://www.youtube.com/@cmiscm)
>
> <image src="./readme/youtube.png" width=400 />
>
> 좋은 움직임이란 무엇인지, 어떻게 구현할 수 있는지에 대한 수많은 예시들
### 개발 시작, 작은 목표
평소 존경하던 게임 개발자의 **스와이프 벽돌깨기**라는 이름으로 알려진 유명한 모바일 게임의 시스템을 클론하기로 결정했다. 추가로 더 많은 상호작용 요소와 보너스 요소를 더해 풍부한 게임을 만드는 것을 목표로 본격적인 개발에 임했다.
> <image src="./readme/real_swipe.png" width=400 />
>
> [스와이프 벽돌깨기] 우리의 지루한 지하철을 책임지던 게임
당시 공군 인트라넷에는 이미 몇몇 은둔 개발자들이 개발한 게임으로 가득차 있었다. 테트리스부터 스도쿠, 2048, 심지어는 연애 시뮬레이션 같은 게임들이 떠돌고 있었는데, 이는 전국의 수많은 당직 근무자에게 심심한 위로가 되었다.
그 의문의 게임들은 하나같이 그 출처와 개발된 날짜조차 분명하지 않았지만, 그것이 오히려 장점이 되어, 수많은 고수의 리팩토링을 거친 **궁극의 오픈소스 프로젝트**가 되었다. 나는 나의 게임도 언젠가 그들과 같은 위치에 서서 **오랜 역사의 기원이** 되기를 기대하며 코드를 한 줄씩 써 내려간 것이다.
약 3개월의 기간 동안, 틈틈이 코드를 작성했다. 개발하는 과정에서 어쩔 수 없이 질리도록 많은 시간 플레이했는데, 어느 순간에는 나만큼 이 게임을 잘하는 사람을 찾을 수 없으리라는 생각에 빠졌다. 하지만 추후 게임이 널리 배포되고, 나보다 높은 점수를 차지한 많은 사용자의 자랑하는 메일 폭탄을 받게 되니, 나는 나의 오만을 깨달았다.
몇번의 업데이트를 거쳐 **0.1.4** 버전이 2021년도에 완성되었고, 추후 더 이상의 개발은 진행되지 않았다.
> <image src="./readme/tmp_title.png" width=400 />
>
> [당시의 메인 화면으로 추측] 나의 노트 속에서 발견된 싸지방에서 급조한 메인 화면 프로토타입 이미지
### 파급효과
완성된 게임은 순수 `HTML + CSS + JS`만으로 작성되었기에 설치가 쉽고, 군대의 폐쇄망 특성상 망 내의 모든 컴퓨터에 설치된 동일한 환경(동일 버전의 크롬 브라우저)에서 구동되었다. 그 덕분에 빠르게 인기를 얻고 병사들 사이에서 퍼져 나가게 되었다. 말년에는 해당 게임에 대한 유명세에 힘입어 생활관 내에서 진행하는 작은 개발 컨퍼런스에서 발표도 했다. 다음 게임 제작에 대한 무수한 요청을 받았던 기억이 있다.
전역을 하고 난 이후에도 해당 게임은 널리 널리 퍼져 나갔던 것 같다. 후임으로부터 해당 게임의 캡처 이미지가 공군본부 인트라넷 홈페이지 공지사항에 `근무 중 부적절한 프로그램 사용 금지`라는 타이틀과 함께 올라왔다는 소식을 듣게 되었다.
대대적으로 공개된 게임의 캡처 이미지와 금지 문구는 오히려 호기심을 자극하는 노이즈 마케팅 효과를 일으켰을 것이다. 결국, 어떤 식으로든 나의 작은 꿈이 이루어졌음을 알 수 있었다. 그리고 이미 전역했다는 사실에 밀려오는 **안도감!!**
> <image src="./readme/play1.gif" width=400 />
>
> 희망 발사!
### 결론
2024년에 과거 노트의 내용을 뒤져가며, 다시 한 번 해당 게임을 구현한 이유는 다음과 같다.
언젠가 나의 기숙사 룸메이트가 고등학교 동창인 휴가 나온 공군 친구를 소개해준 적이 있다. 나는 전역한 지 1년이 다 되어가는 상황이었지만, 군 생활의 작은 에피소드들을 나누며 공감대를 형성할 수 있었다.
그러다 설마 하는 마음으로 나의 벽돌깨기 게임을 열심히 묘사하며, 혹시라도 그런 게임을 해본 적이 있는지 물어보았다. 그때, 그 공군 친구는, 자신이 그 게임의 열렬한 플레이어라고 이야기했고, 해당 게임의 제작자를 실제로 만났다는 사실에 꽤나 신나보였다. 나는 다시 한번 사회에서 그 게임을 구현하고자 마음먹었다. 열정 넘치던 20살 일병의 마음으로.
결국 미루고 미루다 약 4년이 지난 현 시점에서 당시의 미숙한 느낌까지 최대한 모두 살려서 해당 게임을 구현하는 데 성공했다. 과거의 코드 자체와 **98%** 이상의 일치율을 목표로 했기에, 혹시라도 코드를 읽는다면 이 점을 꼭 이해해주시길...!
### 진짜 결론
1,000줄을 넘는 코드를 다시 작성했지만, 그 어떤 리팩토링과 개선도 수행하지 않았다.
`asset/app.js` 파일을 열고 조금만 둘러보면 눈치챌 수 있을 것이다. 이 게임은 어떠한 객체 지향 설계 원칙도 준수하지 못했으며, 수많은 비효율을 야기하는 반복문과 쓸모없는 객체 복사 생성이 무분별하게 존재하고, 기이한 조건문들과 심지어 선언 및 할당 후 단 한 번도 사용하지 않는 인스턴스도 넘쳐난다.
부족했던 실력 탓도 크지만, 어쨌든 이 게임은 휴대폰도 인터넷 검색도 아예 존재하지 않는 그런 어둠 속에서 탄생한 것이다. 매일 석식을 먹은 후 싸지방에서 게임의 작은 기능을 하나씩 구현해보고, 그 결과물을 프린트하거나 노트에 직접 옮겨 적은 것을 소중히 챙겼다. 그리고 근무 중 짧은 쉬는 시간을 이용하여 작은 퍼즐 조각을 맞추듯 애써 완성했다. **나는 왜 그랬을까?**
반드시 구현해내겠다는 그 집념, 이 게임을 다시 쓰면서 그 열정을 되찾고 싶었다.
---
**ps. 사랑하는 나의 후임 김병장님께 감사를...!**
**pps. 이 게임을 재밌게 즐겨준 공군 출신들에게 감사를...!** | Addictive online brick-breaker game. | game,javascript,web,webapp | 2024-04-04T15:39:09Z | 2024-04-07T16:46:19Z | 2024-04-07T11:39:24Z | 1 | 0 | 40 | 2 | 0 | 12 | null | null | JavaScript |
vontanne/mnist-model-parameters | master | # MNIST Model Parameters
This repository provides pre-extracted weights and biases from a model trained on the MNIST dataset, specifically designed for handwritten digit recognition. The parameters are formatted in JavaScript (JS) to facilitate seamless integration into web applications or any JavaScript-based project.
## Overview
The MNIST ("Modified National Institute of Standards and Technology") dataset is a cornerstone in the field of machine learning, providing a large set of handwritten digits for training image processing systems. This repository leverages a Convolutional Neural Network (CNN), trained on the MNIST dataset using PyTorch, to offer a ready-to-use set of model parameters.
## Features
- **Pre-Extracted Parameters**: Includes weights and biases for three layers of the CNN, stored in separate JS files for ease of use.
- **JavaScript Compatibility**: Parameters are provided in a JavaScript-friendly format, enabling straightforward integration with web technologies.
- **High Performance**: The model architecture and training have been optimized to achieve high accuracy on digit recognition tasks.
## Repository Structure
- `/weights`: Contains JS files (`weightsLayer1.js`, `weightsLayer2.js`, `weightsLayer3.js`) with the model's layer-specific weights.
- `/biases`: Includes JS files (`biasesLayer1.js`, `biasesLayer2.js`, `biasesLayer3.js`) with the biases for each corresponding model layer.
- `LICENSE`: The MIT License file detailing the terms under which the repository's contents can be used.
## Getting Started
To integrate the MNIST model parameters into your project, simply include the relevant JS files from the `/weights` and `/biases` directories in your application. Detailed instructions and examples of how to use these parameters within your projects are forthcoming in future updates to this repository.
## Performance Metrics
The model achieves an accuracy of 98.7% on the MNIST test set, making it highly reliable for digit recognition tasks. Additional metrics such as precision, recall, and F1 score are also indicative of the model's robust performance.
## License
This project is released under the MIT License, which provides extensive freedom for reuse within your own projects, subject to the original copyright notice and license agreement. See the [LICENSE](./LICENSE) file for full details.
Stay tuned for further updates and enhancements to this repository!
| Trained weights and biases for a PyTorch model on the MNIST dataset, aimed at handwritten digit recognition | handwritten-digit-recognition,javascript,machine-learning,neural-network,pytorch | 2024-03-26T16:54:18Z | 2024-03-26T18:53:27Z | null | 1 | 0 | 4 | 0 | 0 | 12 | null | MIT | JavaScript |
No-Country/s14-17-t-java | develop | <div align="center">
<h2>☕️ TeamScore | S14-17-T-Java ⚛️</h2>
</div>
<img width="1536" alt="Screenshot 2024-02-29 at 15 14 59" src="https://res.cloudinary.com/djtzqnrmy/image/upload/v1712348958/S14-17-T-Java/assets/vckd880rb2cs0g0bhyy2.png">
## 📕 Descripción del proyecto
Nuestra aplicación es una herramienta parametrizable, para poder dar feedback a miembros de grupos, calificando a los mismos sobre ciertos valores, también parametrizables, desde sus mínimos y máximos, posibilidad de escribir comentarios, etc.
Toda la parametrización se efectúa desde un tablero de control, donde los datos escenciales son gestionables desde el mismo, mientras que lo que pueda ser masivo y repetitivo, puede importarse desde un archivo de Excel.
En base a la parametrización, el sistema permitirá el acceso en las fechas indicadas a los valoradores, que recibirán en su email un enlace para activar su cuenta y generar la clave de inicio de sesión. Pasado el rango de fechas especificado, no podrá realizar más feedback.
Una vez habilitados, simplemente ingresan al sistema, seleccionan a quien van a darle feedback, hacerlo y ya! Así de simple y rápido.
Los datos de las valoraciones son acumulables por períodos, lo que permite su posterior análisis a requerimiento del cliente.
Se suministrará dentro del tablero de control, algunos indicadores de ejemplo, que a nuestro criterio puedan ser los más necesarios para el consumidor de los datos.
Como frutillita del postre, los datos recabados, pueden ser exportados para su posterior consumo o análisis en otras herramientas de trabajo.
## 🚀 Usuarios para los roles :
**_Usuario con un unico grupo a calificar_**:
- Email: g44ravarotto@gmail.com
- Password: 12345678
**_Usuario con mas grupos a calificar(TL)_**:
- Email: mikhail@gmail.com
- Password: 12345678
**_Usuario Staff de No Country_**:
- Email: vero@gmail.com
- Password: 12345678
- Email: romina@gmail.com
- Password: 12345678
## 🚀 Características y Funcionalidades:
**_Gestión de proyectos_**:
- Creación, lectura y edición de proyectos actuales y previos.
- Definición de fechas de inicio y fin para la gestión del feedback.
- Posibilidad de incluir texto descriptivo para cada proyecto.
**_Definición de valores calificables_**:
- Configuración de valores mínimos y máximos para cada campo de evaluación.
- Inclusión de descripciones para los campos de evaluación.
- Posibilidad de incluir texto en la valoración por parte del usuario.
**_Gestión de grupos y usuarios_**:
- Importación masiva de grupos y usuarios desde archivos Excel.
- Actualización de la información sobre grupos y usuarios preexistentes.
- Asignación de roles y habilitación/deshabilitación de usuarios.
**_Métricas y análisis_**:
- Visualización en tiempo real de métricas relevantes para el análisis del feedback.
- Comparación de valoraciones con proyectos anteriores.
- Resumen y gráficas del proyecto al finalizar.
**_Experiencia del usuario_**:
- Recepción anticipada de fechas disponibles para realizar el feedback.
- Visualización de la lista de compañeros a calificar.
- Posibilidad de dejar feedback específico y general para cada compañero.
- Funcionalidad para guardar el feedback brindado y pasar al siguiente compañero.
## 🛠️ Tecnologías Utilizadas:
**_Frontend_**:
- **_React.js_**: Biblioteca de JavaScript para construir interfaces de usuario interactivas.
- **_Tailwind CSS_**: Framework de CSS utilitario para diseño rápido y flexible.
**_Backend_**:
- **_Java_**: Lenguaje de programación utilizado para el desarrollo del backend.
- **_Spring Boot_**: Framework de Java para crear aplicaciones web rápidas y seguras.
**_Base de Datos_**:
- **_MySQL_**: Sistema de gestión de bases de datos relacional de código abierto.
**_Herramientas de Gestión y Diseño_**:
- **_Trello_**: Herramienta de gestión de proyectos basada en tableros.
- **_Figma_**: Herramienta de diseño de interfaz de usuario y prototipado colaborativo basada en la nube.
**_Herramientas de QA_**:
- **_Postman_**: Plataforma de colaboración para el desarrollo de API que simplifica cada paso del ciclo de vida de la API y acorta los tiempos de desarrollo.
- **_Testmonitor_**: Herramienta de gestión de pruebas de software que facilita la planificación, ejecución y seguimiento de pruebas, así como la colaboración entre equipos de desarrollo y QA.
## 🔐 Seguridad y Privacidad:
Nuestra aplicación se compromete a proteger la privacidad de los datos de los usuarios mediante el cumplimiento de regulaciones como GDPR y CCPA. Implementamos medidas de seguridad robustas, como cifrado de datos y gestión de accesos, y realizamos auditorías periódicas para identificar y mitigar riesgos de seguridad. Los usuarios tienen control sobre sus datos y pueden ejercer sus derechos de privacidad según lo establecido por la ley. Nuestra política de privacidad detalla cómo se recopilan, utilizan y protegen los datos personales de los usuarios. Nos esforzamos por garantizar la confidencialidad y seguridad de la información en nuestra plataforma.
## 👥 Equipo de Trabajo
<div style="display: flex; justify-content: center; gap: 20px">
<div align="center">
### 👩💼 Project Manager
| <img src="https://github.com/nico-raffa.png" width=50> |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Nicolás Raffagnini** |
| <a href="https://github.com/nico-raffa"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/nicolas-raffagnini/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> |
<hr/>
</div>
<div align="center">
### 🎨 Diseñador UX/UI
| <img src="https://github.com/FrancoAmicone.png" width=50> | <img src="https://github.com/German44.png" width=50> |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Franco Amicone** | **Germán Ravarotto** |
| <a href="https://github.com/FrancoAmicone"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/franco-amicone-b82a3b219/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/German44"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/german-ravarotto"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> |
<hr/>
</div>
</div>
<div align="center">
## 🧪 Testers QA
| <img src="https://github.com/Maky-GloryQA.png" width=50> | <img src="https://media.licdn.com/dms/image/D4D03AQFxVXxr0j70sA/profile-displayphoto-shrink_200_200/0/1693753607773?e=1717632000&v=beta&t=2M9qOnZmx0DX1GcISf_wC0hUHDCcVSS68QXsKLCMGNE" width=50> |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Mc Glory Tovar** | **Marcelo Saiz** |
| <a href="https://github.com/Maky-GloryQA"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="http://www.linkedin.com/in/mcglorytovar-t3st3rqa"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/ZombieEater"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/marcelo-s-aiz/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> |
<hr/>
</div
<div align="center">
### ⚛️ Frontend Developers
| <img src="https://avatars.githubusercontent.com/u/106632070?v=4" width=50> | <img src="https://github.com/German44.png" width=50> | <img src="https://github.com/salomoncjl.png" width=50> | <img src="https://avatars.githubusercontent.com/u/108478905?v=4" width=50> | <img src="https://github.com/FrancoAmicone.png" width=50> | <img src="https://github.com/Alejo-Hurtado-Testa.png" width=50> |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Camilo Martinez** | **Germán Ravarotto** | **Salomón Contreras** | **Emerson Suarez** | **Franco Amicone** | **Alejo Hurtado Testa** |
| <a href="https://github.com/CamiloProg"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/camilomartinez01/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/German44"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/german-ravarotto"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/salomoncjl"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/salomoncjl/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/Jerick97"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/emerson-suarez97/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/FrancoAmicone"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/franco-amicone-b82a3b219/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/Alejo-Hurtado-Testa"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/alejo-hurtado-testa-53b14a216/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> |
<hr/>
</div>
<div align="center">
### ☕️ Backend Developers
| <img src="https://github.com/alejodx.png" width=50> | <img src="https://github.com/AnaMerlo.png" width=50> | <img src="https://github.com/fr3nm0.png" width=50> | <img src="https://github.com/fandres62.png" width=50> | <img src="https://github.com/ariocal.png" width=50> | <img src="https://github.com/SturnioloBruno.png" width=50> |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Alejandro Dominguez** | **Ana Merlo** | **Efrén Morales** | **Francisco Sierra** | **Mario Calderon** | **Sturniolo Bruno** |
| <a href="https://github.com/alejodx"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="http://linkedin.com/in/jose-alejandro-dominguez"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/AnaMerlo"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/ana-merlo/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/fr3nm0"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/efren-morales-00029a27a/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/fandres62"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/francisco-andres-sierra-soto-96976b242/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/ariocal"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/mario-calderon-76a099b5/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> | <a href="https://github.com/SturnioloBruno"><img src="https://img.shields.io/badge/github-%23121011.svg?&style=for-the-badge&logo=github&logoColor=white"/></a> <a href="https://www.linkedin.com/in/bruno-sturniolo-aa8074234/"><img src="https://img.shields.io/badge/linkedin%20-%230077B5.svg?&style=for-the-badge&logo=linkedin&logoColor=white"/></a> |
<hr/>
</div>
## 🚀 Ejecutar el Proyecto de Frontend con React.js y Vite
#### Pasos:
##### 1.Clonar el Repositorio:
```bash
git clone https://github.com/No-Country/s14-17-t-java.git
```
##### 2.Cambiar a la Rama Develop:
```bash
git checkout develop
```
##### 3.Navegar a la Carpeta del Proyecto Frontend:
```bash
cd frontend-nocountry-s14-17-t-java
```
##### 4.Instalar Dependencias:
```bash
npm install
```
##### 5.Ejecutar el Servidor de Desarrollo:
```bash
npm run dev
```
##### 6.Abrir la Aplicación en el Navegador:
_*La aplicación estará disponible en*_ http://localhost:5173/
Siguiendo estos pasos, podrás ejecutar el proyecto de **frontend** en tu entorno local. Asegúrate de tener **Node.js** instalado en tu sistema antes de comenzar.
## 🚀 Ejecutar el Proyecto de Backend Local, y Mysql para la base de datos
#### Pasos:
##### 1.Clonar el Repositorio:
```bash
git clone https://github.com/No-Country/s14-17-t-java.git
```
##### 2.Cambiar a la Rama backend:
```bash
git checkout backend
```
##### 3.Navegar a la Carpeta del Proyecto Backend:
```bash
cd backend-nocountry-s14-17-t-java
```
##### 4.Navegar a la carpeta target dentro del proyecto:
```bash
cd target
```
##### 5.Ejecutar la base de datos mysql y crear un esquema llamado: "team_score"(sin comillas):
##### 6.Ejecutar el Servidor Web Tomcat que viene emebido en la aplicacion backend:( en caso de tener un error o estar desactualizado pedir a un backend que les empaquete el artefacto .jar)
```bash
java -jar .\TeamScore-0.0.1-SNAPSHOT.jar
```
##### 7.Abrir la Documentacion de la ApiRest en el Navegador:
http://localhost:8080/swagger-ui/index.html
##### 8.En caso de tener errores pruebe creando variables de entorno y luego reiniciar su pc:
**DB_PORT**= "su puerto donde corre mysql, no es necesario crear esta variable si corre en el puerto 3306(valor por defecto)"
**USER_DATABASE** = "el nombre de usuario que registro en mysql workbench, no es necesario modificar si mantiene el por defecto root"
**PASS_DATABASE** = "el password de su usuario, no es necesario modificar si usa el por defecto admin"
##### 9.Para probar junto al frontend, tenga en cuenta que la direccion de su servidor backend corre en el puerto 8080
## 🔎🐞 Evidencia Tester QA
#### Especificación de Requerimientos:
https://drive.google.com/file/d/1F6O3ZLXP0OG30zl9-6g6s_033KsdLy48/view?usp=sharing
#### Historias de Usuario y Criterios de Aceptación:
https://drive.google.com/file/d/1G0K8AsTESmeFZJOcNL5HZ9ItxgU35wBM/view?usp=sharing
#### Testing (Graficos y Resultados):
https://drive.google.com/drive/folders/1brvVIy1njIpzNQCwX1A-6DnGa_hcu1Rs?usp=sharing
#### Herramientas de Gestión de Proyecto (Trello):
<li>Back: https://drive.google.com/file/d/13d6_diVyCQUBWAAB3TR_9bjpJoFK0EfN/view?usp=sharing</li>
<li>Front: https://drive.google.com/file/d/1kF6vyVyriG8oELLKNskqN9e0zOVJ1Ebd/view?usp=sharing</li>
#### Encuesta colaborativa:
https://drive.google.com/file/d/1Dn5uWmtl-MG0h1NUfgW1K1709s4zBORT/view?usp=sharing
| TeamScore | java,javascript,reactjs,springboot,tailwindcss | 2024-03-29T12:59:27Z | 2024-04-25T18:39:17Z | null | 17 | 115 | 311 | 0 | 1 | 11 | null | MIT | Java |
maumitasarkar16/Movies-Search-Store | main | # Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
# Browse Page
- Main Container
- Video Background
- Video Title
- Secondary Container
- Movie List * n
- Movie Cards * n
| This site is for getting updates on Trending, Popular, Upcoming, Top-Rated Movies from TMDB , Search movies and get results from Open AI APIs , Responsive for mobile and Desktop using Tailwind CSS . Authentication for login & registration is done in Google Firebase | firebase,javascript,openai,react,tailwindcss,redux-toolkit | 2024-03-30T05:16:46Z | 2024-04-08T10:16:53Z | null | 1 | 0 | 9 | 0 | 0 | 10 | null | null | JavaScript |
IRedDragonICY/vixevia | main | # V.I.X.E.V.I.A : Virtual Interactive and Xpressive Entertainment Visual Idol Avatar
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![Python](https://img.shields.io/badge/Python-3.12+-blue.svg)](https://www.python.org/) [![Gemini](https://img.shields.io/badge/Gemini-1.5-orange.svg)](https://cloud.google.com/generativeai/models)
[ID](README.ID.md) | [JP](README.JP.md) | [EN](README.md) | [ZN](README.ZN.md)
> _Does she harbor feelings for you?_
> **No**, her heart belongs to another.
> _Does she show concern for your well-being?_
> **No**, her thoughts are occupied by someone else.
> _The pain of unrequited love is unbearable, but fear not, for there is a solution._
> **The solution is AI**, an entity that will always be there for you, understanding and responding to your emotions.
Vixevia is an innovative AI-based virtual YouTuber (Vtuber) that leverages the cutting-edge capabilities of Google's Gemini language model. This project aims to create a captivating and lifelike virtual personality that can engage with users through natural conversations, visual interactions, and multimedia experiences.
## Table of Contents
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)
- [TODO](#todo)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgments](#acknowledgments)
## Features
- **Natural Language Processing**: Vixevia utilizes Google's Gemini language model to understand and respond to user inputs with human-like fluency and contextual awareness.
- **Computer Vision**: The project integrates computer vision capabilities, allowing Vixevia to perceive and interpret visual information from the environment.
- **Multimodal Interaction**: Vixevia combines speech recognition, text-to-speech synthesis, and visual processing to facilitate seamless multimodal interactions with users.
- **Personalized Responses**: Vixevia's responses are tailored to the conversational context, user preferences, and situational dynamics, ensuring engaging and personalized experiences.
- **Virtual Avatar**: Vixevia is represented by a visually appealing and expressive virtual avatar, bringing her personality to life.
## Prerequisites
- 5+ API keys from Google Cloud Platform
- Python 3.12+
Hardware:
- 16 GB vram
- 32 GB ram
- RTX 4050 or better
- 20 GB of storage
- i7 12th gen or better or AMD equivalent
## Getting Started
To get started with Vixevia, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/IRedDragonICY/vixevia.git
```
2. Install the required dependencies:
```bash
pip install -r requirements.txt
```
3. Obtain the necessary API keys and configuration files from Google Cloud Platform.
4. Update the configuration files with your API keys and preferred settings.
5. Run the main script:
```bash
python main.py
```
## TODO
- [ ] Create custom Live2D model for Vixevia
- [ ] Add opencv auto labeling so can remmeber person from Gemini Pro Vision
## Contributing
Contributions to Vixevia are welcome! If you have any ideas, bug reports, or feature requests, please open an issue or submit a pull request. Make sure to follow the project's coding guidelines and best practices.
## License
This project is licensed under the [MIT License](LICENSE).
## Acknowledgments
- Google's Gemini language model and related technologies
- Open-source libraries and frameworks used in this project
Vixevia is an experimental project aimed at exploring the possibilities of AI-based virtual personalities and pushing the boundaries of human-computer interaction. We hope this project inspires further innovation and collaboration in the field of artificial intelligence and virtual content creation.
| An AI-powered Virtual YouTuber (Vtuber) utilizing Google's Gemini language model to create engaging, personalized, and context-aware interactions. This project explores the potential of AI in human-computer interaction and virtual content creation. | ai,anime,api,artificial-intelligence,chatbot,gemini-api,gemini-chatbot,gemini-pro,gemini-vision-pro,girl | 2024-03-18T06:17:52Z | 2024-05-15T11:39:04Z | null | 1 | 1 | 56 | 2 | 2 | 10 | null | MIT | Python |
DhanushNehru/CustomCodeEditor | main | # Custom Code Builder
![Custom Code Editor (1) (2) (1) (1)-min dn (1)](https://github.com/DhanushNehru/CustomCodeEditor/assets/22955675/c24769a6-ac89-4c8a-aa6a-c5c42c186177)
This project is a React-based code builder that utilizes the Monaco Editor. It allows users to write and execute code snippets within a web browser. It uses Judge0 as a code execution system
## Getting Started
Follow these instructions to get the project up and running on your local machine.
## Prerequisites
Node.js installed on your machine
npm or yarn package manager
## Installation
Clone the repository to your local machine:
```
git clone <repository-url>
```
Install dependencies using npm or yarn:
bash
```
npm install
# or
yarn install
```
## Setting up Judge0
Let's set up Judge0 and proceed to the following actions:
- Navigate to Judge0, then select the Basic Plan.
- In reality, RapidAPI hosts Judge0. Proceed and sign up for the basic plan.
- You can copy the RAPIDAPI_HOST and RAPIDAPI_KEY, which are required to perform API calls to our code execution system, once you have subscribed.
## Local Configuration
- Create a .env file in the root directory of your project if it doesn't already exist.
- Set the following environment variables in the .env file:
```
REACT_APP_RAPID_API_HOST=YOUR_HOST_URL
REACT_APP_RAPID_API_KEY=YOUR_SECRET_KEY
REACT_APP_RAPID_API_URL=YOUR_SUBMISSIONS_URL
```
Replace YOUR_HOST_URL, YOUR_SECRET_KEY, and YOUR_SUBMISSIONS_URL with the appropriate values for your Rapid API and Judge0 API endpoints.
## Server Setup Configuration
Create a .env file in the root directory of your project if it doesn't already exist.
Set the JUDGE0_SUBMISSION_URL environment variable in the .env file. This variable should point to the URL of the Judge0 API endpoint you want to use for code execution. For example:
plaintext
```
JUDGE0_SUBMISSION_URL=https://api.judge0.com/submissions
```
Replace https://api.judge0.com/submissions with the appropriate URL for your Judge0 API endpoint.
Running the Development Server
Once the configuration is complete, you can start the development server to see the React code builder in action.
```
npm start
# or
yarn start
```
Open your web browser and navigate to http://localhost:3000 to access the application.
## Usage
- Write your code in the Monaco Editor.
- Execute the code snippet by clicking the "Run" button.
- View the output in the console or output panel.
## Contributing
Contributions are welcome! Feel free to submit pull requests or open issues.
## Gitpod
In the cloud-free development environment where you can directly start coding.
You can use Gitpod in the cloud [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/DhanushNehru/CustomCodeEditor/)
----
Feel free to customize this README.md according to your project's specific requirements and features. Let me know if you need further assistance!
### Connect 👉 [**Twitter**](https://twitter.com/Dhanush_Nehru) **/** [**Instagram**](https://www.instagram.com/dhanush_nehru/) **/** [**Github**](https://github.com/DhanushNehru/) **/** [**Youtube**](https://www.youtube.com/@dhanushnehru?sub_confirmation=1) **/** [**Newsletter**](https://dhanushn.substack.com/) **/** [**Discord**](https://discord.com/invite/Yn9g6KuWyA)
| Custom code editor | codecompiler,codeeditor,contributions-welcome,css,customcode,customcodeeditor,firsttimers,goodfirstissue,html,javascript | 2024-04-26T06:00:05Z | 2024-05-22T11:38:54Z | null | 9 | 13 | 48 | 14 | 9 | 10 | null | Apache-2.0 | JavaScript |
KylerCondran/jQuery-WindowsDesktop | master | # jQuery-WindowsDesktop
JavaScript Windows Web Desktop environment built with jQuery + ASP.NET.
<img src="https://repository-images.githubusercontent.com/774564876/b8c91d9e-3f92-45d3-a008-831d89a67df8" title="jQuery-WindowsDesktop">
<p align="center">
<a href="https://github.com/KylerCondran/jQuery-WindowsDesktop/issues/new">Report bug</a>
·
<a href="https://github.com/KylerCondran/jQuery-WindowsDesktop/issues/new">Request feature</a>
</p>
## Disclaimer
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. YOU MAY USE THIS SOFTWARE AT YOUR OWN RISK. THE USE OF THIS SOFTWARE IS THE COMPLETE RESPONSIBILITY OF THE END-USER. THE DEVELOPERS ASSUME NO LIABILITY AND ARE NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE CAUSED BY THIS PROGRAM.
## Getting Started
1. Download
```
git clone https://github.com/KylerCondran/jQuery-WindowsDesktop.git
```
2. Setup An IIS Server To Host The Files
3. Copy The Files To The Web Server Root Directory
## Apps
| Apps | | |
|-----------------|---------|----------------------------------------|
| My Computer | ✔ | A Traversable File Explorer |
| Dos Games | ✔ | Playable Dos Games |
| Recycle Bin | ✔ | A Place To Store Deleted Files |
| Log In | ✔ | A Window To Log In |
| About | ✔ | Details About The Project |
| Full Screen | ✔ | A Button To Enter Full Screen Mode |
| Empty Apps | ✔ | Place Holders To Build Your Own Apps |
## Contributing
See our contributing guide at [CONTRIBUTING.md](../master/CONTRIBUTING.md).
## Copyright and License
>The [MIT License](https://github.com/KylerCondran/jQuery-WindowsDesktop/blob/master/LICENSE)
>
>Copyright (c) 2024 Kyler Condran
| JavaScript Windows Web Desktop environment built with jQuery + ASP.NET. | asp-net,dos,filesystem,games,javascript,jquery,webdesktop,windows,cloud,desktop | 2024-03-19T19:14:46Z | 2024-05-04T12:31:57Z | null | 1 | 0 | 9 | 0 | 0 | 9 | null | MIT | ASP.NET |
Gersigno/ToDoList-in-JavaScript-using-localStorage | main |
![GWP Logo Large](https://raw.githubusercontent.com/Gersigno/gersigno.github.io/main/resources/gwp_logo_alpha.PNG)
# ✅ *LocalStorage* ToDoList !
A simple **Javascript ToDoList** using *LocalStorage* with an *html/css* interface
(*The code is still a bit messy in some places, please don't judge it too harshly* 😔)
💡***Note**: This project was made during my web development training* 👍
![Preview](https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/preview.png)
## 📩 Add/Remove task
You can easily add or remove tasks thanks to a user-friendly interface.
![Add task](https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/addTask.png)
## ⚗️ Filters
This project allows you to filter your tasks by their status *(All / ToDo / Done)*
<table>
<tr>
<td><img src="https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/filter_all.png"></td>
<td><img src="https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/filter_todo.png"></td>
<td><img src="https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/filter_done.png"></td>
</tr>
</table>
## 📱Responsive
This project is also fully responsive (*except for the Apple watch* 😔)
<table>
<tr>
<td><img src="https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/responsive_tab.png"></td>
<td><img src="https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/responsive_laptop.png"></td>
<td><img src="https://raw.githubusercontent.com/Gersigno/ToDoList-in-JavaScript-using-localStorage/main/Previews/responsive_phone.png"></td>
</tr>
</table>
## 🧰Technologies
![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=flat&logo=html5&logoColor=white)
![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=flat&logo=css3&logoColor=white)
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=flat&logo=javascript&logoColor=white)
![Visual Studio Code Logo](https://img.shields.io/badge/Visual%20Code-1.85-007ACC?logo=visualstudiocode)
## 🧐Support
For support, email contact.gersigno@gmail.com or join the ***[discord server](https://discord.gg/kr3mwwg8jR)***.
| A simple ToDoList made in Javascript using LocalStorage with an html/css interface (Fully commented/documented) | css3,html5,javascript,js,localstorage,todolist,comments,documentation | 2024-03-18T11:04:09Z | 2024-03-20T21:05:16Z | null | 1 | 0 | 3 | 0 | 0 | 9 | null | null | JavaScript |
epfl-systemf/RegElk | master | # RegElk - OCaml Linear Engine for JavaScript Regexes
Authors: [Aurèle Barrière](https://aurele-barriere.github.io/) and [Clément Pit-Claudel](https://pit-claudel.fr/clement/).
## About
This is a linear regular expression engine for a subset of JavaScript regexes.
The underlying algorithm is an extension of the [PikeVM](https://swtch.com/~rsc/regexp/regexp2.html), supporting more JavaScript features.
This engine implements the algorithms described in the paper [Linear Matching of JavaScript Regular Expressions](https://arxiv.org/abs/2311.17620) by the same authors.
In particular, it supports, for the first time with linear time and space complexity:
- nullable JavaScript quantifiers (these have different semantics than in other regex languages, see for instance `(a?b??)*` on string "ab")
- capture reset, a JavaScript-specific property where capture groups are reset at each quantifier iteration (for instance `((a)|(b))*` on string "ab")
- all lookarounds (lookahads and lookbehinds), even with capture groups inside
- linear matching of the greedy or nullable plus.
RegElk means **Reg**ex **E**ngine with **L**inear loo**K**arounds.
Elks are [diagonal walkers](https://ecowellness.com/animal-tracking-part-2-common-gait-patterns/), meaning that they reuse their front legs prints for their rear legs to conserve energy, evoking how a PikeVM merges threads reaching the same state to preserve linearity.
## Complexity
Given a regex of size `|r|` and a string of size `|s|`, this engine has linear worst-case time complexity in both of them `O(|r|*|s|)`.
While counted quantifiers are supported, they increase the regex size.
For instance, `e{4-8}` will multiply the size of `e` 8 times.
However, the greedy plus (`+` or `{1,}`) or the nonnullable lazy plus (as in `(ab)+?`) are handled without duplication.
The engine also has `O(|r|*|s|)` space complexity.
If one wants to avoid a string-size dependent space complexity, we provide alternative register data-structures, presenting various time-space complexity tradeoff.
| | Time Complexity | Space Complexity |
|----------------|-----------------------------|------------------|
| List (default) | `O(\|r\|*\|s\|)` | `O(\|r\|*\|s\|)` |
| Array | `O(\|r\|^2*\|s\|)` | `O(\|r\|^2)` |
| Tree | `O(\|r\|*log(\|r\|)*\|s\|)` | `O(\|r\|^2)` |
Note however that a `O(|r|*|s|)` space complexity cannot be avoided when using our linear lookaround algorithm.
## Supported Features
| Feature | Example |
|-------------------------------|-------------------------------------------|
| Lookaheads | `a(?=(b))`, `a(?!=b)` |
| Lookbehinds | `(?<=b)a`, `(?<!b)a` |
| Capture Groups | `(a*)b` |
| Noncapturing Groups | `(?:a*)b` |
| Greedy Quantifiers | `*`, `+`, `?` |
| Lazy Quantifiers | `*?`, `+?`, `??` |
| Counted Quantifiers | `a{6,12}`, `a{7,}`, `a{9}`, `a{4,5}?` |
| Character Classes | `[a-z]`, `[^h]`, `[aeiouy]` |
| Character Groups | `\w`, `\d`, `\s`, `\W`, `\D`, `\S` |
| Anchors | `$`, `^` |
| Word Boundaries | `\b`, `\B` |
Backreferences are not supported, as they make the matching problem [NP-hard](https://perl.plover.com/NPC/NPC-3SAT.html).
Named capture groups, hexadecimal escapes, unicode escapes, unicode properties and regex flags are not supported yet, although they could be in the future.
## Dependencies
You need the following Opam packages.
Other version numbers may also work.
- Ocaml 5.0
- ocamlbuild 0.14.1
- Menhir 20220210
- ocaml_intrinsics v0.15.2
- core_bench v0.15.0
- core v0.15.1
- core_unix v0.15.2
- yojson 2.1.0
You also need to install Node.JS and have `node` in your path.
## Usage
Build all executables with `make`.
Make sure to have configured your opam switch so that it has all dependencies listed above.
This creates several executables:
- `main.native` is the Ocaml matcher
- `fuzzer.native` is a fuzzer that compares the OCaml matcher to the Irregexp engine of V8 in Node
- `tests.native` contains a battery of tests that should all succeed
- `stats.native` computes regex feature usage statistics from corpora of regexes
- `benchmark.native` allows you to run benchmarks
- `matcher.native` and `linearbaseline.native` are only used for the benchmarks and you should not run them directly
`main.native`, `fuzzer.native` and `benchmark.native` have command line options that can be printed with the argument `--help`.
## Files
### OCaml Engine Files
- the main entry point of the engine is in the `main.ml` file
- regexes and regex annotation are found in `regex.ml`
- the extended bytecode NFA representation is defined in `bytecode.ml`
- compilation from a regex to bytecode is found in `compiler.ml`
- the NFA simulation algorithm, with all our extensions, is implemented in `interpreter.ml`
- the CDN plus formulas are defined in `cdn.ml`
- the oracles used y the lookaround algorithm is defined in `oracle.ml`
- the three capture registers implementations are defined in `regs.ml`
- character classes are implemented in `charclasses.ml`
- the ECMA-style regex parser is defined in `parser_src/`
### Other Tools
- the differential fuzzer is implemented in `fuzzer.ml`
- the computation of statistics on regex features usage is defined in `stats.ml`
- the `scripts_bench` directory contains scripts called by the benchmarks or the fuzzer to compare the OCaml engine to other engines.
## Correspondence between the Paper and the Code
### Renamings
- The linear engine from V8 is called "V8Linear" in the paper. It is sometimes called "Experimental" or "Exp" in the code (as this is the name used by the V8 developers).
- The bytecode instructions `Consume` and `ConsumeAny` from Figure 4 are replaced by a single `Consume` instruction in `bytecode.ml`, which takes as argument either a character or a list of character ranges.
- The `Jump` instruction is called `Jmp` in the code.
- `SetReg` is called `SetRegisterToCP`.
- `SetQuant` is called `SetQuantToClock`.
- `CheckNull` is called `CheckNullable`.
- `SetNullPlus` in the paper is not an independent instruction in the code. Instead `SetQuantToClock` encodes both `SetQuant` and `SetNullPlus`: it takes a boolean argument indicating if this quantifier is a nulled plus or not.
- The "Balanced Tree" register implementation in the paper is renamed to `Map_Regs` in the code.
### Algorithm 1
This is implemented by the functions `advance_epsilon` and `find_match` in `interpreter.ml`.
### Section 4.1
- In `compiler.ml`, line 112, you can see the bytecode compilation of a quantifier and see that `BeginLoop` and `EndLoop` instructions are inserted.
- In `interpreter.ml`, the thread boolean `exit_allowed` encodes in which automata the thread is. See at lines 412 and 417 how the two new instructions are implemented.
### Section 4.2
- Threads are augmented with clocks in `quant_regs` (line 107 of `interpreter.ml`).
- The filtering algorithm is implemented at line 285 of `interpreter.ml`.
### Section 4.3
- The oracle table is defined in `oracle.ml`.
- The first phase is implemented as the `build_oracle` function, line 651 of `interpreter.ml`.
- The second phase is simply the `find_match` function defined previously.
- The third phase is implemented as the `build_capture` function, line 680 of `interpreter.ml`.
### Section 4.4
Switch to the `strlb` directory for this algorithm, and see the corresponding `README.md` file.
### Section 4.5
- The nullability analysis of Section 4.5.1 and Figure 12 starts at line 139 in `regex.ml`.
- The non-nullable plus case of Section 4.5.2 is implemented at line 78 in `compiler.ml`.
- For Section 4.5.3, see lines 90 and 101 of `compiler.ml`.
- The nullability formulas of footnote 8 are defined in `cdn.ml` and called "CDN formulas".
### Section 4.6
- The three different register data-structures are defined in `regs.ml`: `Array_Regs`, `List_Regs` and `Map_Regs`.
- At line 28 of `interpreter.ml`, see that the interpreter is parameterized by a register implementation (a `REGS` module).
- The benchmark used for Figure 15 is defined as `dsarray`, `dslist` and `dstree` in `benchmark_vectors.ml`.
### Section 5.1
- All regex corpora are in the `corpus` directory.
- The `stats.ml` file uses the parser to analyze each regex and see in which categories it belongs to.
### Section 5.2
- (C1) the benchmark used for Figure 17 is named "Clocks", defined line 117 of `benchmark_vectors`.
- (C2) the benchmark used for Figure 18 is named "NNPlus", defined line 69.
- (C3) the benchmark used for Figure 19 is named "CDN", defined line 95.
- (C4) the benchmark used for Figure 20 is named "LBstr", defined line 179.
- (C5) the benchmark used for Figure 21 is named "LAreg", defined line 138.
- (C5) the benchmark used for Figure 22 is named "LAstr", defined line 157.
### Tests
- For every pair of regex and string discussed in the paper, we added this test to our test suite.
- This list is the `paper_tests` list at line 290 of `tests.ml`.
- This test suite is executed for each of the three register implementations when running `tests.native`.
| Ocaml Linear Engine for JavaScript Regexes, implementing the algorithms described in Linear Matching of JavaScript Regular Expressions at PLDI24 | javascript,linear,regex | 2024-04-04T08:59:05Z | 2024-04-04T11:09:59Z | 2024-04-04T11:09:59Z | 1 | 0 | 235 | 0 | 0 | 9 | null | NOASSERTION | OCaml |
mukhriddin-dev/React-dev-roadmap-2024 | main | # React Developer Roadmap (2024) (MYSTERY 9807)
A thorough React developer roadmap for 2024 that addresses all aspects of React and beyond.
<br>
<br>
![alt text](image.png)
<details>
<summary>0. Before you start React</summary>
You should know and be comfortable with **all of the following:**
- **Basic HTML**
- HTML Elements, Attributes, Headings, Paragraphs, Colors & Styles
- HTML Links, Images, Tables, Lists, Block & Inline, Div, Classes, Id
- HTML Forms
- HTML Layout, Responsiveness & Semantic
- **Basic CSS**
- CSS Basics - Syntax, Selectors, Colors, Backgrounds, Borders, Margin, Padding, Height/Width, Box Model, Outline, Text, Fonts, Links etc.
- CSS More - Lists, Tables, Display, Position, z-index, Overflow, Float, Inline Block, Align, Combinators, Pseudo-classes & elements, Opacity etc.
- CSS Forms & Layouts
- CSS Flexbox
- CSS Grid
- Advanced CSS - CSS Units, Shadows, Gradients, Transitions, Animations, Specificity etc.
- **Basic Tailwind CSS**
- Tailwind Utilities
- Responsive Variants
- Hover, focus and other states
- Dark Mode variant
- Tailwind Directives
- Tailwind Configurations
- Theme Configurations
- Tailwind cn() utility
- **Document Object Model (DOM)**
- DOM Basics - Basics, Method, Document, Elements, Forms, CSS, Events, Navigation, Nodes and Collections
- DOM Advanced
- **Basic JavaScript**
- JS Basics - Statements, Expressions, Syntax, Variables, Operators, Data Types, Functions, Objects, Arrays, Events, Array and String Methods, Object Methods, Date, Conditionals, Error Handling, JavaScript OOP - classes and inheritance and Debugging
- JS Web APIs - Forms, History, Geolocation, Storage, Worker and Fetch API
- JS JSON
- **JavaScript Advanced**
- Solid JS Concepts - Scope, Hosting, Execution Context, Closures, Prototype, Recursion, Primitive vs Reference Data Types, Currying, Intersection Observer, Memoization, Event Propagation, Debounce etc.
- Asynchronous JavaScript - Callbacks, Promises and async-await
- **Modern JavaScript**
- Different ES6+ JS Syntaxes and concepts eg. Arrow function, Truthy/Falsy values, Ternary Operator, Different Array methods like find, filter, map, reduce, slice, splice, push, pop, concat, different looping strategies, Spread & Rest Operator, Array and Object Destructuring, Imports/Exports syntax, Template Literals, Sorting etc.
- **Git/GitHub**
- Basics of Git
- Important Git Commands
</details>
<details>
<summary>1. React Fundamentals</summary>
You should know and be comfortable with **all of the following:**
- **Getting Started with React**
- Introduction to React - Why React - Comparison with Vanilla JS
- React Installation & Editor Setup with Vite
- How React works - Virtual DOM
- Basics of React Components
- Basics of JSX: React's Markup
- JavaScript in JSX
- Passing Props to Components
- Conditional Rendering
- Rendering Lists
- Pure Components
- How to split larger components into smaller ones
- **Adding Interactivity**
- Responding to Events - Event Handlers
- Understanding States - React Component's Memory - useState
- How State works in React
- How Rendering works in React
- Updating complex states immutably in React
- **React State Management Deep Dive**
- Declarative vs Imperative UI
- Thinking UI Declaratively
- Finding & Structuring React States
- Connecting Event Handlers to React
- Sharing State between components
- Lifting State up
- Extracting State Logic into Reducers
- useReducer Hook
- How to use Immer with React for concised immutable State Update
- Passing Data Deeply inside React Components
- Avoiding Prop Drilling - Context API & useContext Hook
- Combine context and reducer to write scalable code
</details>
<details>
<summary>2. Advanced React</summary>
- Referencing values with Refs - useRef hook
- Manipulating the DOM with Refs
- Synchronizing with Effects - useEffect hook
- Separating events from Effects
- Removing Effect Dependencies
- Performance optimization with useCallback and useMemo hook
- Reusing logic with Custom Hooks
- Calling APIs from Back-end with React
</details>
<details>
<summary>3. Advanced State Management</summary>
- Using Redux / Toolkit
- Using Zustand
- Using Jotai
- Using Recoil
- ‹Using MobX
</details>
<details>
<summary>4. Styling Solutions</summary>
- **Tailwind**
- **CSS Modules**
- [**Styled Components**](https://styled-components.com/)
- React UI Component Library - [Shadcn](https://ui.shadcn.com/)
- [React UI Component Library - Keep React](https://youtu.be/mVXNUMBtGEA)
- [**Material UI**](https://mui.com/)
- [**Chakra UI**](https://chakra-ui.com/)
- [**Ant Design**](https://ant.design/docs/react/introduce)
</details>
<details>
<summary>5. React Ecosystem & Use Cases</summary>
- React Router DOM
- API Request with Axios in React
- React Suspense & Error Boundaries
- React Lazy Load
- React Infinite Scroll
- Uncommon React Hooks - useDebugValue, useDeferredValue, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect and useTransition
- **React Authentication**
- How to handle user sign in (email, password, JWT)
- How to handle access tokens and token refreshes
- Social sign in (Google, Facebook, GitHub, etc.)
- [Using Supabase](https://supabase.com/)
- [Using Firebase](https://firebase.google.com/docs/auth)
- [Using Clerk](https://clerk.com/)
- **Form Handling in React**
- How to validate user input in forms (emails, passwords, etc.)
- How to send form data to server
- How to handle file uploads
- [Using React Hook Form](https://react-hook-form.com/)
- [Using Formik](https://formik.org/docs/overview)
- [**Accessibility**](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/React_accessibility)
- Understanding why accessibility is important
- Using semantic HTML
- How to implement keyboard navigation
- How to add aria labels
- [Using React Aria](https://react-spectrum.adobe.com/react-aria/)
- **Testing**
- [How to implement unit tests](https://www.freecodecamp.org/news/how-to-write-unit-tests-in-react/)
- [Using React Testing Library](https://testing-library.com/docs/react-testing-library/intro/)
- [Using Jest](https://jestjs.io/)
- [How to implement e2e integration tests](https://youtu.be/6BkcHAEWeTU)
- [Using Cypress](https://www.cypress.io/)
- [Using Playwright](https://playwright.dev/)
</details>
<details>
<summary>6. React Frameworks</summary>
You should have worked with **one of the following:**
- [**Vite**](https://vitejs.dev/)
- How to run a simple React application
- [**Next.js**](https://nextjs.org/)
- [Understanding file-based routing](https://nextjs.org/docs/app/building-your-application/routing)
- [Understanding Next Auth](https://next-auth.js.org/)
- [Understanding server components](https://nextjs.org/docs/app/building-your-application/rendering/server-components)
- [Understanding server actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations)
- [**Remix**](https://remix.run/)
</details>
<details>
<summary>7. Beyond React</summary>
- **Team player**
- How to work within a team
- How to perform code reviews
- How to give and receive feedback
- **Efficiency**
- How to prioritise tasks
- How to handle tech debt
- How to meet deadlines and goals
- **Continuous Learning**
- How to continuously learn and grow
- How to stay up to date with your skills
- **Networking & Communication** - Going to meetups or events - Contributing to open source projects - Networking within the company you work in
</details>
| React Developer Roadmap - Beginners to Advanced - 2024 | 2024,docs,javascript,react,tailwindcss,typescript | 2024-03-27T19:39:28Z | 2024-03-27T20:06:38Z | null | 1 | 0 | 3 | 0 | 1 | 9 | null | null | null |
AayushYadavz/JavaScript-Full-Notes | main |
# Javascript Full Notes
Basically in this repo you will find the Javascript topic wise codes with notes on every line of code. Beginner friendly JS notes, you can learn, revise e.t.c.
## 🚀 About Me
I'm currently learning Web Developemt & I'm also doing learn in public on my Twitter [ayushyadavz](https://twitter.com/ayushyadavz).
## Feedback
If you have any feedback, please reach out to us at ayushyadav24nov1234@gmail.com & [ayushyadavz](https://twitter.com/ayushyadavz)
## Extra Notes
### 06 Stack and Heap
![Alt Text](/go_in_readme.md/IMG_20240418_015525_14.jpg)
### 03 Basics / 07 JS execute code
![Alt Text](/go_in_readme.md/WhatsApp%20Image%202024-05-14%20at%2014.25.25_9cce0712.jpg)
![Alt Text](/go_in_readme.md/WhatsApp%20Image%202024-05-14%20at%2014.25.59_0abfe2ed.jpg)
![Alt Text](/go_in_readme.md/WhatsApp%20Image%202024-05-14%20at%2014.26.26_410bbaae.jpg)
| Basically in this repo you will find the Javascript topic wise codes with notes on every line of code. Beginner friendly JS notes, you can learn, revise e.t.c. | es6,javascript,javascript-notes,dom,json,arrays,objects,strings,dates-and-times,functions | 2024-04-13T09:43:58Z | 2024-05-22T10:08:04Z | null | 1 | 0 | 59 | 0 | 1 | 8 | null | null | JavaScript |
zhaohappy/cheap | master | cheap
======
中文 | [English](README_en.md)
![](https://img.shields.io/badge/language-typescript-blue.svg) ![](https://img.shields.io/badge/platform-web%20|%20node-lightgrey.svg) ![license](https://img.shields.io/github/license/zhaohappy/cheap)
### 介绍
cheap 是一个用于 JavaScript 多线程和高性能 WebAssembly 程序开发的工具库
cheap 可以用于浏览器环境和 Node 环境
### 使用
cheap 只能使用 typescript 开发
cheap 目前只能使用 webpack 打包编译,如果你使用了 cheap 那你所使用的相关模块就需要用 webpack 打包,建议使用 webpack 5,更低的版本可能存在无法编译的问题。
cheap 依赖了 [common](https://github.com/zhaohappy/common) 项目,建议将 cheap 和 common 都作为子模块放入项目下的同级目录中。
webpack 配置需要添加 cheap 的插件
```javascript
// 插件位置在 cheap build 目录下面
const CheapPlugin = require('./src/cheap/build/webpack/plugin/CheapPlugin')
{
...
plugins: [
new CheapPlugin({
// 'web' | 'node'
env: 'web',
// 项目根目录,这里表示 webpack.config.js 在项目根目录下面
projectPath: __dirname,
// 需要排除处理的文件匹配
exclude: /__test__/,
// 添加宏定义
defined: {
}
})
]
}
```
```tsconfig.json``` 中添加配置,将 cheap 和 common 目录下面的代码包括进工程
```Javascript
{
"paths": {
...
"cheap/*": ["./src/cheap/*"],
"common/*": ["./src/common/*"]
},
"include": [
"./src/cheap/**/*.ts",
"./src/common/**/*.ts"
],
"exclude": [
// 排除测试文件
"*.test.ts",
"__test__",
"/node_modules/**"
],
"cheap": {
// 可以配置一些宏
"defined": {
}
}
}
```
### 原理
cheap 从如何让 js 和 wasm 之间更好的进行数据传递(特别是复杂的数据结构)这个角度来思考设计的。我们知道当前的 wasm 和 js 之间只能互相传递 number 类型的数据,更复杂的数据结构往往需要做序列化和反序列化,这大大影响了程序的性能,可以说是目前 wasm 在 web 平台上还未流行使用的一个重要原因。
为了解决这个问题,cheap 将 struct 的概念引入 typescript,struct 和 C 中的 struct 概念一致,表示一段内存中的数据结构布局,如此可以在 wasm 和 js 中各自根据布局操作内存,而双方之间传递数据时传递内存的开始位置,也就是 pointer(指针),从而避免了数据的序列化和反序列化的开销。
有了 struct 了我们不仅可以在 wasm 和 js 之间高效的传递数据,还想到目前 js 中多线程编程也面临着无法进行数据共享的问题,如果我们的 struct 是在 SharedArrayBuffer 中,让所有 worker 使用同一个 SharedArrayBuffer,这样所有 worker 都实现了数据共享,不同 worker 之间通过传递指针来高效的进行数据传递。
整体思路总结如下:
1. 实现一个全局的内存分配器 Allocator,它可以分配出给定大小的内存并返回起始地址,可以回收已被分配的内存,这个全局的内存在 Webassembly.Memory 中,称其为 Heap
2. 所有 wasm 模块使用动态链接库的模式来编译,内部要分配内存时使用 1 中实现的 Allocator 来分配,包括 data 段的内存也需要通过 1 中的 Allocator 分配之后动态导入,emscripten 工具有固定的配置来开启这种编译
3. 使用 typescript transformer api 编写一个插件来在编译期间对 ts 代码中的指针访问编译成函数调用
4. 创建 worker 时将当前线程的全局 Heap 传递到创建的 worker 中,并初始化相关配置(这种情况下的 Heap 一定是在 SharedArrayBuffer 之上的)得到多线程数据共享的环境。这要求 Allocator 是要线程安全的。各个线程分配内存由各自线程的 Allocator 负责,它们都在同一个内存上进行分配
如此 wasm 的所有内存在 Heap 中,每个 js worker 分配的内存在 Heap 中,就可以让所有地方都实现了数据共享,wasm 和 wasm 之间是共享的,worker 和 worker 之间是共享的,js 和 wasm 之间是共享的。
### API
#### struct
为了能定义内存布局,cheap 新增了以下基本数据类型
| 类型 | 描述 |
|----------|----------|
| char | 8 位无符号数,标记 C 中的字符串指针
| uint8 | 8 位无符号数
| int8 |8 位有符号数
| uint16|16 位无符号数
| int16| 16 位有符号数
| uint32| 32 位无符号数
| int32| 32 位有符号数
| uint64| 64 位无符号数
| int64| 64 位有符号数
| float| 32 位浮点数
| double、float64| 64 位浮点数
| pointer\<T>| 指针
##### struct 定义
cheap 的 struct 内存布局规则完全和 C 一致,因此 cheap 和 C 可以进行互操作,其他语言一般都有和 C 进行互操作的结构体定义方式。能和 C 互操作,就能和 cheap 互操作
```typescript
// 使用 struct 装饰器来标记一个 struct 定义
@struct
class MyStruct {
a: int8
b: uint32
// 指向 uint8 类型的指针
c: pointer<uint8>
// 类型为 int32,大小为 8 的数组
d: array<int32, 8>
// 类型为 int32 的二维数组
e: array<array<int32, 8>, 8>
// 位域,占 5 bit,类型会影响后面的属性布局
f: bit<int32, 5>
// 内联结构体
g: struct<{
a: uint8
}>
// 内联联合体
h: union<{
a: uint8
b: uint32
}>
// 这个不是内建类型,在布局时会忽略
// 当你使用实例访问时访问的是 js 对象属性
// 使用指针访问会编译报错
i: number
// 可以使用装饰器修饰属性
// 这里表示当宏 ENABLE_XX 开启时会忽略此属性
// 可以在 struct 里面做条件编译
@ignore(defined(ENABLE_XX))
j: int16
}
@struct
class MyStructB {
// 类型为另一个结构体
a: MyStruct
// 指向另一个结构体的指针
b: pointer<MyStruct>
// 指向另一个结构体的二维指针
c: pointer<pointer<MyStruct>>
}
// 结构体可以继承
@struct
class MyStructC extends MyStructB {
d: float
}
// 用 union 装饰器来标记一个 union 定义,union 所有属性共享一段内存,其大小为最大属性成员的大小
@union
class MyUnion {
a: uint8
b: uint32
}
```
##### struct 使用
```typescript
@struct
class MyStruct {
a: int8
b: uint32
}
// 创建结构体实例,第二个参数可以传递初始化数据
// 返回的 myStruct 是一个 proxy 代理的 js 对象
// 每次读写属性时走的 getter 和 setter 逻辑
const myStruct = make(MyStruct, { a: 0, b: 0 })
myStruct.a = 3
myStruct.b = 4
console.log(myStruct.b)
// 销毁实例
unmake(myStruct)
// 创建结构体指针(推荐使用,效率最高)
let myStructPointer: pointer<MyStruct> = malloc(sizeof(MyStruct))
// 指针可以通过属性赋值
myStructPointer.a = 0
myStructPointer.b = 1
// 取值
console.log(myStructPointer.b)
// pa 的类型为 pointer<int8>
// 等于 C 中的 int8* pa = &myStructPointer->a
const pa = addressof(myStructPointer.a)
// 等于 C 中的 int8 va = *pa
const va = accessof(pa)
// 指针可以当成数组取下标
// 等于 accessof(pa + 3)
const aa = pa[3]
// 等于 C 中的 *va = (int8)34
// 由于 js 中函数调用不能是左值,所以加了个 <- 语法
// 但是有个小瑕疵如果两边类型是结构体 ts 会报错,需要用 @ts-ignore 忽略一下
// 或者 pa[0] = static_cast<int8>(34),虽然也很诡异,但不会报错
accessof(pa) <- static_cast<int8>(34)
// 指针可以自增自减,可以和 number 做加法, 两个类型一样的指针可以相减,规则和 C 一样
// + 1 表示指针往后偏移一个指针类型的大小个字节,非 1 个字节
// pointer<uint8>++ 偏移 1 个字节
// pointer<uint64>++ 偏移 8 个字节
pa++
pa--
pa += 8
// 回收内存
free(myStructPointer)
// nullptr 为空指针定义
myStructPointer = nullptr
```
#### 内置函数(全局作用域)
```typescript
/**
* 创建结构体实例
*
* @param struct
* @param init
*/
function make<T>(struct: new (init?: Partial<{}>) => T, init?: Partial<SetOmitFunctions<T>>): T
/**
* 销毁结构体实例
*
* @param target
*/
function unmake<T extends Object>(target: T): void
/**
* 申请大小为 size 字节的内存
* 分配的地址以 8 字节对齐
*
* @param size
*/
function malloc(size: size): pointer<void>
/**
* 分配一块指定数量的内存,并将其初始化为零
*
* @param num 要分配的元素数量
* @param size 每个元素的大小(以字节为单位)
*/
function calloc(num: size, size: size): pointer<void>
/**
* 重新调整已分配内存块的大小
*
* @param address 已分配内存块的指针
* @param size 调整的内存块的新大小(以字节为单位)
*/
function realloc(address: pointer<void>, size: size): pointer<void>
/**
* 堆上分配一块对齐的内存块
*
* @param alignment 内存对齐的要求
* @param size 分配的内存块的大小(以字节为单位)
*/
function aligned_alloc(alignment: size, size: size): pointer<void>
/**
* 释放指定地址的内存
*
* @param address
*/
function free(address: pointer<void>): void
/**
* & 取地址
* 注意只能取内存在 cheap 上的地址,js 栈和堆上的无法取
*/
function addressof<T>(type: T): T extends any[] ? pointer<UnwrapArray<T>> : pointer<T>
/**
* * 解引用(访问指针)
*/
function accessof<T extends (IsBuiltinType<T> extends true ? never : anyptr)>(pointer: T): UnwrapPointer<T>
/**
* 返回 type 所占内存大小
*/
function sizeof(type: any): size
/**
* - 任意指针之间转换
* - uint32 和指针之间转换
* - 任意 builtin 基本类型之间转换,只做编译时类型转换,运行时可能不安全(需要自己确保安全)
* - int8 -> int32 是安全的, int64 -> int32 是不安全的
* - uint8 -> int16 是安全的,uint8 -> int8 可能是不安全的
*/
function reinterpret_cast<T extends (anyptr | BuiltinType)>(target: anyptr | BuiltinType): T
/**
* 基本类型之间强转,不包括指针(类型安全)
* 编译器会做一些处理
* uin8 -> int8 => a >> 0
* int8 -> uint8 => a >>> 0
* uint32 -> int8 => (a & 0xff) >> 0
* int16 -> uint64 => BigInt(a >>> 0)
* uint64 -> int32 => Number(a & 0xffffffffn) >> 0
* uint64 -> int16 => (Number(a & 0xffffn) & 0x80000) ? -(0x10000 - Number(a & 0xffffn)) : Number(a & 0xffffn)
* double -> int64 => BigInt(Math.floor(a))
* float -> int32 => Math.floor(a)
*/
function static_cast<T extends BuiltinType>(target: BuiltinType): T
/**
* 断言
* debug 模式下打开控制台在断言处触发会在此暂停
* release 模式下会把断言语句去掉
*
* @param condition 条件
* @param msg 当断言失败时打印的错误消息
*/
function assert(condition: any, msg?: string): void
/**
* 使用宏定义,会替换为宏定义的值
*
* @param def
*/
function defined<T>(def: T): T
```
#### WebAssembly 模块使用
我们使用 WebAssembly 的目的首先是复用现有的大量 C/C++ 写的基础库,其次是 WebAssembly 带来的性能提升。
目前的 WebAssembly 开发模式都是使用其他语言来开发,然后通过编译工具编译成 wasm 字节码,其中需要的 js 胶水层代码也由编译工具来完成。这给我的感觉是本来 WebAssembly 技术一开始是给 Web 使用的,但它却和 Web 的主角 JavaScript 有一种割裂感,我认为在 Web 平台上应该由 JavaScript 来主导整个程序,这样我们既拥有了 JavaScript 的优点(开发快速、社区大量的库),又可以把其他语言的一些优势引入 Web;而不是让写其他语言的人员主导整个过程让 JavaScript 沦为那些代码看起来丑陋和晦涩难懂的胶水层的运行时代码。JavaScript 作为整个 Web 技术的核心,抛弃它只会把其他语言的缺点引入 Web,而不会成为 1 + 1 > 2 的可能。
所以在 cheap 中我们只需要编译之后的 wasm 字节码,不需要胶水层代码,同时 cheap 提供了一些基础的运行时。这个运行时有内存分配、标准输出(用于日志打印)、atomic、pthread、semaphore。总结就是 wasm 模块应该只负责计算部分,IO 的输入输出和业务逻辑应该由 JavaScript 负责。因为我们的 wasm 模块绝大部分从 C/C++ 编译而来,其同步阻塞的 IO 方式和 Web 异步的方式天生不合,所有将 IO 放进 wasm 内部而用 JavaScript 去模拟一套同步阻塞的运行时都将成为这个系统的致命缺陷。当然你也可以使用编译工具让 wasm 内部支持调用 JavaScript 的异步函数,但它带来的是要么编译产物 wasm 体积变大,性能下降;要么可以使用的场景有很大限制。据我所知 emscripten 支持让 C/C++ 调用 JavaScript 的异步函数,但前提是整个调用链上不能有间接调用。
要在 cheap 上使用 wasm 模块,你需要将你的 wasm 编译成动态链接的方式,下面是一个例子
```shell
emcc -O3 xx.c
-s WASM=1 \
-s FILESYSTEM=0 \
-s FETCH=0 \
-s ASSERTIONS=0 \
-s ALLOW_MEMORY_GROWTH=1 \
-s IMPORTED_MEMORY=1 \
-s INITIAL_MEMORY=17367040 \
-s USE_PTHREADS=0 \
-s MAIN_MODULE=2 \
-s SIDE_MODULE=0 \
-s MALLOC="none" \
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
-o xx.wasm
```
得到 wasm 输出之后,就可以在 cheap 下使用了
```javascript
import compile from 'cheap/webassembly/compiler'
import WebAssemblyRunner from 'cheap/webassembly/WebAssemblyRunner'
import * as config from 'cheap/config'
// resource 可以存入 indexDB 里面,下一次直接取出来用,不用在进行网络请求和编译了
const resource = await compile(
{
source: 'https://xxxx.wasm'
},
{
// 是否在多线程上跑,决定导入的 Memory 是否有 share 标志
enableThread: config.USE_THREADS,
// wasm 模块运行之后需要调用的初始化函数,一般由编译工具生成,emscripten 是下面的一个
initFuncs: ['__wasm_apply_data_relocs']
}
)
const runner = new WebAssemblyRunner(resource)
await runner.run()
// 然后就可以调用 wasm 导出的函数了
runner.call('func_a', 0)
```
#### 多线程
cheap 支持多线程操作,并且让多线程开发变得更加的优雅简单。
##### 线程创建和结束
线程创建和结束函数在 ```cheap/thread/thread.ts``` 中定义
```typescript
/**
* 从一个类创建线程,返回线程句柄,这样可以通过句柄异步调用线程中类成员函数
* 线程创建时会实例化这个类
* 这里目前有一个要求是类的定义和创建线程类的调用不能在同一个文件里面(代码压缩之后可能会将这个类变成了匿名类)
*/
function createThreadFromClass<T, U extends any[]>(entity: new (...args: U) => T, options?: ThreadOptions): {
run: (...args: U) => Promise<Thread<T>>
transfer: (...transfer: Transferable[]) => {
run: (...args: U) => Promise<Thread<T>>
}
}
/**
* 从一个函数创建线程,建议函数定义单独在一个文件
* 线程创建之后会马上运行这个函数,函数返回时线程退出
* 和 C 创建线程一致
*/
function createThreadFromFunction<T extends any[]>(entity: (...args: T) => void, options?: ThreadOptions): {
run: (...args: T) => Promise<Thread<{}>>
transfer: (...transfer: Transferable[]) => {
run: (...args: T) => Promise<Thread<{}>>
}
}
/**
* 从一个模块创建线程,返回线程句柄,这样可以通过句柄异步调用模块内的方法
*/
function createThreadFromModule<T extends Object>(entity: T, options?: ThreadOptions): {
run: () => Promise<Thread<T>>
}
/**
* 强制结束线程
* 可能会导致内存泄漏,请使用 joinThread
*
*/
function closeThread(thread: Thread<{}>): void
/**
* 等待线程退出
* 从函数创建的线程会等待函数返回,并返回函数的返回结果
* 从类和模块创建的线程会在线程内部的下一次事件循环中退出
*/
async function joinThread<T>(thread: Thread<{}>): Promise<T>
```
##### 线程同步
cheap 支持原子操作、锁、条件变量、信号量等线程同步方法。
###### 原子操作
新增原子类型
| 类型 | 描述 |
|----------|----------|
| atomic_uint8 | 8 位无符号数
| atomic_int8 |8 位有符号数
| atomic_uint16|16 位无符号数
| atomic_int16| 16 位有符号数
| atomic_uint32| 32 位无符号数
| atomic_int32| 32 位有符号数
| atomic_uint64| 64 位无符号数
| atomic_int64| 64 位有符号数
原子操作函数在 ```cheap/thread/atomic.ts``` 中定义
```typescript
/**
* 给定的值加到指定位置上
*
* 返回该位置的旧值
*
*/
function add<T extends atomictype>(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 给定的值与指定位置上的值相减
*
* 返回该位置的旧值
*
*/
function sub<T extends atomictype>(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 给定的值与指定位置上的值进行与运算
*
* 返回该位置的旧值
*
*/
function and<T extends atomictype(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 给定的值与指定位置上的值进行或运算
*
* 返回该位置的旧值
*
*/
function or<T extends atomictype(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 给定的值与指定位置上的值进行异或运算
*
* 返回该位置的旧值
*
*/
function xor<T extends atomictype(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 给定的值存在给定位置上
*
* 返回该位置的旧值
*
*/
function store<T extends atomictype(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 读取给定位置上的值
*
* 返回该位置的旧值
*
*/
function load<T extends atomictype>(address: pointer<T>): AtomicType2Type<T>
/**
* 如果指定位置的元素与给定的值相等,则将其更新为新的值,并返回该元素原先的值
*
* 返回该位置的旧值
*
*/
function compareExchange<T extends atomictype>(
address: pointer<T>,
expectedValue: AtomicType2Type<T>,
replacementValue: AtomicType2Type<T>
): AtomicType2Type<T>
/**
* 将指定位置的元素更新为给定的值,并返回该元素更新前的值。
*
* 返回该位置的旧值
*
*/
function exchange<T extends atomictype>(address: pointer<T>, value: AtomicType2Type<T>): AtomicType2Type<T>
/**
* 唤醒等待队列中正在指定位置的元素上等待的线程。返回值为成功唤醒的线程数量。
*
* 返回被唤醒的代理的数量 0 将不会唤醒任何线程
*
*/
function notify(address: pointer<atomic_int32>, count: uint32): uint32
/**
* 检测指定位置上的值是否仍然是给定值,是则保持挂起直到被唤醒
*
* 0 "ok"、1 "not-equal"
*
*/
function wait(address: pointer<atomic_int32>, value: int32): 0 | 1 | 2
/**
* 检测指定位置上的值是否仍然是给定值,是则保持挂起直到被唤醒或超时(毫秒)
*
* 0 "ok"、1 "not-equal" 或 2 "time-out"
*
*/
function waitTimeout(address: pointer<atomic_int32>, value: int32, timeout: int32): 0 | 1 | 2
/**
* 检测指定位置上的值是否仍然是给定值,是则保持挂起直到被唤醒
* 异步非阻塞,适合在主线程上使用
*
* 0 "ok"、1 "not-equal"
*
*/
function waitAsync(address: pointer<atomic_int32>, value: int32): Promise<0 | 1 | 2>
/**
* 检测指定位置上的值是否仍然是给定值,是则保持挂起直到被唤醒或超时
* 异步非阻塞,适合在主线程上使用
*
* 0 "ok"、1 "not-equal" 或 2 "time-out"
*
*/
function waitTimeoutAsync(address: pointer<atomic_int32>, value: int32, timeout: int32): Promise<0 | 1 | 2>
```
###### 锁、条件变量、信号量
锁在 ```cheap/thread/mutex.ts``` 中定义
```typescript
/**
* 初始化锁
*
* @param mutex
*/
function init(mutex: pointer<Mutex>): int32
/**
* 加锁
*
* @param mutex
* @param spin 是否自旋
*/
function lock(mutex: pointer<Mutex>, spin: boolean = false): int32
/**
* 异步加锁
*
* @param mutex
*/
async function lockAsync(mutex: pointer<Mutex>): Promise<int32>
/**
* 释放锁
*
* @param mutex
*/
function unlock(mutex: pointer<Mutex>): int32
/**
* 销毁锁
*
* @param mutex
* @returns
*/
function destroy(mutex: pointer<Mutex>): int32
```
条件变量在 ```cheap/thread/cond.ts``` 中定义
```typescript
/**
* 初始化条件变量
*/
function init(cond: pointer<Cond>, attr: pointer<void>): int32
/**
* 销毁条件变量
*/
function destroy(cond: pointer<Cond>): int32
/**
* 唤醒条件变量上的一个等待线程
*
* @param cond
*/
function signal(cond: pointer<Cond>): int32
/**
* 唤醒条件变量上的所有等待线程
*
* @param cond
*/
function broadcast(cond: pointer<Cond>): int32
/**
* 线程在条件变量处等待
*
* @param cond
* @param mutex
* @returns
*/
function wait(cond: pointer<Cond>, mutex: pointer<Mutex>): int32
/**
* 线程在条件变量处异步等待
*
* @param cond
* @param mutex
*/
async function waitAsync(cond: pointer<Cond>, mutex: pointer<Mutex>): Promise<int32>
/**
* 线程在条件变量处超时等待
*
* @param cond
* @param mutex
* @param timeout 毫秒
*/
function timedWait(cond: pointer<Cond>, mutex: pointer<Mutex>, timeout: int32): int32
/**
* 线程在条件变量处超时异步等待
*
* @param cond
* @param mutex
* @param timeout 毫秒
*/
async function timedwaitAsync(cond: pointer<Cond>, mutex: pointer<Mutex>, timeout: int32): Promise<int32>
```
信号量在 ```cheap/thread/semaphore.ts``` 中定义
```typescript
/**
* 初始化信号量
*
* @param sem
* @param value 信号量初始值
*/
function init(sem: pointer<Sem>, value: uint32): int32
/**
* 生产信号量
*
* @param sem
*/
function post(sem: pointer<Sem>): int32
/**
* 消费信号量
*
* @param sem
*/
function wait(sem: pointer<Sem>): int32
/**
* 消费信号量,不会挂起线程
*
* @param sem
*/
function tryWait(sem: pointer<Sem>): int32
/**
* 消费信号量,并设置一个超时
*
* @param sem
* @param timeout 毫秒
*/
function timedWait(sem: pointer<Sem>, timeout: int32): int32
/**
* 异步消费信号量
*
* @param sem
*/
async function waitAsync(sem: pointer<Sem>): Promise<int32>
/**
* 异步消费信号量,并设置一个超时
*
* @param sem
* @param timeout 毫秒
*/
async function timedWaitAsync(sem: pointer<Sem>, timeout: int32): Promise<int32>
```
##### wasm 模块中使用多线程
在 C/C++ 中使用 cheap/include 下面的 wasmatomic.h 来做原子操作,
使用 wasmpthread.h 来做线程、锁、条件变量相关操作、使用 wasmsemaphore.h 来做信号量相关操作,然后重新编译 wasm 模块在 cheap 中使用即可使用 wasm 多线程。
### 一些建议
- 设计上应该尽量少使用 struct 做数据结构、只在需要在多个线程之间传递和 js 和 wasm 之间传递时使用 struct,其他时候应该使用 js 对象。否则内存泄漏、内存脏写、空悬指针这些问题让人头大。
- 虽然 cheap 提供的 API 可以使用 C 那种同步阻塞的线程调用方式,但我的建议是应当在每个线程都用事件循环的方式做异步开发,这样的好处是一套代码当浏览器不能支持多线程时可以回退到在主线程上也能运行(兼容问题是 Web 无法避开的);并且这样写会让多线程写法变得更简单,你只需要去关注那些需要在不同线程间流转的数据的同步问题,这样的数据用引用计数就可以很好的管理其生命周期,其他时候都可以和写我们熟悉的方式的单线程的 JavaScript 一样。
- 目前有一个项目[libmedia](https://github.com/zhaohappy/libmedia) 使用 cheap 进行开发,如果你想学习 cheap 如何用来开发,可以参考这个项目的使用方法和设计模式。
- [cheap-example](https://github.com/zhaohappy/cheap-example) 是一些使用 cheap 的简单例子。
### 注意
cheap 目前还在研发阶段,尚未在生产环境使用,可能存在一些 bug,请谨慎使用。
目前测试过的 wasm 模块都是从 emscripten 编译而来,cheap 中的 wasm runtime 也是针对 C/C++ 的,其他语言如 Rust 编译来的可能需要自己追加一些导入函数。至于其他带有 GC 的语言则不能使用。
### 开源协议
[MIT](https://opensource.org/licenses/MIT)
版权所有 (C) 2024-现在 赵高兴
Copyright (C) 2024-present, Gaoxing Zhao
| 一个用于多线程和高性能 WebAssembly 程序开发的工具库 | javascript,struct,threads,typescript,wasm,webassembly,atomic,mutex | 2024-04-05T02:36:59Z | 2024-05-23T14:27:55Z | null | 1 | 0 | 39 | 0 | 0 | 8 | null | MIT | TypeScript |
gudzsv/project-syntax-samurais-02 | main |
# This is GOIT "Javascript Team Project"(project-syntax-samurais-02)
### Actions after copy Project from GitHub to local machine
1. Install dependency: `npm install`
2. Start project: `npm run dev`
#### Please create file in root directory to save your pull requests
File name should be: `pullrequests-list.txt`
![alt text](./assets/img/image.png)
> [Maket Figma](https://www.figma.com/file/fww6BUe77KIm14vo9i8Agm/Portfolio?type=design&node-id=2-9&mode=design&t=zcCmVU4iSoP0lhae-0)
> [Technical Task](https://docs.google.com/spreadsheets/d/1azRSKj2AE0FayFVo_DkUqr6e6ZNelDiPhDzbWWYX3uc/edit#gid=0)
> [Trello](https://trello.com/b/uaiWkcM0/blended-js-project)
> [Branch naming link to video](https://www.youtube.com/watch?v=-2lFpVjdXEg&list=PLViULGko0FdhZ99yYnqB64F_4nVyvOPH5&index=14)
![alt text](./assets/img/image-1.png)
> [Work with branches link to video](https://www.youtube.com/watch?v=AJ8B4HhgZlw&list=PLViULGko0FdhZ99yYnqB64F_4nVyvOPH5&index=15)
> [Work with branches conflict link to video](https://www.youtube.com/watch?v=h-ESKO6r7_4&list=PLViULGko0FdhZ99yYnqB64F_4nVyvOPH5&index=17)
## Libraries
> [On Scroll Animation library link](https://michalsnik.github.io/aos/)
**install:**
` npm install aos --save `
**Use:** (all classes see in the web site)
```html
<script>
AOS.init();
</script>
```
> [Accordion library link](https://github.com/michu2k/Accordion)
**install:**
```javascript
npm install accordion-js
```
**Use:**
```javascript
import Accordion from 'accordion-js';
import 'accordion-js/dist/accordion.min.css';
```
> [Swiper library link](https://swiperjs.com/swiper-api)
**install:**
```npm install swiper ```
**Use:**
```javascript
// import Swiper JS
import Swiper from 'swiper';
// import Swiper styles
import 'swiper/css';
const swiper = new Swiper(...);
```
**Example:**
```js
const swiper = new Swiper('.swiper', {
// Optional parameters
direction: 'vertical',
loop: true,
// If we need pagination
pagination: {
el: '.swiper-pagination',
},
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
// And if we need scrollbar
scrollbar: {
el: '.swiper-scrollbar',
},
});
```
> [Izitoast library link](https://izitoast.marcelodolza.com/)
**install:**
`npm install izitoast --save`
**Use:**
```js
import iziToast from "izitoast";
import "izitoast/dist/css/iziToast.min.css";
```
**Example:**
```js
iziToast.show({
title: 'Hey',
message: 'What would you like to add?'
});
```
>[Axios library link](https://axios-http.com/docs/intro)
**install:**
` npm install axios`
**Example:**
```js
axios({
method: 'post',
url: '/user/12345',
data: {
firstName: 'Fred',
lastName: 'Flintstone'
}
});
```
| Javascript Team Project | adaptive-layouts,css3,html5,javascript,js,mobilefirst,responsive | 2024-04-17T13:04:15Z | 2024-05-01T15:38:17Z | null | 10 | 99 | 270 | 0 | 3 | 8 | null | MIT | HTML |
keyurparalkar/json-to-form | main | ## JSON-TO-FORM
This project focuses on demonstrating the Dependency Injection(DI) pattern by transforming a JSON schema into an HTML form.
Here the JSON schema acts a depenedency to the `SchemaRenderer` component. This component requires JSON schema so that it can map over to this object and rendered the required input fields for the form.
This project was also demonstrated at the JSlovers meet-up. You can find the details about the talk below:
- Slides - [Building forms with Dependency Injection pattern in React.pdf](https://github.com/keyurparalkar/json-to-form/files/15064877/Building.forms.with.Dependency.Injection.pattern.in.React.pdf)
- [Talk](https://www.meetup.com/jslovers-pune/events/299433526/)
### Inspiration
I got inspired to make this project when I was debugging a friends react based form. It had a lot of explicit conditional cases based on the specific input field which made that form more resistant to new changes.
I found JSON schema driven form based soltions, which I found to be extensible and easily configurable and testable.
### Approach
- Here is the approach that I took to implement the project:
- Every JSON schema should have the following format/fields so that we can call it a valid schema:
```ts
type TField = {
type: "field";
dataType: "number" | "text" | "email";
fieldName: string;
accessorKey: string;
validation?:
| {
required?:
| {
value: boolean;
message: string;
}
| undefined;
maxLength?:
| {
value: number;
message: string;
}
| undefined;
minLength?:
| {
value: number;
message: string;
}
| undefined;
max?:
| {
value: number;
message: string;
}
| undefined;
min?:
| {
value: number;
message: string;
}
| undefined;
pattern?:
| {
value: string;
message: string;
}
| undefined;
}
| undefined;
};
type GroupFieldType = {
type: "group";
orientation: "horizontal" | "vertical";
fields: (TField | GroupFieldType)[];
};
```
- Check the JSON schema input as per the above type by parsing it with [zod's schema parser](https://zod.dev/?id=basic-usage).
- Next, we pass this schema to `SchemaRenderer` component that renders each `field` type object with the `input` element.
- We make use of the react-hook-form to manage the form state and updates.
- Lastly, we unregister fields from the form state when any field is removed from the schema.
### Advantages
With the help of the DI pattern we are able to easily configure forms. Making changes into the form is a breeze since we only need to change the JSON schema.
Here is a simple example of adding and removing fields
https://github.com/keyurparalkar/json-to-form/assets/14138515/b68e6a97-937b-42e6-9119-d91a21d4765a
You can also add validation to the form from the JSON schema itself:
https://github.com/keyurparalkar/json-to-form/assets/14138515/ab90fedd-02a8-4907-85d1-777be48de710
You can read more about dependency injection pattern in react [here](https://blog.logrocket.com/dependency-injection-react/).
### Libraries
- [react-hook-form](https://react-hook-form.com/)
- [shadcn-ui](https://ui.shadcn.com/)
- [codemirror-react](https://uiwjs.github.io/react-codemirror/)
- [zod](https://zod.dev/)
| A project to demonstrate Dependency Injection Pattern with JSON based HTML forms | codemirror,javascript,jsonforms,react,schema,shadcn-ui,tailwindcss,typescript,zod | 2024-04-17T10:18:44Z | 2024-04-22T15:00:48Z | null | 1 | 0 | 25 | 0 | 1 | 8 | null | null | TypeScript |
Shanisoni/Tic-Tac-Toe-Game | main | # Tic-Tac-Toe Game
Welcome to my Tic-Tac-Toe game project! This README provides an in-depth overview of the project's structure and detailed explanations for HTML, CSS, and JavaScript implementation.
## Overview
This project is a web-based implementation of the classic game Tic-Tac-Toe. Players can engage in matches against each other or challenge the computer. The game offers a user-friendly interface, suitable for players of all skill levels. Whether you're a seasoned player or new to the game, you'll find this digital rendition to be an enjoyable experience.
## Technologies Used
- **HTML (HyperText Markup Language):** HTML serves as the foundation of the game, providing the structure and content. Semantic elements such as `<header>`, `<main>`, and `<footer>` are utilized for layout organization. Additionally, `<div>` elements encapsulate components such as the game board and status display.
- **CSS (Cascading Style Sheets):** CSS enhances the visual presentation of the game, contributing to its overall aesthetic appeal. Selectors target specific elements for styling, utilizing properties such as `background-color`, `font-family`, and `border`. Box model properties including `margin`, `padding`, and `display` are employed to control spacing and layout, ensuring a cohesive design across various screen sizes.
- **JavaScript:** JavaScript introduces interactivity and game logic to the project. Event listeners detect user actions, such as clicks on game cells or button presses, triggering corresponding functions. JavaScript functions manage game initialization, player turns, win detection, and potential computer AI. Conditional statements and loops enforce game rules, guaranteeing a seamless gameplay experience.
## HTML
HTML provides the structural framework for the game, defining the layout and content. Semantic elements ensure clear and meaningful markup, enhancing accessibility and search engine optimization. The use of `<div>` elements facilitates the organization of game components, enabling easy styling and manipulation via CSS and JavaScript.
HTML, or HyperText Markup Language, is the standard markup language used to create and structure web pages. It consists of a series of elements, which define the structure and content of a web page. Each HTML element is surrounded by opening and closing tags, and can contain other elements or text content.
In the Tic-Tac-Toe game, HTML is used to define the layout and structure of the game interface. Semantic HTML elements such as <header>, <main>, and <footer> are used to organize the page into logical sections. The game board itself is created using nested <div> elements, with each cell representing a playable space.
HTML also provides hooks for JavaScript and CSS, linking external files and scripts to the HTML document using <script> and <link> tags. This allows for separation of concerns, with each technology handling its own specific aspects of the game.
## CSS
CSS is responsible for the visual styling of the game, enhancing its aesthetic appeal and user experience. Selectors target specific HTML elements, allowing for precise customization. Properties such as `color`, `font-size`, and `background-image` are utilized to modify element appearance. CSS frameworks or preprocessors may also be employed to streamline development and ensure consistency across different browsers.
CSS, or Cascading Style Sheets, is a style sheet language used to describe the presentation of a document written in HTML. It controls the layout, colors, fonts, and other visual aspects of a web page, allowing designers to create visually appealing and user-friendly interfaces.
In the Tic-Tac-Toe game, CSS is used to define the visual appearance of the game elements. Selectors target specific HTML elements, applying styles such as colors, fonts, borders, and spacing to enhance the overall design. CSS rules can be organized into separate files and linked to the HTML document, providing a clean and modular approach to styling.
CSS also allows for responsive design, enabling the game interface to adapt and scale gracefully across different devices and screen sizes. Media queries can be used to apply different styles based on the device's characteristics, ensuring optimal user experience on both desktop and mobile platforms.
## JavaScript
JavaScript powers the game's interactivity and logic, enabling dynamic behavior and gameplay mechanics. Event listeners capture user input, such as mouse clicks or keyboard presses, initiating corresponding actions. JavaScript functions manage game state, handle player moves, and implement win conditions. Advanced features like animation effects or artificial intelligence may be implemented using JavaScript libraries or frameworks, further enhancing the gaming experience.
JavaScript is a high-level programming language commonly used to create interactive and dynamic web content. It enables developers to add functionality to web pages, respond to user actions, and manipulate the document object model (DOM) in real time.
In the Tic-Tac-Toe game, JavaScript is responsible for implementing the game's logic and interactivity. Event listeners are attached to HTML elements, such as game cells and buttons, to detect user input and trigger corresponding actions. JavaScript functions manage the game state, including player turns, win detection, and game over conditions.
Conditional statements and loops are used to implement game rules and logic, ensuring that players can only make valid moves and that the game progresses correctly. Arrays and data structures may be used to store game state information, such as the current board configuration and player moves.
JavaScript also enables dynamic updates to the game interface, allowing elements to be added, removed, or modified in response to user actions or game events. This creates a seamless and interactive user experience, enhancing player engagement and enjoyment.
Feel free to explore the code files for a deeper understanding of the implementation details! Contributions and feedback are always welcome.
| "Experience the timeless fun of Tic-Tac-Toe! Play against a friend or challenge the computer in this sleek, user-friendly web version. With intuitive controls and stylish design, enjoy endless rounds of strategic gameplay. Simple yet addictive, it's classic entertainment for all ages!" | html,html-css,html-css-javascript,html-template,html5,html5-canvas,html5-css-sass,html5-css3,html5-game,javascript | 2024-03-17T19:15:30Z | 2024-03-17T20:26:02Z | null | 1 | 0 | 5 | 0 | 0 | 8 | null | GPL-3.0 | CSS |
wakhiwemathuthu/nodejs-crud-lesson | main | # Node.js Express App
---
## Description
An Express.js app enabling user authentication and post management, encompassing signup, signin, logout, and full CRUD operations on posts. Data is locally stored using the fs common core module.
## Key Features
1. Authentication: Utilizing JSON Web Tokens (JWT) for secure authentication and authorization.
2. Password Security: Employing bcrypt for enhanced password hashing and authentication.
3. Protected Routes: Access to CRUD operations on posts is restricted, ensuring that only users with valid access tokens can perform these actions.
## Installation
1. Clone this repository to your local machine.
2. Navigate to the project directory in your terminal.
3. Install dependencies by running:
```
npm install
```
4. Create a .env file in the main project directory and add values for PORT , ACCESS_TOKEN_SECRET and REFRESH_TOKEN_SECRET
## Usage
1. Start the server by running:
```
npm start
```
2. Access the application through the endpoints in requests.rest file make sure to install Rest Client extension on VS Code.
3. The server will be running at `http://localhost:8080` by default. | null | bcrypt,cookie-parser,express-middleware,expressjs,javascript,jsonwebtoken,node,nodejs | 2024-04-02T09:24:24Z | 2024-05-05T17:14:30Z | null | 1 | 0 | 38 | 0 | 0 | 8 | null | null | JavaScript |
pondev1031/scrapping-pro | main | null | scrraping project | api-integration,backend,javascript,nodejs,puppeteer,scrapping,typescript | 2024-04-25T10:51:19Z | 2024-04-26T11:33:24Z | null | 1 | 0 | 3 | 0 | 0 | 8 | null | null | null |