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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bosnzt/wordscheck | main | # 敏感词检测API - 私有化部署
提供文本识别、智能鉴黄、涉政检测、谩骂等等 敏感词检测过滤服务,
可部署至本地或云服务器,一键启动,直接服务器本地检测,低网络延迟、内容隐私。
『开箱即用的检测服务』、不限调用次数。
## 简介
+ 敏感词库从大量样本库整理出来,基于NLP算法检测
+ 支持Windows、MacOs、Linux等64位主流系统
+ 可以部署在本地,或部署到阿里云、腾讯云、亚马逊云、谷歌云等云服务器
+ 通过下载部署包,即可一键启动私有化的"敏感词检测 API服务"
+ 支持自动云更新最新词库
+ 支持http json方式或gRPC方式查询
+ 单服务参考查询效率70000次/分钟,同时支持并行服务
+ 支持自定义添加白名单/黑名单词条
+ 服务运行内存100M左右,非常轻便
## 最新版本下载
[Releases下载]
## 应用场景
+ AI智能问答、评论留言、聊天消息、直播弹幕、商品详情 等内容合规检测过滤
+ 应用提审上架、主管部门审核、云平台内容巡查 等监管需要
+ 境内外 产品内容合规需要,可部署到中国香港、新加坡、日本、美国、韩国等
## 演示地址
[坚果墙在线敏感词检测]
## 快速接入文档
[文档地址]
## 敏感词分类
+ 色情:色情传播、x用品、av女优、色情描写、x器官、x行为、色情行为
+ 政治:领导人、官员、政党、国家机关、反动言论、邪教、分裂组织、宗教
+ 暴恐违禁:枪支弹药、警用军用、涉黑涉恶、非法传教、毒品、假钞、刑事行为、违禁品
+ 谩骂:脏话、谩骂、地域攻击
+ 广告:冒充系统、违法买卖、金融广告、赌博、网络广告、广告词
+ 不良价值观:劣迹艺人、负面文化
## 部署(Linux环境示例)
1. 下载*svc*文件夹到服务器,运行
```shell
[root@localhost svc]# ls
blacklist.txt config.ini whitelist.txt wordscheck
[root@localhost svc]# ./wordscheck
```
2. curl测试下服务
```shell
[root@localhost ~]# curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{\"content\":\"他在传播艳情内容\"}" http://localhost:8080/wordscheck
```
curl结果
```json
{
"code": "0",
"msg": "检测成功",
"return_str": "他在传播**内容",
"word_list": [{
"keyword": "艳情",
"category": "色情",
"position": "4-5",
"level": "高"
}]
}
```
config.ini 配置文件
Windows、MacOs部署基本相同
| **运行文件** | **环境说明** |
| ------------ | ------------ |
| wordscheck | Linux环境,常用的服务器x86_64、amd64 |
| wordscheck_arm64 | Linux环境,aarch64、arm64的服务器 |
| wordscheck_win.exe | Windows环境 |
| wordscheck_mac | MacOs环境,intel芯片的电脑 |
## http方式查询
代码示例目录`example/http/`
## rpc方式查询
代码示例目录`example/rpc/`
### 如何调整服务中的敏感词?
blacklist.txt:黑名单,追加新的敏感词到检测服务中
whitelist.txt:白名单,从检测服务中排除某些敏感词
## Docker方式部署
修改Dockerfile,调整系统环境、执行文件;配置config.ini
通过Dockerfile,自行build镜像,自己定个镜像名字
`docker build -t 镜像名字 .`
运行容器
`docker run -p 8080:8080 -d 镜像名字`
[坚果墙在线敏感词检测]:https://www.wordscheck.com
[文档地址]:https://doc.wordscheck.com/docs/docs
[Releases下载]:https://github.com/bosnzt/wordscheck/releases
| 敏感词检测,违禁词过滤,敏感词过滤,敏感词库,一键启动,本地运行,私有化部署,1分钟接入完成,开箱即用,支持docker,支持在线api | golang,java,javascript,python,nodejs,php,sensitive-words-filter,text-filter,textfilter,word-filter | 2023-01-23T07:19:20Z | 2024-05-18T12:49:15Z | 2024-05-18T12:49:15Z | 1 | 0 | 32 | 0 | 58 | 415 | null | null | PHP |
ponlponl123/-Prototype-AIVTuber | main | ![Pattarapong.Dev](https://github.com/ponlponl123/AIVTuber/blob/main/img/PattarapongDev.png)
![InsanityLabs](https://github.com/InsanityLabs/AIVTuber/blob/main/img/Insanity%20Labs.png)
*Translation Engine: [Google Translate](https://translate.google.com/)*
**Project Check List**
- [x] This project is also compatible with NodeJS v16.17.1.
- [x] Better TTS.
- [x] OpenAI ChatGPT.
- [ ] This project is outdated.
# AI VTuber by DevPattarapong & InsanityLabs
this project is in development...
## We currently have 2 versions for this project.
[InsanityLabs (NovaPlayzGames)](https://github.com/ponlponl123/-Prototype-AIVTuber/tree/NovaPlayzGames)
[Originals (Ponlponl123)](https://github.com/ponlponl123/-Prototype-AIVTuber/tree/originals)
* **Character Model by Live2D**
[Live2D Free Material License](https://www.live2d.jp/en/terms/live2d-free-material-license-agreement/)
* **AI Language Model by OpenAI**
[OpenAI Node License](https://github.com/openai/openai-node/blob/master/LICENSE)
![AI VTuber by DevPattarapong](https://github.com/ponlponl123/AIVTuber/blob/main/img/Screenshot.png)
# Installation
**See Install Doc**
[Install Document](https://github.com/InsanityLabs/AIVTuber/blob/main/INSTALL.md)
## VTube Studio API
I'm using the [VTS Desktop Audio Plugin by Lua Lucky](https://lualucky.itch.io/vts-desktop-audio-plugin) to capture the sound and send it as Parameters so that the sides of the character can move.
[Plugins list](https://github.com/DenchiSoft/VTubeStudio)
https://lualucky.itch.io/vts-desktop-audio-plugin
![](https://github.com/ponlponl123/AIVTuber/blob/main/img/Screenshot%202023-01-23%20165939.png)
## node main.js
Finally, if everything goes as expected. You will now be able to run `node main.js` successfully.
| I'm not Neuro-Sama, I'm an artificial intelligence created by DevPattarapong It is currently in development using OpenAI models and Live2D characters. | javascript,nodejs,ai,aws-sdk,devpattarapong,gpt-3,openai,ponlponl123,tts,vtuber | 2023-01-23T13:57:40Z | 2023-04-03T20:14:36Z | null | 2 | 3 | 41 | 7 | 41 | 340 | null | MIT | JavaScript |
Olanetsoft/article-idea-generator | develop | [![Open in GitPod](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/Olanetsoft/article-idea-generator) [![GitHub issues](https://img.shields.io/github/issues/Olanetsoft/article-idea-generator)](https://github.com/Olanetsoft/article-idea-generator/issues)
[![GitHub forks](https://img.shields.io/github/forks/Olanetsoft/article-idea-generator)](https://img.shields.io/github/forks/Olanetsoft/article-idea-generator)
[![GitHub stars](https://img.shields.io/github/stars/Olanetsoft/article-idea-generator)](https://img.shields.io/github/stars/Olanetsoft/article-idea-generator)
[![GitHub watchers](https://img.shields.io/github/watchers/Olanetsoft/article-idea-generator?style=label=Watch)](https://github.com/Olanetsoft/article-idea-generator)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![GitHub repo size](https://img.shields.io/github/repo-size/Olanetsoft/article-idea-generator)](https://github.com/Olanetsoft/article-idea-generator)
## [Article Idea Generator](https://www.articleideagenerator.com/)
This simple tool generates article ideas for your blog or website. It's a great way to get started with your content marketing strategy.
[![Article Idea Generator - I](https://github.com/Olanetsoft/article-idea-generator/assets/45847909/d193b273-e38f-43a9-88ee-2faddb21ea5b)](https://www.articleideagenerator.com/)
[![Article Idea Generator - II](https://github.com/Olanetsoft/article-idea-generator/assets/45847909/cc7c64c0-e623-4026-9155-7e104ec67d61)](https://www.articleideagenerator.com/)
## How to use
1. Go to [https://www.articleideagenerator.com/](https://www.articleideagenerator.com/).
2. Enter any related keyword to the topic you have in mind and click `Enter.` <br>
`Optional`: click on the `Enable SEO & Clickbait feature` to get some ideas that would easily rank on search engines.
3. Four different article ideas will be generated; copy any of the generated article ideas.
4. Paste it into your favorite content editor.
5. Write your article.
6. Publish it.
## How it works
The [OpenAI GPT-3.5 API](https://openai.com/api/) (gpt-3.5-turbo) is used in this application. Based on the user's input, it creates a prompt, sends it to the GPT-3.5 API, and gets the response back to the application.
## Running Project Locally
1. Fork the repo
2. Clone the repo
3. After cloning the repo, go to [OpenAI](https://beta.openai.com/account/api-keys) to make an account and generate your API key
4. Rename the `.env.example` file on the root of the project to `.env`, then paste your API key in the `.env` file
5. Run `npm install` to install all the dependencies
6. Run `npm run dev` to start the project
7. Go to [http://localhost:3000](http://localhost:3000) to see the project running
## Contributing
If you want to contribute to this project, please read the [contributing guide](./CONTRIBUTING.md). If you have any ideas or suggestions, feel free to open an issue or a pull request.
If you like this project, please give it a star ⭐️
## Contributors 💪
Thanks for spending your time helping `Article Idea Generator` grow. Happy Hacking 🍻
[![Contributors](https://contrib.rocks/image?repo=Olanetsoft/article-idea-generator)](https://github.com/Olanetsoft/article-idea-generator/edit/main/README.md)
## Stargazers ⭐️
[![Stargazers](https://git-lister.onrender.com/api/stars/Olanetsoft/article-idea-generator?limit=15)](https://github.com/Olanetsoft/article-idea-generator)
## Acknowledgement
Built with 💗 Inspired by [Nutlope](https://twitter.com/nutlope), powered by [Open AI](https://openai.com/).
| Generate your next article idea with ease. Powered by OpenAI. | article,artificial-intelligence,javascript,nextjs,openai,react,tailwindcss,typescript,vercel,hacktoberfest | 2023-01-25T22:42:16Z | 2023-10-16T23:48:53Z | null | 8 | 58 | 81 | 4 | 55 | 197 | null | null | TypeScript |
soonxf/Firewalld-UI | main | <div align="center">
##### 开源不易,点个 🌟🌟🌟 吧!!!
##### 好人一生平安!!!
</div>
<div align="center">
### Firewalld-UI
</div>
基于 <B>Node.js</B> 适用于 <B>个人服务器</B> 和 <B>NAS</B> 的 <B>Firewalld(防火墙) 界面化</B>,不需要记忆操作命令,更没有 Firewalld 的区域概念,和 iptables 复杂的 表链结构 .界面上点击创建一些规则就可以达到 <B>自动</B> 屏蔽和放行 IP 的目的.
关键词: 小型 个人 微型 防火墙 安装 界面 界面化 图形 图形化 防止攻击 屏蔽 访问记录 屏蔽名单
#### [Gitee 码云 (国内极速)](https://gitee.com/SOONXFGetee/Firewalld-UI)
## 演示环境
> 演示环境没有部署在 linux ,因此很多功能是失效的
### [▶ 点击查看演示(24:00-6:00 服务器关机) ◀](https://340200.xyz:65001)
## 电梯
#### [▶ 部署和运行 ◀](#部署和运行)
#### [▶ 一些问题的解答 ◀](#解答)
#### [▶ 必看:可能会出现的问题 ◀](#问题)
请务必仔细阅读文档...
### 要求
* Linux 系统
* Firewalld 防火墙
* pm2 守护进程管理器
* Node.js (首选 16.18.1,推荐 >= 14.0.0)
脚本会检测安装 除 Firewalld 防火墙外的所有环境,一键部署启动
CentOS7 内置 Firewalld
### 项目介绍和技术栈
---
* 部署启动极其简单,一键 startup.sh 脚本轻松部署
* 前端基于 Vue(element UI), 后端 基于 nodejs(eggjs)
* 修改 element 源码,table 组件增加 defer 延迟加载函数
* vuex 和 数据持久化, pm2 管理和部署项目, pkg 打包前端静态资源
* express 部署前端 https 静态资源,使用 limiter 帽子防护 xss 等攻击
* 使用 jwt 和 浏览器指纹维护前端的登录状态
* 前后端 根据 IP 的限流措施
* 基于 sqlite3 的数据库存储,接口使用事务处理数据
* Linux 防火墙 Firewalld 的使用
* 自动的检测环境和下载所需的依赖
* 自动化屏蔽 IP,可以根据 IP 归属地流量和地点关键词规则屏蔽刻意访问
* 使用 rsa 加密 token 和 指纹等信息
* 自动保存的表格可拖拽宽度配置,所有单元格内容都做了省略处理和 tooltip 提示
* 多种组件大小可供手动调节,多尺寸设备都可兼容
### 目录和文件
* **[shell]:** 自动化脚本目录
* **[secretKey]:** 存放 rsa 密钥,用于加密 token 和 指纹
* **[shell/shell.log]:** 记录自动化脚本的日志
* **[config.json]:** 系统设置,同界面化 系统设置 页面
* **[express]:** 前端根目录
* **[express/ssl]:** 存放 https 证书
* **[express/dist]:** 前端静态资源
* **[express/config.js]:** 前端配置文件
* **[express/config.js.httpPort]:** http 端口
* **[express/config.js.httpsPort]:** https 端口(没有部署 https 证书无法访问)
* **[express/config.js.limiter]:** 前端流量限制配置
* **[express/config.js.proxy.target]:** 代理的后端路径
[▶ 部署 https ◀](#部署https)
> 如 7001 端口被占用,修改 根目录/config/config.prod.js.cluster.listen.port 同步修改 express/config.js.proxy.target 最后面的 端口即可,重启生效
### startup.sh 脚本
> 暖心的自动化脚本,做到了那些功能
* 检测环境 node pm2 Firewalld
* 自动下载 node pm2 ,自动创建 node pm2 软连接
* 检测依赖,并自动下载(node_modules)
* 检测 secretKey 密钥,和自动生成密钥
* 自动检测端口,并自动在防火墙开放项目端口
* 检测开机启动,自动追加开机脚本(/etc/rc.d/rc.local)
* 检测完环境后自动启动前后端服务,默认端口 http:5000,https:5001
> 项目根目录窗口运行
```shell
./shell/startup.sh
```
或者
> 没有执行权限情况下
```shell
chmod -R 777 ./shell/startup.sh && ./shell/startup.sh
```
> 项目出现没有权限
```shell
chmod -R 777 项目根目录
```
### 检测部署
* 前端:启动完成浏览器打开 本机IP:5000(5001)
* 后端:启动完成浏览器打开 本机IP:5000(5001)/api/getPublicKeyFingerprint
* 默认端口 http:5000,https:5001
### 部署和运行
* 克隆项目 或者下载 [releases](https://github.com/soonxf/Micro-Firewall/releases)
* 拷贝解压到 Linux 服务器任意目录
* 项目根目录运行 startup.sh 脚本即部署成功
#### [下载过慢建议使用 Gitee](https://gitee.com/SOONXFGetee/Firewalld-UI/releases)
运行见 startup.sh 脚本 标题
> 注意:
> 部署成功后一定要
* 根目录/secretKey/fingerprint(token) 下面的密钥文件删除重新生成
* 系统设置 重新生成 jwt 密钥 和 captcha 密钥
* 重新生成 JWT 密钥后需要重新修改密码才能登录
[▶ 修改密码 ◀](#合并示例)
#### 手动运行
> 确保 根目录 和 express 的依赖都已经下载完成(node_modules)
* 根目录执行
```
npm run start
```
* express 目录执行
```
node index.js
```
或者安装有 pm2
```
pm2 start index.js --name=HttpServer --exp-backoff-restart-delay=1000
```
### 登录和改密
#### 登录
> 若没有默认用户,登录页手动注册
默认用户名
```
admin
```
默认密码
```
Admin123456@
```
#### 修改密码
步骤
* 进入登录页点击修改密码
* 填入 用户名 新密码 注册口令 JWT 密钥
##### 查看注册口令
> 项目根目录打开终端执行,
>
> Linux 环境下执行,没有自带 sqlite3 环境需要自行下载
>
> 将 你的用户名 (五个汉字)替换为自己注册的用户名,完整复制不要丢失
```shell
echo -e "注册口令:" $(sqlite3 ./database/sqlite-prod.db 'SELECT secret FROM users WHERE username = "你的用户名";')
```
##### 查看 JWT 密钥
> 项目根目录打开 Linux 终端执行,完整复制不要丢失
```shell
echo -e "JWT 密钥:" $(grep secret ./config.json | head -n 1 | awk '{ print $2 }' | sed 's/\"//g')
```
> 注意: 注册口令 和 JWT 密钥 用来修改密码等,妥善保管,切勿泄漏
##### 合并示例
###### 修改密码需要用到 JWT 密钥 和 注册口令
> 复制修改 admin (五个字母)替换为自己注册的用户名,完整复制不要丢失
```shell
echo -e "注册口令:" $(sqlite3 ./database/sqlite-prod.db 'SELECT secret FROM users WHERE username = "admin";') && echo -e "JWT 密钥:" $(grep secret ./config.json | head -n 1 | awk '{ print $2 }' | sed 's/\"//g')
```
### 部署https
* 将证书存储在 express/ssl
* 修改 express/config.js 中的 ssl.key ssl.crt
* 重启生效
> ssl.key ssl.crt 填入文件名即可,不需要路径,空 (表示空 == "") 表示不启用 https
### 问题
### 验证码加载不出来
可能后端未部署成功,解决启动过程中的异常即可.
### libstdc++ 报错
如图
![image](https://raw.githubusercontent.com/soonxf/Micro-Firewall/main/images/1676604602040.jpg)
###### 关键字
> ERROR 24956 nodejs,ER DLOPEN FAILEDError: /lib64/libstdc++.50.6: version "CXXABL 1.3.8' not found
还可以升级系统应该也可以解决哈哈哈哈哈哈...
降低 node 版本 应该也是可以的 建议 node 版本>=14
###### 安装 libstdc++
> 安装 libstdc++ 有风险,建议备份后再尝试
[手动安装 libstdc](https://blog.340200.xyz/2022/12/19/ruan-jian/centos-libstdc.so.6-ruan-lian-jie-ku-sheng-ji/)
### 脚本下载依赖失败
* 删除根目录 node_modules
* 使用 cnpm 下载
```
npm install -g cnpm -registry=https://registry.npm.taobao.org
```
* 创建软连接
```
ln -s node目录/bin/cnpm /usr/local/bin/cnpm
```
如果是 startup.sh 脚本安装的 node , node目录一般在 ./shell/node/node版本号
* 修改 cnpm 镜像
```
cnpm config set registry https://registry.npm.taobao.org
```
* 检查 cnpm 是否安装成功
```
cnpm -v
```
* 下载依赖
```
cnpm install -registry=https://registry.npm.taobao.org
```
### 脚本内替换 node 版本
将 ./shell/node.sh 和 ./shell/pm2.sh 中出现 node-v16.18.1-linux-x64 的地方全部替换为手动下载的 node 名字
[下载 node](https://nodejs.org/dist/)
#### 手动安装 node
[教程:安装 node](https://blog.340200.xyz/2022/11/26/ruan-jian/linux-an-zhuang-node/)
### 手动安装 pm2
[教程:安装 pm2](https://blog.340200.xyz/2022/12/16/ruan-jian/pm2-de-an-zhuang-he-shi-yong/)
-----
### 解答
#### 加入黑名单失败
> 可能已经通过终端方式加入过黑名单(白名单)
>
> 可以通过查看防火墙所有富规则来确定
>
> 任意目录,终端执行
```
firewall-cmd --list-rich-rules
```
#### 开启(关闭)端口失败
> 可能这个端口是范围性端口,目前不支持切换范围性端口的状态
>
> 可以通过查看防火墙所有开放端口来确定
>
> 任意目录,终端执行
```
firewall-cmd --list-ports
```
#### 写入访问日志频繁
* 增加日志间隔时间(这会影响到屏蔽规则中的 频率检测)
* 将 常用的信任的 IP 加入 信任配置 中的 全部信任 列表
> 注意: 如果访问日志当中出现了 本地地址或者回环地址 请手动将其加入 全部信任 列表
#### 生成 token 或者 fingerprint 密钥失败
* 方法一:安装 ssh-keygen 和 openssl 命令
* 方法二:手动生成 rsa 密钥
> 方法二需要用到的密钥文件名和目录
>
> 尽量生成 2048 位及以上的 rsa 密钥
>
> 根目录/secretKey/token PRIVATE-KEY.txt PUBLIC-KEY.txt
>
> 根目录/secretKey/fingerprint PRIVATE-KEY.txt PUBLIC-KEY.txt
#### 解禁时间
解禁时间是屏蔽 IP 可以访问的时间,当现在时间大于解禁时间 当前 IP 就会被解封从而能够访问,屏蔽名单中的状态也会从 屏蔽 置为 允许
#### 系统防火墙状态 和 屏蔽名单状态
系统防火墙状态 是指 通过 firewall-cmd --list-rich-rules 命令是否能够查询到关于此 IP drop 的富规则,其中包含 prefix="Micro-Firewall" 的是本服务写入的屏蔽规则标志.
屏蔽名单状态 是指 当前 IP 是否在 屏蔽名单 列表中查询到此 IP
注意:有些特殊情况下,屏蔽名单状态 和 系统防火墙状态 可能并不会同步,此时以 系统防火墙状态 为准,只有 系统防火墙状态 为 屏蔽 才是真正达到了屏蔽这个 IP 的目的.
#### 屏蔽规则 和 允许规则
屏蔽规则 指的是,访问的 IP 出现规则当中的其中一项条件就会被屏蔽
允许规则 指的是,访问的 IP 出现规则当中的全部条件就会被允许
注意: 屏蔽规则 和 允许规则 的权重,当权重高的规则被满足后面的规则就不会再执行了,越靠上 权重越高,会被优先判断
#### 屏蔽规则 中的 频率检测
频率检测中的时间 如 30分钟 和 100次,指的是 访问日志 在 30分钟内 写入了 100次 一样的 IP (只关注 IP 和 次数,不关注 访问的究竟是那个端口),其中访问日志写入的次数和 系统设置 中的 日志间隔 配置 息息相关
如 系统设置 中的 日志间隔 配置为 30 ,则表示 同一个 IP 在访问同一个端口的情况下 30 秒才会写入记录一次
例:
A 机器只 访问了 80端口 ,则 A 机器在 30 秒内访问 80端口 的记录只会记录一次(无限刷新访问也记录一次),如果 30 秒后再次访问就会再次写入一次
A 机器同时 访问了 80 和 443 端口,则是 同时 写入 80 和 443 的访问记录, 30 秒还在访问,则会再重新写入
#### IP 归属地
IP 归属地查询使用的是 离线归属地查询库 ip2region .因此可能部分地区的 信息不能及时更新,极少情况下存在可能有失真的情况
#### 归属地搜索
归属地的搜索对顺序不敏感,如 安徽 和 徽安 会同样搜索出 归属地为 安徽 的访问日志等,但是对于错别字或者符号等是敏感的,需要注意,输入一些错误字符都可能导致搜索结果差强人意.
#### 时间选择
项目中用到的日期选择都做了禁用处理,其中典型的是关于 屏蔽时间 时分秒的禁止选择,当选择 屏蔽时间 到当天时,最少的选择是大于当前时间的 3 分钟 或者 5 分钟后,因为选择屏蔽一个 IP 到 过去的时间是没有意义的,因此禁止选择.
#### 前后端流量限制
前后端流量都有着一套自己的一套流量限制规则 具体查看 express/config.js.limiter(前端流量限制) 和 系统设置>流量限制 (后端流量限制).
重启可以重置这个时间.
### 意见和建议
> 备注问题
```email
soonxf@dingtalk.com
```
#### 完整启动流程截图
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%90%AF%E5%8A%A8%E6%88%AA%E5%9B%BE.png?raw=true)
#### 部分截图
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/1676831778006.jpg?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/1676831984394.jpg?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/1676832038146.jpg?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20235608.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20235644.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20235740.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20235833.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20235951.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20224802.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20224842.png?raw=true)
![image](https://github.com/soonxf/Micro-Firewall/blob/main/images/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202023-01-23%20225144.png?raw=true) | Node.js 的 Firewalld 界面化,基于 Node.js 适用于 个人服务器 和 NAS 的 Firewalld(防火墙) 界面化,不需要记忆操作命令,更没有 Firewalld 的区域概念,和 iptables 复杂的 表链结构 .界面上点击创建一些规则就可以达到 自动 屏蔽和放行 IP 的目的. | centos,egg,eggjs,element-ui,firewall,javascript,linux,node,nodejs,vue | 2023-01-23T14:02:53Z | 2023-03-11T22:16:39Z | 2023-02-28T11:55:58Z | 1 | 0 | 298 | 4 | 12 | 184 | null | null | JavaScript |
Sairyss/fullstack-starter-template | master | # Full stack starter template
Monorepository TypeScript template for full stack applications.
- Maximized for productivity
- Based on cutting edge technologies
- Follows best practices for project structure, architecture, security
- Includes authentication module
## Libraries/frameworks
This template includes a bunch of libraries to get you up and running quickly and improve your developer experience.
### Frontend
- [React](https://reactjs.org/) - main frontend library
- [Vite](https://vitejs.dev/) - modern and fast build tool
- [React Query](https://react-query-v3.tanstack.com/) - react hooks to facilitate fetching/updating/caching data on the server
- [Zustand](https://github.com/pmndrs/zustand) - easy state-management
- [React router](https://reactrouter.com/en/main) - for routing
- [Cypress](https://www.cypress.io/) - end-to-end testing for your frontend
- [Storybook](https://storybook.js.org/) - build your UI web components in isolation
#### Frontend UI
- [ChakraUI](https://chakra-ui.com/) - UI library that lets you create beautiful interfaces quickly
- [Framer Motion](https://www.framer.com/motion/) - create beautiful motion animations ([compatible with ChakraUI](https://chakra-ui.com/getting-started/with-framer))
- [React Icons](https://react-icons.github.io/react-icons/) - icons for your app
- [React-toastify](https://fkhadra.github.io/react-toastify/introduction) - show notifications when something happens
### Backend
- [Fastify](https://www.fastify.io/) - fast web framework for NodeJS
- [Prisma](https://www.prisma.io/) - new generation ORM for working with relational databases
- [Zod](https://github.com/colinhacks/zod) - TypeScript-first schema validation with static type inference
- [dotenv](https://www.npmjs.com/package/dotenv) - to load your configs from an .env file
- [env-var](https://www.npmjs.com/package/env-var) - validate and sanitize your environmental variables
### Shared libraries
- [tRPC](https://trpc.io/) - Remote Procedure Calls for your TypeScript applications. Move faster by removing the need of a traditional API-layer.
- [NX](https://nx.dev/) - build system with first class monorepo support and powerful integrations
- [Jest](https://jestjs.io/) - testing framework
- [Eslint](https://eslint.org/) - static code analysis for identifying problematic patterns found in your code
## Starting the app
- Clone the repository
- Copy `.env.example` and rename to `.env`
- `npm run docker:env` - setup the database (postgresql) in docker
- `npm install` - install dependencies
- `npm run migrate:dev` - run migrations to create tables
- `npm run backend:dev` - run backend
- `npm run frontend:dev` - run frontend
## Scripts
- `npm run frontend:storybook` - start storybook to develop components in isolation
- `npm run dep-graph` - see dependency graph
- For more commands check `package.json`
- To generate new apps in the monorepo, check out [NX documentation](https://nx.dev/packages/nx/documents/generate).
## Check out my other repositories
- [Domain-Driven Hexagon](https://github.com/Sairyss/domain-driven-hexagon) - Guide on Domain-Driven Design, software architecture, design patterns, best practices etc.
- [Backend best practices](https://github.com/Sairyss/backend-best-practices) - Best practices, tools and guidelines for backend development.
- [System Design Patterns](https://github.com/Sairyss/system-design-patterns) - list of topics and resources related to distributed systems, system design, microservices, scalability and performance, etc.
| Template for full stack applications based on TypeScript, React, Vite, ChakraUI, tRPC, Fastify, Prisma, zod, etc. | chakraui,fullstack,javascript,nodejs,prisma,react,reactjs,template,typescript,backend | 2023-01-23T17:54:04Z | 2023-10-27T15:33:43Z | null | 1 | 1 | 13 | 0 | 27 | 171 | null | null | TypeScript |
klis87/normy | master | ./packages/normy/README.md | Automatic normalization and data updates for data fetching libraries (react-query, swr, rtk-query and more) | ajax,normalisation,react-query,trpc,ajax-request,front-end,javascript,monorepo,single-page-app,typescript | 2023-01-23T19:02:06Z | 2024-04-04T16:38:21Z | 2024-02-13T22:54:15Z | 1 | 4 | 159 | 12 | 3 | 165 | null | MIT | TypeScript |
uinosoft/t3d.js | dev | # ThingJS 3D Engine
[![NPM Package][npm]][npm-url]
![npm-size][npm-size-url]
[![Issues][issues-badge]][issues-badge-url]
[![DeepScan grade][deepscan]][deepscan-url]
[![Discord][discord]][discord-url]
ThingJS 3D Engine (t3d) is a lightweight, web-first, and extendable 3D rendering library. It is used by ThingJS for web3d rendering, but can also be used as a standalone library.
[Examples](https://uinosoft.github.io/t3d.js/examples/) —
[Docs](https://uinosoft.github.io/t3d.js/docs/) —
[Discord](https://discord.gg/urB54PPXc4)
## Import
Use `t3d.js` or `t3d.min.js` in your page:
````html
<script src="t3d.min.js"></script>
````
or import as es6 module:
````javascript
import * as t3d from 't3d.module.js';
````
## Npm
t3d is published on npm. To install, use:
````
npm install t3d --save
````
This will allow you to import t3d entirely using:
````javascript
import * as t3d from 't3d';
````
or individual classes using:
````javascript
import { Scene, Renderer } from 't3d';
````
Since v0.2.0, the JavaScript files in `examples/jsm` can be imported like this:
````javascript
import { OrbitControls } from 't3d/addons/controls/OrbitControls.js';
````
## CDN
* https://unpkg.com/t3d@latest/build/t3d.min.js
* https://unpkg.com/t3d@latest/build/t3d.module.js
* https://cdn.jsdelivr.net/npm/t3d@latest/build/t3d.min.js
* https://cdn.jsdelivr.net/npm/t3d@latest/build/t3d.module.min.js
## Usage
Draw a simple cube:
````javascript
const width = window.innerWidth || 2;
const height = window.innerHeight || 2;
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
document.body.appendChild(canvas);
const gl = canvas.getContext('webgl2', {
antialias: true,
alpha: false
});
const renderer = new t3d.WebGLRenderer(gl);
renderer.setClearColor(0.1, 0.1, 0.1, 1);
const backRenderTarget = new t3d.RenderTargetBack(canvas);
const scene = new t3d.Scene();
const geometry = new t3d.BoxGeometry(8, 8, 8);
const material = new t3d.PBRMaterial();
const mesh = new t3d.Mesh(geometry, material);
scene.add(mesh);
const ambientLight = new t3d.AmbientLight(0xffffff);
scene.add(ambientLight);
const directionalLight = new t3d.DirectionalLight(0xffffff);
directionalLight.position.set(-5, 5, 5);
directionalLight.lookAt(new t3d.Vector3(), new t3d.Vector3(0, 1, 0));
scene.add(directionalLight);
const camera = new t3d.Camera();
camera.position.set(0, 10, 30);
camera.lookAt(new t3d.Vector3(0, 0, 0), new t3d.Vector3(0, 1, 0));
camera.setPerspective(45 / 180 * Math.PI, width / height, 1, 1000);
scene.add(camera);
function loop(count) {
requestAnimationFrame(loop);
mesh.euler.y = count / 1000 * .5; // rotate cube
scene.updateMatrix();
scene.updateRenderStates(camera);
scene.updateRenderQueue(camera);
renderer.setRenderTarget(backRenderTarget);
renderer.clear(true, true, false);
renderer.renderScene(scene, camera);
}
requestAnimationFrame(loop);
````
## Extensions
* [t3d-effect-composer](https://github.com/uinosoft/t3d-effect-composer) - Post Effects extension for t3d.js.
* [t3d-particle](https://github.com/uinosoft/t3d-particle) - This is a particle system developed based on t3d.js.
* [t3d-pano](https://github.com/uinosoft/t3d-pano) - Panorama extension for t3d.
* [t3d-3dtiles](https://github.com/uinosoft/t3d-3dtiles) - A 3dtile extension based on t3d.js.
* [t3d-dynamic-sky](https://github.com/uinosoft/t3d-dynamic-sky) - Dynamic sky addon for t3d.
* [t3d-gaussian-splatting](https://github.com/uinosoft/t3d-gaussian-splatting) - A t3d-based implementation of 3D Gaussian Splatting.
## Contributing
Please make sure to read the [Contributing Guide](./.github/contributing.md) before making a pull request.
[npm]: https://img.shields.io/npm/v/t3d
[npm-url]: https://www.npmjs.com/package/t3d
[npm-size-url]: https://img.shields.io/bundlephobia/minzip/t3d
[issues-badge]: https://img.shields.io/github/issues/uinosoft/t3d.js.svg
[issues-badge-url]: https://github.com/uinosoft/t3d.js/issues
[deepscan]: https://deepscan.io/api/teams/20241/projects/25542/branches/800776/badge/grade.svg
[deepscan-url]: https://deepscan.io/dashboard#view=project&tid=20241&pid=25542&bid=800776
[discord]: https://img.shields.io/discord/1069800954494464043
[discord-url]: https://discord.gg/urB54PPXc4 | ThingJS 3D Engine (t3d) is a lightweight, web-first, and extendable 3D rendering library. | 3d,canvas,javascript,webgl,webxr | 2023-01-20T07:16:47Z | 2024-05-22T03:16:40Z | 2024-05-22T03:16:40Z | 8 | 15 | 216 | 1 | 21 | 161 | null | BSD-3-Clause | JavaScript |
jeandv/my-next-portfolio | main | ![40shots_so](https://github.com/jeandv/my-next-portfolio/assets/90219458/da737d03-e841-4ce0-a9e3-e5f187073412)
⚡My new portfolio with Blog using Next.js 13 + TypeScript, Tailwind CSS and Sanity CMS⚡
I'm a passionate developer with +2 year of work experience in JavaScript/TypeScript, I'm a lover of page design or other things and whenever I can I try to learn new technologies since I discovered programming at 16 years old. I love what I do and I help others with what I can.
I also use in web, mobile and desktop development Next.js, Angular, Ionic and Electron, to add I also have experience working in Backend with Node and in the UX design part with Figma always implementing good practices in prototyping and coding, clean architecture, SOLID principles, pixel perfect and agile methodologies for example such as the SCRUM framework.
I am currently learning the way to be a DevOps, the reason why I am interested in this area is to know something different from programming and at the same time very useful in the present and in the future, in short I take it as an investment in myself in case I have a job that requires this skill.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
## Autor 🤠
· Email: jeanrdev@gmail.com <br>
· [CV](https://rxresu.me/jeandv/cv-jean-rondon) <br>
· [Portfolio](https://jeandv.vercel.app) <br>
· [LinkedIn](https://linkedin.com/in/jeandv) <br>
· [GitHub](https://github.com/jeandv) <br>
· [Whatsapp](https://walink.co/2369d5)
## Website URL 👁🗨
✔ Here! -> [jeandv.vercel.app](https://jeandv.vercel.app)
## Used tech tools 🛠️
· Tailwind CSS <br>
· Framer Motion <br>
· Mantine <br>
· TypeScript <br>
· Next.js <br>
· Sanity <br>
## Used dev tools 🛠️
· ESlint <br>
· Postcss <br>
· Prettier <br>
## Instalation 💻
✔ Follow the steps in: "Getting Started" 👇
## Contact 📧
✔ If you want to contact me you can write me to jeanrdev@gmail.com or to my [LinkedIn](https://www.linkedin.com/in/jeandv/) for inquiries or you can also talk to me by [Whatsapp](https://walink.co/2369d5)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
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.
| 🔺My portfolio + Blog | Next.js 13, TypeScript, Tailwind and Sanity CMS🔺 | blog,javascript,nextjs,portfolio,sanity,tailwindcss,typescript,css,hooks,html | 2023-01-23T06:47:04Z | 2024-03-06T07:40:54Z | null | 1 | 21 | 154 | 0 | 10 | 102 | null | null | TypeScript |
mimiMonads/vixeny | main | null | 🌐 Vixeny: At the forefront of modern web development, Vixeny stands as a runtime-independent, efficiency-driven library dedicated to upholding the principles of functional purity. It's crafted to empower developers with a robust foundation for creating scalable, maintainable, and high-performance web applications. | bun,deno,functional-programming,typescript,javascript,javascript-library,node | 2023-01-20T12:12:16Z | 2024-05-03T10:27:19Z | 2024-03-16T19:53:54Z | 1 | 3 | 330 | 0 | 3 | 95 | null | null | TypeScript |
CrosSt-Chat/CSC-main | main | Since this website is mainly aimed at Chinese users, only Chinese is used in this repository. Thank you for your interest in this project.
# 十字街聊天室
立刻体验:[十字街聊天室](https://crosst.chat/)
十字街聊天室的整体使用逻辑、大多数前端代码和极少数后端代码来自 [hack-chat/main](https://github.com/hack-chat/main/)。
十字街聊天室是一个简单轻小的聊天室网站程序,目前用户可以在十字街聊天室上创建、加入聊天室,聊天室内可以使用 Markdown、LaTeX 等丰富聊天体验。
十字街聊天室正在开发中,欢迎您提 [issue](https://github.com/CrosSt-Chat/CSC-main/issues) 帮助我们开发和改进十字街聊天室。
## 本地测试
### 准备
[Node.js](https://nodejs.org/) 14.0 或更高版本(十字街后端一般在 Node.js 最新 LTS 版本上测试,推荐您使用 Node.js 最新 LTS 版本运行)。
### 安装
1. 克隆本仓库或直接[下载](https://github.com/CrosSt-Chat/CSC-main/archive/refs/heads/main.zip)本仓库的源代码。
2. 进入十字街后端源代码目录(CSC-main),并运行 `npm install` 安装依赖。
3. 运行 `node main.js` 启动十字街后端。
4. 测试十字街后端是否正常运行:to-do
## 部署和配置
to-do
## 贡献
to-do
## 开源协议
十字街聊天室遵循 [GNU Public License v3.0](./LICENSE) 开放源代码。
| A minimal, distraction-free chat application based on Hazel Core and hack.chat. | chat,javascript,nodejs | 2023-01-17T14:58:42Z | 2024-02-05T09:23:10Z | null | 4 | 1 | 73 | 5 | 11 | 64 | null | GPL-3.0 | JavaScript |
anubra266/emoji-palette | main | <div align="center">
<h1>
<br/>
🏇
<br />
emoji-palette
<br />
<br />
</h1>
<sup>
<br />
<br />
<a href="https://www.npmjs.com/package/emoji-palette?style=for-the-badge">
<img src="https://img.shields.io/npm/v/emoji-palette.svg?style=for-the-badge" alt="npm package" />
</a>
<a href="https://www.npmjs.com/package/emoji-palette?style=for-the-badge">
<img src="https://img.shields.io/npm/dw/emoji-palette.svg?style=for-the-badge" alt="npm downloads" />
</a>
<a>
<img alt="NPM" src="https://img.shields.io/npm/l/emoji-palette?style=for-the-badge">
</a>
<a><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/anubra266/emoji-palette?logo=github&style=for-the-badge">
</a>
<br />
Get color palettes for emojis.
</sup>
<br />
<br />
<br />
<br />
<pre>npm i <a href="https://www.npmjs.com/package/emoji-palette">emoji-palette</a></pre>
<br />
<br />
<br />
<br />
<br />
</div>
## Install
```bash
npm i --save emoji-palette
#or
yarn add emoji-palette
#or
pnpm add emoji-palette
```
<div display="flex">
<img width="472" alt="CleanShot 2023-01-24 at 14 50 44@2x" src="https://user-images.githubusercontent.com/30869823/214312255-27b2c925-99f9-4e7e-b7a9-4375d37f7757.png">
<img width="463" alt="CleanShot 2023-01-24 at 14 50 29@2x" src="https://user-images.githubusercontent.com/30869823/214312270-3692ae0d-7a92-4eab-939f-015ce78c7a04.png">
<img width="461" alt="CleanShot 2023-01-24 at 14 50 15@2x" src="https://user-images.githubusercontent.com/30869823/214312282-45fb1271-43cb-411a-ac07-b51956407fad.png">
</div>
## About
Came across some tweets by [Shayan](https://twitter.com/imsh4yy?s=21&t=ETlRoiFLQAAJRfdOAWUkEg) about LogSnag. He put up this amazing UI where gradients were formed based on a selected emoji. I scourged the comments for any hint on how he achieved this, found none, so I decided to create mine.
## How does it work
When you pass in an emoji as a string, it gets drawn unto an html canvas. This allows us to get the image back as a base64 encoded image.
From this, we're able to move through the pixels in the image to get all the relevant colors.
## Usage
```ts
// import generatePalette
import { generatePalette } from "emoji-palette";
// Pass your emoji to this method
const palette = generatePalette("👍");
```
The method returns an array of colors, in their order of luminance.
So you can get the median color in the palette if you need one.
```ts
const dominantColor = palette[Math.floor(palette.length / 2)];
```
Colors are returned as `rgb` strings.
You can see a live demo [here](https://anubra266.github.io/emoji-palette/)
Codesandbox example [here](https://codesandbox.io/p/sandbox/confident-silence-l6cbju)
## Sponsors ✨
Thanks goes to these wonderful people
<p align="center">
<a href="https://patreon.com/anubra266?utm_medium=clipboard_copy&utm_source=copyLink&utm_campaign=creatorshare_creator&utm_content=join_link">
<img src='https://cdn.jsdelivr.net/gh/anubra266/static@main/sponsors.svg'/>
</a>
</p>
| 🏇 Get color palettes from emojis | emoji,color,color-palette,javascript | 2023-01-23T23:39:32Z | 2023-12-06T08:08:21Z | null | 2 | 13 | 34 | 1 | 1 | 58 | null | MIT | TypeScript |
sasoria/astro-microfrontends | main | # astro-microfrontends
This demo takes advantage of EcmaScript Modules (ESM) and url-imports to do client-side composition of microfrontends. Express is used for serving assets, but ideally one would have a dedicated CDN hosting them.
## Features
- ✨ Client-side composition of microfrontends
- 📦 Multiframeworks with Astro Islands
- 🚀 SSG/SSR supported by Astro
## Usage
### Micro frontends
- Build each micro frontend with `npm run build`
- Start each micro frontend with `npm run preview`
For production you would start the node server in the `server` folder, after building.
### Shell
- Build the shell with `npm run build`
- Start the shell with `npm run preview`
## Shared dependencies
Dependencies such as react and react-dom are shared across applications. They are fetched from [esm.sh](https://esm.sh/) and gets cached in the browser, reducing the bundle size. Each app can share other dependencies as well through url imports.
## Recommendations
I've written a few recommendations and best practices. You can read them [here](/RECOMMENDATIONS.md). I also have a section for [questions and answers](/QUESTIONS.md).
## Resources
- An [article](https://medium.com/@sergio.a.soria/setting-up-micro-frontends-with-astro-and-ecma-script-modules-137340d2c520) on the implementation.
- A [shoe shop](https://github.com/ayoayco/shoe-shop) example by Ayo Ayco.
- A [presentation](https://www.youtube.com/watch?v=UQ_C79OyXI4) at require(lx) by Afonso Ramos.
| Client-side composition of microfrontends using Astro | astro,esm,importmaps,javascript,react,ssr,micro-frontends,microfrontends | 2023-01-25T08:46:19Z | 2024-04-17T09:07:44Z | null | 2 | 12 | 73 | 0 | 7 | 55 | null | MIT | JavaScript |
damaisme/react-portfolio-2 | master | # Personal Portfolio Website
This project is one of the results of my journey learning frontend with react.
# Preview
[Live Preview Here](https://dama.ink)
![screencapture-dama-ink-2023-01-24-23_26_46](https://user-images.githubusercontent.com/73756341/214350319-3ff139fa-4150-4488-b6ca-52e2ae2caec3.png)
| Personal Portfolio Website using React JS | frontend,javascript,portfolio,portfolio-website,react,react-portfolio,reactjs | 2023-01-24T14:30:35Z | 2023-06-29T16:05:13Z | null | 1 | 1 | 11 | 0 | 24 | 53 | null | null | JavaScript |
nzbr/pnpm2nix-nzbr | main | # pnpm2nix
Provides a `mkPnpmPackage` function that can be used to build a pnpm package with nix.
The function can be accessed either by importing this repo as a flake input or though `pkgs.callPackage /path/to/this/repo/derivation.nix {}`.
In addition to all arguments accepted by `stdenv.mkDerivation`, the `mkPnpmPackage` function accepts the following arguments:
| argument | description | default |
| ------------------------ | --------------------------------------------------------------------------- | ---------------------------- |
| `src` | The path to the package sources (required) | |
| `packageJSON` | Override the path to `package.json` | `${src}/package.json` |
| `pnpmLockYaml` | Override the path to `pnpm-lock.yaml` | `${src}/pnpm-lock.yaml` |
| `pname` | Override the package name | read from `package.json` |
| `version` | Override the package version | read from `package.json` |
| `name` | Override the combined package name | `${pname}-${version}` |
| `nodejs` | Override the nodejs package that is used | `pkgs.nodejs` |
| `pnpm` | Override the pnpm package that is used | `pkgs.nodejs.pkgs.pnpm` |
| `registry` | The registry where the dependencies are downloaded from | `https://registry.npmjs.org` |
| `script` | The npm script that is executed | `build` |
| `distDir` | The directory that should be copied to the output | `dist` |
| `installInPlace` | Run `pnpm install` in the source directory instead of a separate derivation | `false` |
| `installEnv` | Environment variables that should be present during `pnpm install` | `{}` |
| `noDevDependencies` | Only download and install `dependencies`, not `devDependencies` | `false` |
| `extraNodeModuleSources` | Additional files that should be available during `pnpm install` | `[]` |
| `copyPnpmStore` | Copy the pnpm store into the build directory instead of linking it | `true` |
| `copyNodeModules` | Copy the `node_modules` into the build directory instead of linking it | `false` |
| `extraBuildInputs` | Additional entries for `nativeBuildInputs` | `[]` |
| Build packages using pnpm with nix | javascript,nix,nixos,node,nodejs,pnpm | 2023-01-25T09:38:10Z | 2024-01-31T09:50:32Z | null | 4 | 28 | 52 | 6 | 16 | 47 | null | ISC | Nix |
ShahandFahad/Meta-Front-End-Developer | main | # Meta-Front-End-Developer
About this Professional Certificate
Want to get started in the world of coding and build websites as a career? This certificate, designed by the software engineering experts at Meta—the creators of Facebook and Instagram, will prepare you for a career as a front-end developer.
Upon completion, you’ll get access to the Meta Career Programs Job Board—a job search platform that connects you with 200+ employers who have committed to sourcing talent through Meta’s certificate programs, as well as career support resources to help you with your job search.
In this program, you’ll learn:
1. How to code and build interactive web pages using HTML5, CSS and JavaScript.
2. In-demand design skills to create professional page layouts using industry-standard tools such as Bootstrap, React, and Figma.
3. GitHub repositories for version control, content management system (CMS) and how to edit images using Figma.
4. How to prepare for technical interviews for front-end developer roles.
By the end, you’ll put your new skills to work by completing a real-world project where you’ll create your own front-end web application. Any third-party trademarks and other intellectual property (including logos and icons) referenced in the learning experience remain the property of their respective owners. Unless specifically identified as such, Coursera’s use of third-party intellectual property does not indicate any relationship, sponsorship, or endorsement between Coursera and the owners of these trademarks or other intellectual property.
## Certificates
[ 1: Introduction to Front-End Development](https://coursera.org/share/73f483b63bc0f1b19f32badff052ef0d)
[ 2: Programming with JavaScript](https://coursera.org/share/2046d845ecbe3b93ed17df19c2c33755)
[ 3: Version Control](https://coursera.org/share/8b4e2a468c1cf5b97c9e52d0ce6d3db0)
[ 4: HTML and CSS in depth](https://coursera.org/share/8ff2581000453e5c1c76c33599a1e59a)
[ 5: React Basics](https://coursera.org/share/d0a48c327fbdd7ef14d201ca1f264f7c)
[ 6: Advanced React](https://coursera.org/share/7456bfd176e3845bf7df4fb127245c57)
[ 7: Principles of UX/UI Design](https://coursera.org/share/50a884af9a4b370105b3e8ff267af577)
[ 8: Front-End Developer Capstone](https://coursera.org/share/1dd5645e0942e78a67535c554b19c5f3)
[ 9: Coding Interview Preparation](https://www.coursera.org/learn/coding-interview-preparation/home/week/1?utm_source=link&utm_medium=certificate&utm_content=cert_image&utm_campaign=sharing_cta)
# Specialization Certificate
[Meta Front-End Developer](https://www.coursera.org/account/accomplishments/professional-cert/M5Q6SJJ6V7MW?utm_source=link&utm_medium=certificate&utm_content=cert_image&utm_campaign=sharing_cta&utm_product=prof)
<img src="./Meta Front-End Developer.PNG"
alt="Markdown Monster icon"
style="float: left; margin-right: 10px;" />
## Meta Front End Developer Capstone:
[LittleLemon Using React](https://github.com/ShahandFahad/Little-Lemon.git)
## Meta Back End Developer:
[Meta-Back-End-Developer](https://github.com/ShahandFahad/Meta-Back-End-Developer.git)
## Meta Back End Developer Capstone:
[LittleLemon Using Django and DRF](https://github.com/ShahandFahad/littlelemon.git)
| This certificate, designed by the software engineering experts at Meta—the creators of Facebook and Instagram, will prepare you for a career as a front-end developer. | bootstrap,coding-interviews,coursera,css,front-end,front-end-development,frontend-web,git,github,html | 2023-01-24T17:12:30Z | 2023-07-21T05:34:09Z | null | 1 | 40 | 111 | 0 | 30 | 47 | null | null | JavaScript |
RARgames/4gaBoards | main | # 4ga Boards
![GitHub release (latest by date)](https://img.shields.io/github/v/release/RARgames/4gaBoards?color=orange&style=flat-square)![GitHub](https://img.shields.io/github/license/rargames/4gaBoards?style=flat-square)![GitHub contributors](https://img.shields.io/github/contributors/rargames/4gaboards?style=flat-square)
Kanban boards inspired by discontinued Gitkraken Glo Boards.
![](https://raw.githubusercontent.com/plankanban/planka/master/demo.gif)
We'll work on a **demo** when we finish all tasks from the [#1 issue](https://github.com/RARgames/4gaBoards/issues/1).
## Features
- Create projects, boards, lists, cards, labels and tasks
- Add card members, track time, set a due date, add attachments, write comments
- Markdown support in a card description and comment
- Filter by members and labels
- Customize project background
- Real-time updates
- User notifications
- Internationalization
- Google SSO - We are working on more features!
- Github 2-way sync [Coming soon]
- Github/Microsoft SSO [Coming soon]
## Deploy
There are 2 types of installation:
1. [Dockerized](#1-docker-compose)
2. [Without Docker](#2-without-docker)
### 1. Docker Compose
[![](https://d207aa93qlcgug.cloudfront.net/1.95.5.qa/img/nav/docker-logo-loggedout.png)](https://github.com/RARgames/4gaBoards/pkgs/container/4gaBoards)
- Make sure you have [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) installed and operational.
- Create `docker-compose.yml` based on [the example](https://raw.githubusercontent.com/RARgames/4gaBoards/main/docker-compose.yml). This is the ONLY file you will need. You can create this file on your machine by copying and pasting the content or download it:
```
curl -L https://raw.githubusercontent.com/RARgames/4gaBoards/main/docker-compose.yml -o docker-compose.yml
```
- Edit `BASE_URL` to match your domain name or IP address.
- Edit `SECRET_KEY` with random value. You can generate it by `openssl rand -hex 64`.
- Replace 2 occurrences of `notpassword` with generated db password in `POSTGRES_PASSWORD` and `DATABASE_URL`.
Pull images and start services:
```
docker compose up -d
```
Default url: http://localhost:3000 Demo user: `demo` Demo password: `demo`
### 2. Without Docker
Installing without Docker is a bit more complicated, here's what you need to do:
1. Clone this repository into a directory of your choice. (e.g. `/var/www/4gaBoards`)
```bash
mkdir -p /var/www/4gaBoards
cd /var/www/4gaBoards
git clone https://github.com/RARgames/4gaBoards.git .
```
2. Install dependencies, build client, copy build to the `server` directory.
```bash
npm i
npm run client:build
cp -r client/build server/public
cp client/build/index.html server/views/index.ejs
```
**Note**: You can use `yarn` or `pnpm` instead of `npm`.
3. Configure environment variables.
```bash
cp server/.env.sample server/.env
# Edit .env file (You could use nano, vim, etc.)
nano server/.env
```
**Note**: Before continuing, make sure you have your selected database created and running.
4. Copy start script from the root directory to the `server` directory and start the server.
```bash
cp start.sh server
cd server
./start.sh
```
**Note**: You can use `pm2` or `systemd` to run the server in the background.
Default url: http://localhost:1337 Demo user: `demo` Demo password: `demo`
## [Additional information (Google SSO, Nginx Configuration, Logging, Rotating Logs, Fail2ban, Helm Chart)](https://github.com/RARgames/4gaBoards/blob/main/docs/ADDITIONAL_INFO.md)
## Backup and Restore
Before executing backup/restore scripts, change current directory to the directory where docker-compose is located.
To backup your data use: `./boards-backup.sh`
To restore it use: `./boards-restore.sh 4gaBoards-backup.tgz` You can use any relative path.
When restoring, the password has to match docker-compose password (If you don't remember it, you can set new password in docker-compose, but you have to skip altering the default user in backup.tgz/postgres.sql file e.g. comment line `ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS PASSWORD 'XXX'` before restoring the backup).
## Import from Trello
It's already available in 4ga Boards. Just add a project, then click Import while creating a new board.
## [Migration from Planka](https://github.com/RARgames/4gaBoards/blob/main/docs/MIGRATION.md)
## Development
Clone the repository into a directory of your choice, install dependencies, copy .env:
```
git clone https://github.com/RARgames/4gaBoards.git .
npm i
cp server/.env.sample server/.env
```
Either use a local database or start the provided development database:
```
docker compose -f docker-compose-dev.yml up
```
Edit `DATABASE_URL` in `server/.env` if needed, then initialize the database:
```
npm run server:db:init
```
Start the development server:
```
npm start
```
Demo user: `demo` Demo password: `demo`
## [Contributing](https://github.com/RARgames/4gaBoards/blob/main/docs/CONTRIBUTING.md)
## [Security](https://github.com/RARgames/4gaBoards/blob/main/docs/SECURITY.md)
## Tech stack
- React, Redux, Redux-Saga, Redux-ORM, Semantic UI React, react-beautiful-dnd
- Sails.js, Knex.js
- PostgreSQL
## License
4ga Boards are [MIT licensed](https://github.com/RARgames/4gaBoards/blob/main/LICENSE).
Project was separated from [Planka](https://github.com/plankanban/planka) by [meltyshev](https://github.com/meltyshev) to preserve the MIT license, change project vision, and add some new features.
| The realtime kanban boards for groups | boards,collaboration,kanban,react,trello,agile,docker,javascript,project-management,real-time | 2023-01-17T13:44:59Z | 2024-05-23T09:36:51Z | 2024-05-17T22:42:10Z | 41 | 131 | 778 | 83 | 15 | 46 | null | MIT | JavaScript |
adamghill/dlite | main | <p align="center">
<a href="https://dlitejs.com/"><img src="logo.svg" alt="dlite logo" height="80"/></a>
</p>
<h1 align="center"><a href="https://dlitejs.com/">dlite</a></h1>
<p align="center">A tiny, blazing fast view library that creates reactive Web Components</p>
![npm (tag)](https://img.shields.io/npm/v/dlite/latest.svg?style=flat-square) [![gzip bundle size](http://img.badgesize.io/https://unpkg.com/dlite@latest/dist/dlite.es.js?compression=gzip&style=flat-square)](https://unpkg.com/dlite) ![NPM](https://img.shields.io/npm/l/dlite.svg?style=flat-square) ![GitHub Sponsors](https://img.shields.io/github/sponsors/adamghill?color=blue&style=flat-square)
## 📖 Complete documentation
https://dlitejs.com
## 🧐 Introduction
`dlite` creates `Web Components` and interactive web pages easily without the bloat of big frameworks. It can be effortlessly added into existing HTML pages to create reusable components for web applications. `dlite` is perfect for simple, but dynamic static sites or when you want to progressively upgrade a site without changing too much.
## ⭐ Features
- Seriously tiny: **<10 kB** (**<5 kB** when gzipped)
- No dependencies, no virtual DOM, no JSX, and no build tool required
- Reactive Web Components
- Progressive template language that leverages `template literals`
- Props support
- Computed properties
- Two-way data binding
- Events handling
- Component lifecycle hooks
- Directives (e.g. `if`/`else`, `for`, `style`, `class`)
- Shadow DOM by default with scoped CSS
- Put a script tag in your HTML and _go_ ⚡
It is compatible with all modern browsers that support [`ES2015`/`ES6`](https://caniuse.com/#feat=es6), [`ESM`](https://caniuse.com/?search=esm), and [`Proxy`](https://caniuse.com/#search=proxy).
## 🔧 Installation
The easiest way to use `dlite` is with a script tag.
```html
<script type="module">
import Dlite from '//unpkg.com/dlite';
</script>
```
More [details about installation](https://dlitejs.com/installation/).
## 🔄 Canonical counter example
An example counter component to give you a sense of what `dlite` looks like. See more [examples](https://dlitejs.com/examples/).
```html
<script type="module">
import Dlite from '//unpkg.com/dlite';
Dlite({
el: '#app',
data: {
count: 0
},
up() {
this.data.count++;
},
down() {
this.data.count--;
}
});
</script>
<template id="app">
<h1>{this.count}</h1>
<div>
<button @click="down">Decrease Count</button>
<button @click="up">Increase Count</button>
</div>
</template>
```
## 🙋 FAQ
See the whole FAQ at https://dlitejs.com/faq/.
## 🧠 Related projects
Similar projects to `dlite` are listed on https://unsuckjs.com/.
## 🙌 Acknowledgements
`dlite` is forked from the fantastic work done by [Mardix](https://github.com/mardix) with [Litedom](https://github.com/mardix/litedom).
It includes code from these great libraries:
- https://github.com/bryhoyt/emerj
- https://github.com/sindresorhus/on-change
The lightbulb logo is provided from https://openmoji.org/library/emoji-1F4A1/.
| A tiny, blazing fast view library that creates reactive Web Components | dom,html,javascript,webcomponents,2-way-binding,reactive | 2023-01-22T03:43:19Z | 2023-02-26T15:18:47Z | 2023-02-26T13:29:42Z | 8 | 4 | 164 | 0 | 0 | 45 | null | MIT | JavaScript |
VonHumbolt/RoadBedProject | main | # Road Bed Full Stack Project
Road Bed project is a full stack web application project and it was created with Java Spring Boot and Next.js.
Also, frontend design of project was designed with Tailwind CSS.
## Brief Description of the Project
Road Bed is a project where people can rent a house on a daily basis. Also, people can start earning income
by renting out their homes and they can search for homes in a specific city and between specific dates.
User who wants to rent a house or add a house to his favourites, needs to create an account.
People can view the details of houses. For example, images of house, price, empty dates of house for reservation,
their landlord name and services in the house.
People can also filter houses using category names or cities where the houses are located.
In the house detail page, user can easily select the dates to reserve the house. Then, In payment page,
they can pay the total price with their credit card information.
Users who have an account can view their favourite houses, visited houses and their own houses in the profile page.
They can add a profile picture for their account if they wish. To earn income with renting their houses,
people can add their houses on the Create page. In this page, users can add their house images and other
house details.
## Technologies
<h4>Backend</h4>
<ul>
<li>Java 17</li>
<li>Spring Boot 3</li>
<li>Spring Security</li>
<li>Spring Data MongoDB</li>
<li>MongoDB</li>
<li>Redis</li>
<li>Docker</li>
<li>Jwt</li>
<li>Cloudinary</li>
<li>AOP</li>
<li>Mockito </li>
</ul>
<h4>Frontend</h4>
<ul>
<li>JavaScript</li>
<li>Next.js</li>
<li>Next Auth</li>
<li>Redux</li>
<li>Tailwind CSS</li>
<li>Axios and Interceptors</li>
<li>React Date Range</li>
<li>React Hook Form</li>
<li>React Hot Toast</li>
</ul>
## Usage Of Technologies
<h4>On the Backend Side, </h4>
Java Spring Boot was used for generating Rest Api. MongoDB was used as NoSql database.
In this project, I used N-Layered architecture. In data access layer, Spring Data MongoDB was used to access data
from database. Authorization and authentication processes was provided by Spring Security and Jwt.
When user login, access token and refresh token is generated. I used Redis for 2 purposes in this project:
Storing Refresh Token and Caching. For first purpose, I store refresh token in Redis when user logs in.
If the access token is expired, I use the refresh token stored in Redis to refresh this access token.
As a second goal, Houses, categories and cities are cached using Redis. Redis configuration is in
config package.Also, AOP was used. For logging process, Logging aspect was created and saving, deleting methods were logged.
To upload images on the cloud, Cloudinary Api was used. Cloudinary configuration and ImageServices are in config package.
Unit tests of the business layer is written using Mockito. Unit tests are inside the src/test package.
Docker was used to execute Redis and MongoDB images. For this purpose, docker compose file was generated.
<h4>On the Frontend Side, </h4>
Frontend side was written using JavaScript and Next.js. Server side rendering process is used.
To store the logged in user's session, Next Auth was used. After logged in, Next Auth session was used
to store access token and refresh token. Thus, I access jwt token from anywhere in my components.
As a global state, Redux was preferred. Reservation details are kept in Redux.
For sending post request to backend api, Axios was preferred. Axios Interceptor was used to add access token
to the request header. Also, if access token is expired when response is returned, refresh token request
is automatically sent to refresh access token.
React Date Range was used to select date range for searching and reserving house. For form generating and validation,
React Hook Form was preferred. React Hot Toast was used to notifications.
Tailwind CSS was used for UI and Responsive design of the project.
## How can I use this project?
<p> 1. Clone or Download zip folder of this repository </p>
git clone https://github.com/VonHumbolt/RoadBedProject.git
<p> 2. Create <i> .env </i> file in root folder and paste your cloudinary configuration url.
.env file should look like this:
</p>
CLOUDINARY_URL=cloudinary://api-access....
<p> 3. Run docker compose file for redis and mongo images.
Open cmd in project root folder and type:
</p>
docker compose up -d
<p> 4. Start your backend project with your favourite IDE. </p>
<p> 5. In src/main/road-bed-frontend directory, open cmd and type: </p>
npm install
<p> 6. Start frontend project. </p>
npm run dev
## UI of Project
<h4>Main page</h4>
<img src="app_images/main_page.jpg" />
<img src="app_images/main_page2.jpg" />
<h4>Searched Houses</h4>
<img src="app_images/search.jpg" />
<h4>Filter Houses in the Same Category</h4>
<img src="app_images/small_flats.jpg" />
<h4>House Detail Page</h4>
<img src="app_images/detail.jpg" />
<h4>Payment Page</h4>
<img src="app_images/payment.jpg" />
<h4>Profile Page</h4>
<img src="app_images/profile.jpg" />
<h4>Login Page</h4>
<img src="app_images/login.jpg" />
| Full Stack Java & Next.js App | aop,axios-interceptor,docker,java,javascript,jwt,mockito,mongodb,next-auth,nextjs | 2023-01-22T22:20:06Z | 2023-02-22T11:44:00Z | null | 1 | 0 | 50 | 0 | 6 | 44 | null | null | JavaScript |
Kikobeats/http-compression | master | # http-compression
![Last version](https://img.shields.io/github/tag/Kikobeats/http-compression.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/http-compression.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/http-compression)
[![NPM Status](https://img.shields.io/npm/dm/http-compression.svg?style=flat-square)](https://www.npmjs.org/package/http-compression)
**http-compression** adds compression for your HTTP server in Node.js by:
- No dependencies (< 1kB).
- Express style middleware support.
- Auto detect the best encoding to use (gzip/brotli).
## Install
```bash
$ npm install http-compression --save
```
## Usage
If you are using an Express style framework, you can add it as middlware:
```js
const compression = require('http-compression')
const express = require('express')
express()
.use(compression({ /* see options below */ }))
.use((req, res) => {
// this will get compressed:
res.end('hello world!'.repeat(1000))
})
.listen(3000)
```
Otherwise, just pass `req, res` primitives to it:
```js
const compression = require('http-compression')({ /* see options below */ })
const { createServer } = require('http')
const server = createServer((req, res) => {
compression(req, res)
res.end('hello world!'.repeat(1000))
})
server.listen(3000, () => {
console.log('> Listening at http://localhost:3000')
})
```
## API
The `compression(options)` function returns an Express style middleware of the form `(req, res, next)`.
### Options
#### threshold
Type: `Number`<br>
Default: `1024`
Responses below this threshold (in bytes) are not compressed. The default value of `1024` is recommended, and avoids sharply diminishing compression returns.
#### level
Type: `Number`<br>
Default: `-1`
The compression effort/level/quality setting, used by both Gzip and Brotli. The scale ranges from 1 to 11, where lower values are faster and higher values produce smaller output. The default value of `-1` uses the default compression level as defined by Gzip (6) and Brotli (6).
#### brotli
Type: `boolean`<br>
Default: `true`
Enables response compression using Brotli for requests that support it. as determined by the `Accept-Encoding` request header.
#### gzip
Type: `boolean`<br>
Default: `true`
Enables response compression using Gzip for requests that support it, as determined by the `Accept-Encoding` request header.
#### mimes
Type: `RegExp`<br>
Default: `/text|javascript|\/json|xml/i`
The `Content-Type` response header is evaluated against this Regular Expression to determine if it is a MIME type that should be compressed.
Remember that compression is generally only effective on textual content.
## License
Thanks to [developit](https://github.com/developit) for written the original code implementation for [polka#148](https://github.com/lukeed/polka/pull/148).
**http-compression** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/http-compression/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/Kikobeats/http-compression/contributors).
> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)
| Adding compression (gzip/brotli) for your HTTP server in Node.js. | brotli,compression,express,gzip,https,nodejs,expressjs,javascript,middleware | 2023-01-17T23:33:33Z | 2024-05-07T18:55:40Z | 2024-05-07T18:55:42Z | 2 | 12 | 58 | 0 | 1 | 40 | null | MIT | JavaScript |
MiqeWazowhiskey/real-chat-app | main | # Chat App
### Chat app is a user friendly and well designed real-time chat web application built with ReactJS, TailwindCss and Firebase at large.
| Real time chat app with react and firebase. | firebase,firestore,javascript,reactjs,tailwind | 2023-01-24T00:55:41Z | 2024-02-15T15:53:53Z | null | 1 | 0 | 77 | 0 | 6 | 39 | null | null | JavaScript |
emanuelefavero/next-js | main | # Next JS
A Next.js cheat sheet repository
## Example Projects
| Project | Description |
| ------------------------------------------ | --------------------------------------- |
| [next-js-example-app](next-js-example-app) | A bare-bone example app with local data |
## Table of Contents
- [Create a new Next.js app](#create-a-new-nextjs-app)
- [ESLint](#eslint)
- [Manual Installation](#manual-installation)
- [Folder Structure](#folder-structure)
- [Routing](#routing)
- [Meta tags](#meta-tags)
- [The `_app.js` file](#the-_appjs-file)
- [The `Layout` component](#the-layout-component)
- [Sass](#sass)
- [Tailwind CSS](#tailwind-css)
- [Styled JSX](#styled-jsx)
- [The `_document.js` file](#the-_documentjs-file)
- [The `Image` component](#the-image-component)
- [The `Script` component](#the-script-component)
- [Fetch data](#fetch-data)
- [Example of using `getStaticPaths` and `getStaticProps` together](#example-of-using-getstaticpaths-and-getstaticprops-together)
- [Fetch Data on the client](#fetch-data-on-the-client)
- [SWR](#swr)
- [When to use **Static Generation** v.s. **Server-side Rendering**](#when-to-use-static-generation-vs-server-side-rendering)
- [Dynamic routes](#dynamic-routes)
- [Custom 404 pages](#custom-404-pages)
- [Export Static Site](#export-static-site)
- [API Routes](#api-routes)
- [Check for `development` mode or `production` mode](#check-for-development-mode-or-production-mode)
- [Custom Meta Component](#custom-meta-component)
- [useRouter Hook](#userouter-hook)
- [useRouter Redirect](#userouter-redirect)
- [Redirects](#redirects)
## Create a new Next.js app
```bash
npx create-next-app
```
### Use TypeScript, ESLint and npm
```bash
npx create-next-app --typeScript --eslint --use-npm
```
## ESLint
Add the following to the `.eslintrc.json` file
```json
{
// "extends": ["next/core-web-vitals"]
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@next/next/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 2020
},
"env": {
"es6": true
}
}
```
## Manual Installation
- Add Next.js to your project
```bash
npm install next react react-dom
```
- Add the following scripts to your package.json
```json
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
}
```
## Folder Structure
**Pages folder** - is the only required folder in a Next.js app. All the React components inside pages folder will automatically become routes
> Note: The name of the file will be the route name, use lowercase for the file name and PascalCase for the component name
**Public folder** - contains static assets such as images, files, etc. The files inside public folder can be accessed directly from the root of the application
**Styles folder** - contains stylesheets, here you can add global styles, CSS modules, etc
> Usually `globals.css` is imported in the `_app.js` file
**Components folder** - contains React components
### The `@` alias
The `@` alias is used to import files from the root of the project
```jsx
import Header from '@/components/Header'
```
To use the `@` alias, add the following to the `jsconfig.json` file at the root of the project
```json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["*"]
}
}
}
```
## Routing
- **Link** - is used for client-side routing. It is similar to the HTML `<a>` tag
```jsx
import Link from 'next/link'
export default function Home() {
return (
<div>
<Link href='/about'>About</Link>
</div>
)
}
```
## Meta tags
- **Head** - is used to add meta tags to the page
```jsx
import Head from 'next/head'
export default function Home() {
return (
<div>
<Head>
<title>My page title</title>
<meta name='description' content='Generated by create next app' />
<link rel='icon' href='/favicon.ico' />
</Head>
</div>
)
}
```
> The `Head` component should be placed inside the `Layout` component or inside the `_app.js` file
### Give a different title to each page
- Import the `Head` component and put the `title` tag inside it
## The `_app.js` file
Wrap around each page and here is where you would import global styles and put header and footer components
> Note: You could also put the header and footer components inside the `Layout` component
## The `Layout` component
- Create a `Layout` component and wrap around each page with children prop
```jsx
import Header from '@/components/Header'
import Footer from '@/components/Footer'
export default function Layout({ children }) {
return (
<div>
<Header />
{children}
<Footer />
</div>
)
}
```
- Import the `Layout` component in the `_app.js` file
```jsx
import Layout from '@/components/Layout'
function MyApp({ Component, pageProps }) {
return (
<Layout>
<Component {...pageProps} />
</Layout>
)
}
export default MyApp
```
## Sass
Next.js has built-in support for Sass
- Install `sass`
```bash
npm i -D sass
```
## Tailwind CSS
- Install `tailwindcss`
```bash
npm install -D tailwindcss autoprefixer postcss
```
- Create a `tailwind.config.js` file at the root of the project
```bash
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
```
> Note: If you are using the `src` folder, change the path to `./src/pages/**/*.{js,ts,jsx,tsx}` and `./src/components/**/*.{js,ts,jsx,tsx}`
- Create a `postcss.config.js` file at the root of the project
```bash
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
```
- Add the following to `globals.css`
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
- Import `globals.css` in the `_app.js` file
```jsx
import '@/styles/globals.css'
```
## Styled JSX
Styled JSX is a CSS-in-JS library that allows you to write CSS inside a React component
It has two modes: global and scoped
- **Global** - styles are applied globally to the entire application
```jsx
export default function Home() {
return (
<>
Your JSX here
<style jsx global>{`
p {
color: red;
}
`}</style>
</>
)
}
```
- **Scoped** - styles are applied only to the component
```jsx
export default function Home() {
return (
<>
Your JSX here
<style jsx>{`
p {
color: red;
}
`}</style>
</>
)
}
```
> Note: If in vs-code the syntax highlighting for the `style` tag is not working, you can install the `vscode-styled-components` extension to fix this
>
> Be sure that the curly braces are on the same line as the `style` tag: `<style jsx>{`
>
> No need to use styled jsx if you use other methods like CSS modules or styled components
## The `_document.js` file
Here you can customize the `html` and `body` tags
> For instance you can add a `lang` attribute to the `html` tag
```jsx
import Document, { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html lang='en'>
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
```
> Note: This file will be created if you create a new Next.js app with `npx create-next-app`
## The `Image` component
You can use the `Image` component to add images
> The images will be optimized automatically
```jsx
import Image from 'next/image'
export default function Home() {
return (
<div>
<Image src='/images/profile.jpg' width={144} height={144} />
</div>
)
}
```
> Note: src, width and height are required, alt is recommended
- if you use a remote image, you need to add the domain to the `next.config.js` file
```bash
images: {
domains: ['images.pexels.com'],
},
```
- or in Next.js 12.4.0:
```bash
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'example.com',
port: '',
pathname: '/account123/**',
},
],
},
```
## The `Script` component
You can use the `Script` component to add scripts
```jsx
import Script from 'next/script'
export default function Home() {
return (
<div>
<Script src='https://code.jquery.com/jquery-3.6.0.min.js' />
</div>
)
}
```
> Note: you can add cdn scripts as well as local scripts in the `public` folder
## Fetch Data
Next.js let's you choose how to fetch data for each page. It is advised to use `getStaticProps` for most of the pages and `getServerSideProps` for pages with frequently updated data
- **getStaticProps** - is used to fetch data at build time
> Note: During development with `npm run dev`, `getStaticProps` runs on every request
>
> `getStaticProps` can only be exported from a page. You can't export it from non-page files
```jsx
export async function getStaticProps() {
const res = await fetch('https://.../posts')
const posts = await res.json()
return {
props: {
posts,
},
}
}
```
> `posts` will be passed to the component as a prop:
```jsx
export default function Home({ posts }) {
return (
<div>
{posts.map((post) => (
<h3>{post.title}</h3>
))}
</div>
)
}
```
- **getStaticPaths** - is used to specify dynamic routes to pre-render pages based on data
```jsx
export async function getStaticPaths() {
const res = await fetch('https://.../posts')
const posts = await res.json()
const paths = posts.map((post) => ({
params: { id: post.id },
}))
return { paths, fallback: false }
}
```
> Note: When `fallback` is `false`, any paths not returned by `getStaticPaths` will result in a 404 page
>
> If `fallback` is `true`, then when a user visit a page that is not pre-rendered, Next.js will generate the page on the fly and return it to the user (useful for sites with frequently updated data like a social network)
- **getServerSideProps** - is used to fetch data on the server on each request
```jsx
export async function getServerSideProps(context) {
return {
props: {
// props for your component
},
}
}
```
> `getStaticProps` and `getServerSideProps` have a `context` parameter that contains the url `params` object
>
> You can use this to fetch data for a specific post (e.g. `context.params.id`)
### Example of using `getStaticPaths` and `getStaticProps` together
Use `getStaticPaths` to fetch an array of IDs and use `getStaticProps` to fetch data for each product based on the ID
```jsx
export async function getStaticPaths() {
const res = await fetch('https://.../posts')
const posts = await res.json()
const paths = posts.map((post) => ({
params: { id: post.id },
}))
return { paths, fallback: false }
}
export async function getStaticProps({ params }) {
const res = await fetch(`https://.../posts/${params.id}`)
const post = await res.json()
return {
props: {
post,
},
}
}
```
## Fetch Data on the client
> Sometimes it can be beneficial to fetch data on the client instead of on the server.
>
> For example, you could fetch all the static data on the server and then fetch the dynamic data on the client such as a user-specific data that changes frequently and is not needed for SEO.
- **useEffect** - is used to fetch data on the client
```jsx
import { useEffect, useState } from 'react'
export default function Home() {
const [posts, setPosts] = useState([])
useEffect(() => {
fetch('https://.../posts')
.then((res) => res.json())
.then((data) => setPosts(data))
}, [])
return (
<div>
{posts.map((post) => (
<h3 key={post.id}>{post.title}</h3>
))}
</div>
)
}
```
## SWR
> SWR is a React Hooks library for remote data fetching on the client
>
> You should use it instead of `useEffect`
```jsx
import useSWR from 'swr'
export default function Home() {
const { data, error } = useSWR('api/user', fetch)
if (error) return <div>failed to load</div>
if (!data) return <div>loading...</div>
return (
<>
{data.map((post) => (
<h3 key={post.id}>{post.title}</h3>
))}
</>
)
}
```
## When to use **Static Generation** v.s. **Server-side Rendering**
Use Static Generation whenever possible because it's much faster than Server-side Rendering and the page can be served by CDN.
You should ask yourself:
- Can I pre-render this page ahead of a user's request?
If the answer is yes, then you should choose Static Generation.
- Does the page need to update frequently?
If the answer is yes, then you should choose Server-side Rendering.
You can use Static Generation for many types of pages, including:
- Marketing pages
- Blog posts
- E-commerce product listings
- Help and documentation
You could also skip Server-side Rendering and use client-side JavaScript to fetch data with `useEffect`
## Dynamic Routes
- Create a folder inside the `pages` folder with the name of the dynamic route in square brackets (e.g. `[id]`)
- Create an `index.js` file inside the dynamic route folder
### Dynamic Links
- Create a link with that points to the dynamic route and pass the dynamic value as a prop
```jsx
import Link from 'next/link'
export default function Post({ post }) {
return (
<div>
<Link href='/posts/[id]' as={`/posts/${post.id}`}>
<a>{post.title}</a>
</Link>
</div>
)
}
```
> Note: this is usually done inside a `map` function
### Catch All Routes
Dynamic routes can be extended to catch all paths by adding three dots (...) inside the brackets. For example:
- `pages/posts/[...id].js` matches `/posts/a`, but also `/posts/a/b`, `/posts/a/b/c` and so on.
If you do this, in getStaticPaths, you must return an array as the value of the id key like so:
```jsx
return [
{
params: {
// Statically Generates /posts/a/b/c
id: ['a', 'b', 'c'],
},
},
//...
]
```
And params.id will be an array in getStaticProps:
```jsx
export async function getStaticProps({ params }) {
// params.id will be like ['a', 'b', 'c']
}
```
## Custom 404 pages
- Create a `404.js` file inside the `pages` folder
```jsx
export default function Custom404() {
return <h1>404 - Page Not Found</h1>
}
```
> Note: You can also create a `500.js` file for the server error page
## Export Static Site
Export a static site with `next export`
> Add an npm script to the `package.json` file:
```json
"scripts": {
"export": "next build && next export"
}
```
> Run the script:
```bash
npm run export
```
> The static site will be exported to the `out` folder
>
> You can deploy this folder to any static site host such as GitHub Pages
#### Build a local server to test the static site
- Install `serve`
```bash
npm i -g serve
```
- Run the server
```bash
serve -s out -p 8000
```
## API Routes
You can work with any database in the `pages/api/` folder
> Note: Any API route that is placed inside this folder will be accessible like any other page in Next.js
- Create a folder inside the `pages` folder with the name of the API route (e.g. `api/posts`)
### Work with local data
- Create a `data.js` file at the root of the project
```js
const posts = [
{
id: 1,
title: 'Post 1',
},
{
id: 2,
title: 'Post 2',
},
{
id: 3,
title: 'Post 3',
},
]
```
- Import the data in the API route
```js
import { posts } from '@/data'
```
- Get the data
```js
export default function handler(req, res) {
res.status(200).json(posts)
}
```
> You can now fetch the data as you would with any other API
>
> Note: Next.js needs absolute paths when fetching data
## Check for `development` mode or `production` mode
Since Next.js needs absolute paths when fetching data, you can check if you are in `development` mode or `production` mode
- Create a `config.js` folder at the root of the project with an `index.js` file inside
```js
const dev = process.env.NODE_ENV !== 'production'
export const server = dev ? 'http://localhost:3000' : 'https://yourwebsite.com'
```
- Now you can use `server` as a variable in your code as an absolute path when fetching data
```js
import { server } from '@/config'
export default function handler(req, res) {
fetch(`${server}/api/posts`)
.then((res) => res.json())
.then((data) => res.status(200).json(data))
}
```
## Custom Meta Component
> Note: There is no need to create a custom meta component since we can use the `Head` component from Next.js
A meta component is used to add meta tags to the `head` of the document
- Create a `Meta.js` file inside the `components` folder
```jsx
import Head from 'next/head'
export default function Meta({ title, keywords, description }) {
return (
<Head>
<meta charSet='utf-8' />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<link rel='icon' href='/favicon.ico' />
<meta name='keywords' content={keywords} />
<meta name='description' content={description} />
<title>{title}</title>
</Head>
)
}
```
> Tip: You can also use packages such as `next-seo` for this
- Add `defaultProps` to the `Meta` component so that you don't need to add props to it every time you use it
```jsx
Meta.defaultProps = {
title: 'WebDev News',
keywords: 'web development, programming',
description: 'Get the latest news in web dev',
}
```
- Now you can use the `Meta` component in any page (it is common to use it in the `Layout` component)
```jsx
import Meta from '@/components/Meta'
export default function Layout({ children }) {
return (
<div>
<Meta />
{children}
</div>
)
}
```
### Add a specific title to a page
- Import the `Meta` component in the specific page and pass the title as a prop
```jsx
import Meta from '@/components/Meta'
export default function About() {
return (
<div>
<Meta title='About' />
<h1>Welcome to the About Page</h1>
</div>
)
}
```
##
## useRouter Hook
useRouter is a hook that gives you access to the router object
- Import the `useRouter` hook
```jsx
import { useRouter } from 'next/router'
```
- Use the `useRouter` hook
```jsx
const router = useRouter()
```
- Get the query
```jsx
const router = useRouter()
const { query } = router
```
- Get the query with destructuring
```jsx
const {
query: { id },
} = useRouter()
```
useRouter main properties:
- `pathname` - Current route. That is the path of the page in `pages`
- `route` - Current route with the query string
- `query` - Query string section of URL parsed as an object
- `asPath` - String of the actual path (including the query) shown in the browser
## useRouter Redirect
- Import the `useRouter` hook
```jsx
import { useRouter } from 'next/router'
```
- Use the `useRouter` hook to redirect the user to home page
```jsx
const router = useRouter()
router.push('/')
```
> Note: You can for instance use this hook in a `404` page to redirect the user to the home page after 3 seconds
## Redirects
To redirect a user to another page, you can use `redirects` on `next.config.js`
```js
module.exports = {
async redirects() {
return [
{
source: '/about',
destination: '/',
permanent: false,
},
]
},
}
```
> Note: `permanent: true` will tell the browser to cache the redirect forever. That means that if the user goes to the `/about` page, the browser will redirect the user to the `/` page without making a request to the server
>
> TIP: Do not use `permanent: true` for redirects that are not permanent
### Redirects HTTP status codes
- `308` - Permanent Redirect
- `307` - Temporary Redirect
> Note: `308` replaces `301`, `307` replaces `302`
---
[**Go To Top ⬆️**](#next-js)
| A Next.js cheat sheet repository | cheatsheet,javascript,next,nextjs,react | 2023-01-19T11:31:11Z | 2023-01-28T01:25:50Z | null | 1 | 0 | 31 | 0 | 11 | 38 | null | null | JavaScript |
piotr-rzepa/cloud-resume-challenge | main | # Cloud Resume Challenge
![architecture-diagram](./assets/architecture-diagram.png)
Series of challenges, which deepen AWS knowledge and provide an opportunity to perform technical experience using AWS.
The main goal is to create and deploy the static website hosting a resume of the pretender.
The additional steps include integrating it with database, providing an API, using automation for building, testing and deploying the code and the infrastructure and many others.
Apart from standard objective, most of the steps include optional extensions recommendation. They are different from the core task and focus on practicing concrete set of skills in one of the specific areas.
The area of interest chosen by me to do those extensions if possible is ***DevOps***.
## Table of Contents
- [Cloud Resume Challenge](#cloud-resume-challenge)
- [Table of Contents](#table-of-contents)
- [Benefits of the challenge](#benefits-of-the-challenge)
- [Challenge stages](#challenge-stages)
- [Stage 0 - Certification](#stage-0---certification)
- [Stage 1 - Creating Front End](#stage-1---creating-front-end)
- [1.1 HTML](#11-html)
- [1.2 CSS](#12-css)
- [1.3 JavaScript](#13-javascript)
- [1.4 Static assets](#14-static-assets)
- [1.5 CloudFront](#15-cloudfront)
- [Stage 2 - Building the API](#stage-2---building-the-api)
- [2.1 Database](#21-database)
- [2.2 API](#22-api)
- [2.3 Python](#23-python)
- [Stage 3 - Frontend \& Backend integration](#stage-3---frontend--backend-integration)
- [3.1 Dynamic counter value](#31-dynamic-counter-value)
- [Step 4 - Automation \& CI/CD](#step-4---automation--cicd)
- [4.1 Infrastructure as Code (IaC)](#41-infrastructure-as-code-iac)
- [4.2 CI/CD](#42-cicd)
- [4.3 Monitoring](#43-monitoring)
## Benefits of the challenge
After completing the challenge, the practitioner is able to gain multiple skills, related (but not limited) to AWS ecosystem:
- Software Development (Frontend / Backend perspective)
- IaC (Infrastructure as Code) using CloudFormation, SAM, CDK
- CI/CD (AWS CodeBuild, AWS CodeDeploy, AWS CodePipeline)
- Serverless Architecture on AWS (Lambda, API Gateway, DynamoDB, S3)
- Security (IAM, bucket policies, API authentication/authorization)
- Networking (DNS if using Route53, ALB, Routing/IP traffic if creating own VPCs/subnets)
- many more!
## Challenge stages
### Stage 0 - Certification
First challenge is to complete [AWS Cloud Practitioner](https://aws.amazon.com/certification/certified-cloud-practitioner/) certification exam.\
I [successfully passed](https://www.credly.com/badges/7dd19137-0b34-47b3-8e50-6d3acf195a16/public_url) the exam on 20.01.2023
> **UPDATE 10/2023**: I have recently passed [AWS Certified Solutions Architect – Associate](https://aws.amazon.com/certification/certified-solutions-architect-associate/) exam.\
> Thanks for everyone who supported me on the journey to certification!\
> [Here](https://www.credly.com/badges/f78e6778-b03b-48dd-bde4-5f6b330cdfb2/public_url) you can see my credly badge.
### Stage 1 - Creating Front End
This section is about building the visual representation of resume using plain HTML, CSS and JavaScript (which gets more important at stage 2).
#### 1.1 HTML
The resume should be created using HTML. It does not have to be pretty or contain sublime styling, since the challenge is not about perfect styling and responsive web design.
I've used grid + flex displays to create simple layout two-colum layout:
| Left column | Right column |
| --------------------------------- | ---------------------------------- |
| Cell 10: Introduction section | Cell 11: Social links section |
| Cell 20: Work experience section | Cell 21: Technical skills section |
| Cell 30: Work experience section | Cell 31: Personal projects section |
| Cell 40: Education section | Cell 41: Certificates section |
| Cell 50: Footer section | Cell 51: Footer section |
#### 1.2 CSS
The resume should be just a little styled using *CSS*, to somewhat resemble the actual resume document.
#### 1.3 JavaScript
The resume should include simple JS script for counting number of visitors.\
The first version was using `localStorage` class as a counter storage and then migrated to *AWS DynamoDB* Table for storing the visitors.
#### 1.4 Static assets
The resume contains multiple icons in *SVG* format.\
All of them were downloaded under the [iconmonstr license](https://iconmonstr.com/license/) from [iconmonstr.com](https://iconmonstr.com/share-11-svg/).
#### 1.5 CloudFront
The resume page is accessible only via CloudFront Distribution.\
The S3 Bucket serving the static content has all all public access blocked - [OAC](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) is configured with said S3 bucket as the origin with the bucket only allowing requests from CloudFront OAC.\
The requests from HTTP are redirected to HTTPS.
### Stage 2 - Building the API
This section is about extending local visitor counter (written in JavaScript) to a full API which saves the values in AWS DynamoDB database.
#### 2.1 Database
The visitor counter is saved and retrieved from a single Table in AWS DynamoDB.\
There is a single Item (record) in DynamoDB table, which gets constantly updated when a new visitor opens the page.
| Primary key | Attributes |
| -------------------------- | ---------- |
| Partition key: CounterName | count |
| visitors | 10 |
#### 2.2 API
The JavaScript code is not talking directly to the DynamoDB.\
Instead, Amazon API Gateway is set with one POST route, proxying request to a Lambda function responsible for updating a visitor counter.
![sequence-diagram](./assets/sequence-diagram.png)
#### 2.3 Python
Lambda Function, responsible for handling the business logic of an application (in this case, updating and returning overall visitors count) is written using Python *3.9*, which is the latest runtime version supported by the Lambda [as of writing this section](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) (01.04.2023).
**UPDATE 10.05.2023**: Python runtime upgraded to version 3.10, with back-compatibility support for Python3.9 preserved.
The Python code is tested using `pytest` framework and `moto` library (for mocking AWS resources) and test cases can be found inside `src/backend/tests/` directory.\
All the versions of required frameworks,libraries and plugins for Python are defined in `requirements.txt` in `src/backend/lambda` directory.
### Stage 3 - Frontend & Backend integration
This section is about embedding the value coming from DynamoDB through AWS Lambda into the JavaScript code, making the page dynamically count and display the visitors number.
#### 3.1 Dynamic counter value
The script responsible for retrieving and updating the counter is found in `src/frontend/scripts/visitCounter.js` file.\
It makes an HTTP POST request to the API Gateway endpoint in order to retrieve & update counter value on each DOM load.
### Step 4 - Automation & CI/CD
#### 4.1 Infrastructure as Code (IaC)
All AWS resources are provided via [Terraform](https://www.terraform.io/) wrapper [Terragrunt](https://terragrunt.gruntwork.io/).\
The main usage of Terragrunt in this project is to provide a dynamic backend/providers configuration/ for each resource, thus reducing the code duplication. It also allows for deploying all the resources onto different environments more easily, by creating a set of common configuration options, inherited by all child modules.
- `api_gateway-lambda/` - Contains API Gateway nad Lambda resources. They are placed in a single directory because both have dependencies on each other.
- `dynamodb/` - Contains DynamoDB Table resource definition
- `s3-cloudfront/` - Contains S3 Bucket and CloudFront Distribution, OAC resources. They are placed in a single directory because both have dependencies on each other.
- `sns/` - Contains SNS Topic, which sends an email to admin/operator when the CloudWatch Alarm related to the Api Gateway proxy Lambda function invocation's failure rate goes over 30%
- `cloudwatch/` - Contains CloudWatch Alarm based on a metric query, which computes the % value of erroneous responses from Lambda function, informing the operator through SNS Topic Email subscription when it goes into ALARM state
Because `api_gateway-lambda/` resources have dependency on both `dynamodb/` and `s3-cloudfront/`, you should first deploy the resources from those directories. Enter the corresponding directory and run:
> The Project is natively using S3 Bucket as a backend for storing the state.\
> You should have existing S3 Bucket ready and export its name as a environment variable `export STATE_S3_BUCKET=<NAME OF YOUR BUCKET>`
`terragrunt init`
To download all required providers and modules, then run:
`terragrunt apply`
To see what is being deployed and after confirming the changes, enter `yes` to start the deployment.
> The Python code is archived during the deployment of AWS Lambda. This requires the same Python version to be available locally. I recommend using [pyenv](https://github.com/pyenv/pyenv) to manage multiple Python versions on your system and create a virtual environment with the corresponding version before running Terragrunt. You can see all the Python run-times supported by AWS Lambda [here](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
#### 4.2 CI/CD
To streamline the configuration changes, the deployment is not done manually, but rather executed in an automated manner using GitHub Actions and a dedicated pipeline workflow.\
All steps and stages can be seen in `.github/workflows/pipeline.yaml` file.
The pipeline automatically:
- runs tests for both frontend (Cypress) and backend (Pytest)
- Cypress smoke tests are run AFTER the infrastructure has been successfully deployed
- Backend tests using Pytest library are executed at the beginning of the pipeline and have to pass in order for deployment to proceed
- on success of backend tests:
- Terragrunt init is run to download all providers and modules
- Terragrunt plan is executed and posted as a comment in the Pull Request
- The configuration is applied only, when PR is successfully merged to the `main` branch.
- invalidates the CloudFront cache to allow accessing website with latest features instead of relying on local cache.
- Synchronizes the assets (.html, .css, .img) files which could come up in a PR with S3 bucket.
#### 4.3 Monitoring
An [Amazon CloudWatch Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html) is used to watch a result of a math expression based on Lambda-related metric.\
The metrics calculates the percentage of all Lambda requests which resulted in a failure, for example due to the missing permissions or misconfigured handler. The metrics is computed as follows:
```math
error percentage = (invocations / errors) * 100
```
If the expression goes over 0.3 (30% of Lambda requests have failed within 5 minutes), the alarm goes to ALARM state and informs the administrator using connected [SNS topic](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/US_SetupSNS.html), which has a subscription with an administrator's email as an endpoint.
| Repository containing all the source code, personal notes, diagrams related to the Cloud Resume Challenge. More information about the challenge available at https://cloudresumechallenge.dev/ | aws,python,aws-apigateway,aws-lambda,aws-s3,css,github-actions,html,javascript,terraform | 2023-01-20T22:14:11Z | 2023-11-10T23:06:44Z | null | 1 | 11 | 28 | 2 | 13 | 35 | null | MIT | HCL |
billywojcicki/vexillologist | master | # Vexillologist
[**Vexillologist**](https://billywojcicki.github.io/vexillologist/) is an educational world flags web game inspired by Duolingo.
![screenshot](images/screenshot-game.png)
## How To Play
Identify the country of the flag shown. All 193 [United Nations member states](https://www.un.org/en/about-us/member-states/) flags are included. Identify every flag to complete the game. Don't worry if you don't know them all, the game is designed to teach you the flags you're unfamiliar with as you progress. Navigate to the settings menu to explore alternate game modes.
## Features
- Multiple choice format
- Keyboard shortcuts
- Free response format
- Typos with levenshtein distance <= 2 allowed
- Common name variations accepted, for example:
- "Côte d'Ivoire" accepts "Ivory Coast"
- "Czech Republic" accepts "Czechia"
- "United Arab Emirates" accepts "UAE"
- Capital cities mode
- US states mode
- Player stats
- Shareable summary displayed at the end of the game
- Interactive globe
- Draggable on click and hold
- Color-coded pings display at answer coordinates
- Responsive design
- Optimized for desktop and mobile-friendly
## Credits
- Flag images from [flagpedia.net](https://flagpedia.net/about)
- Interactive globe made with [planetary.js](http://planetaryjs.com/)
- Confetti animation from [mathusummut](https://github.com/mathusummut/confetti.js)
| An educational world flags web game inspired by Duolingo | javascript,vexillology,educational,quiz-game,world-flags,web-design | 2023-01-25T02:02:03Z | 2023-11-15T22:59:21Z | null | 1 | 0 | 22 | 0 | 7 | 35 | null | null | JavaScript |
John-Weeks-Dev/youtube-clone | master | # YouTube Clone (youtube-clone)
### Tutorial series on how to build this
If you'd like a step by step guide on how to build this just **CLICK THE IMAGE BELOW**
[![GO TO JOHN WEEKS DEV TUTORIAL VIDEOS](https://user-images.githubusercontent.com/108229029/220176298-fa25f75f-6025-4b05-83fd-ab0beca61cc5.png)](https://www.youtube.com/watch?v=o-hIuejQzAA)
Come and check out my YOUTUBE channel for lots more tutorials -> https://www.youtube.com/@johnweeksdev
**LIKE**, **SUBSCRIBE**, and **SMASH THE NOTIFICATION BELL**!!!
## App Setup
```
git clone https://github.com/John-Weeks-Dev/youtube-clone.git
composer install
cp .env.example .env
php artisan cache:clear
composer dump-autoload
php artisan key:generate
composer require laravel/breeze vue --dev
php artisan breeze:install vue --ssr
php artisan serve
```
Create the DB
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=youtube-clone
DB_USERNAME=root
DB_PASSWORD=
```
Now migrate your DB
```
php artisan migrate
php artisan db:seed
```
Now run this command to start the project
```
npm i
npm run dev
```
You should be good to go!
# Application Images
![Screenshot 2023-01-28 at 15 01 02](https://user-images.githubusercontent.com/108229029/215254541-900cc6a9-027d-451a-bc7c-202b9daf0b0e.png)
![Screenshot 2023-01-23 at 16 55 05](https://user-images.githubusercontent.com/108229029/214011782-719ff6ca-5307-4942-8ea2-2919e728a904.png)
![Screenshot 2023-01-23 at 16 55 23](https://user-images.githubusercontent.com/108229029/214011851-c528db5f-20d4-416f-852f-6091db17d106.png)
![Screenshot 2023-01-23 at 16 55 44](https://user-images.githubusercontent.com/108229029/214011872-8beb26da-569d-4713-a9f1-ced2c4aa7ffa.png)
![Screenshot 2023-01-23 at 16 55 54](https://user-images.githubusercontent.com/108229029/214011886-31f0546c-d16d-4654-880e-a80cd49f6bdf.png)
![Screenshot 2023-01-23 at 16 56 29](https://user-images.githubusercontent.com/108229029/214011897-31b94863-5394-40da-9e58-738df1d366bb.png)
![Screenshot 2023-01-23 at 16 56 43](https://user-images.githubusercontent.com/108229029/214011917-4a64f552-c809-45dc-aacb-d3caeb1b82bc.png)
![Screenshot 2023-01-23 at 16 56 58](https://user-images.githubusercontent.com/108229029/214011922-a05680ed-f85e-4137-8d2d-ce5b26070ef5.png)
![Screenshot 2023-01-23 at 16 57 47](https://user-images.githubusercontent.com/108229029/214011959-08c523d7-cac7-41a1-890f-4eba1a343dff.png)
![Screenshot 2023-01-23 at 16 57 57](https://user-images.githubusercontent.com/108229029/214011979-546cedb5-45b8-43da-a6f6-50d64376768d.png)
| This is a YouTube Clone made with Vue 3, Laravel, Tailwind CSS, and Inertia JS | laravel,tailwind,tailwindcss,video-uploader-php,videoupload,vue3,vue3-composition-api,vuejs,youtube,youtube-clone | 2023-01-22T08:01:59Z | 2023-02-20T18:13:35Z | null | 1 | 0 | 5 | 0 | 12 | 34 | null | null | PHP |
LostMyCode/redstone-js | master | # RedStoneJS
RedStoneJS is a port of "RED STONE ONLINE" to HTML5 (web)
無料オンラインゲーム「RED STONE」をWEBに移植するプロジェクト
![image](https://user-images.githubusercontent.com/63048878/218090436-f658501e-6b25-4191-924f-de1d788712d5.png)
**Main demo page: <https://rs.sigr.io>**
Overview
--------
This project is designed to port the Red Stone Online to HTML5 (to make it available on browsers and mobiles)
Red Stone is 2D Fantasy MMORPG set in the fantasy world of Prandel.
As you can see in the demo, only basic features are implemented and is still under development.
If you're a dev and curious about our project, feel free to join us!
- [Twitter (@LostMyCode)](https://twitter.com/LostMyCode)
- [Issues](https://github.com/LostMyCode/redstone-js/issues)
- [Discord Server](https://dc.sigr.io)
Try it out now!
--------
![rs-web-showcase](https://user-images.githubusercontent.com/63048878/218094281-95e9a996-4cc3-4e03-93d4-5d7892fdfb07.gif)
Online demo page is available: <https://rs.sigr.io>
| RedStoneJS: A port of "RED STONE ONLINE" to HTML5 / 無料オンラインゲーム「RED STONE」をWEBに移植するプロジェクト | reverse-engineering,porting-game,javascript,gamedev,game | 2023-01-23T18:50:13Z | 2024-03-31T16:43:58Z | null | 1 | 10 | 223 | 2 | 7 | 33 | null | null | JavaScript |
kalushko26/obsidian | main | # Quartz v4
> “[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” — Richard Hamming
Quartz is a set of tools that helps you publish your [digital garden](https://jzhao.xyz/posts/networked-thought) and notes as a website for free.
Quartz v4 features a from-the-ground rewrite focusing on end-user extensibility and ease-of-use.
**If you are looking for Quartz v3, you can find it on the [`hugo` branch](https://github.com/jackyzha0/quartz/tree/hugo).**
🔗 Read the documentation and get started: https://quartz.jzhao.xyz/
[Join the Discord Community](https://discord.gg/cRFFHYye7t)
## Sponsors
<p align="center">
<a href="https://github.com/sponsors/jackyzha0">
<img src="https://cdn.jsdelivr.net/gh/jackyzha0/jackyzha0/sponsorkit/sponsors.svg" />
</a>
</p>
| Библиотека знаний по веб-разработке. В ближайшие дни ожидается релиз сайта | css,html,javascript,react,scss,git,redux,eslint,prettier,typescript | 2023-01-17T12:38:40Z | 2024-01-20T15:22:57Z | null | 2 | 0 | 2 | 0 | 5 | 32 | null | MIT | null |
tsparticles/astro | main | [![banner](https://particles.js.org/images/banner3.png)](https://particles.js.org)
# astro-particles
[![npm](https://img.shields.io/npm/v/astro-particles)](https://www.npmjs.com/package/astro-particles) [![npm](https://img.shields.io/npm/dm/astro-particles)](https://www.npmjs.com/package/astro-particles) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni)
Official [tsParticles](https://github.com/matteobruni/tsparticles) Astro component
[![Slack](https://particles.js.org/images/slack.png)](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI) [![Discord](https://particles.js.org/images/discord.png)](https://discord.gg/hACwv45Hme) [![Telegram](https://particles.js.org/images/telegram.png)](https://t.me/tsparticles)
[![tsParticles Product Hunt](https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=186113&theme=light)](https://www.producthunt.com/posts/tsparticles?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-tsparticles") <a href="https://www.buymeacoffee.com/matteobruni"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a beer&emoji=🍺&slug=matteobruni&button_colour=5F7FFF&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00"></a>
## Installation
```shell
npm install astro-particles
```
or
```shell
yarn add astro-particles
```
## How to use
```astro
---
import Particles from "astro-particles"
import type { ISourceOptions } from "tsparticles-engine";
const options: ISourceOptions = {
background: {
color: "#000"
},
fullScreen: {
zIndex: -1
},
particles: {
number: {
value: 100
},
move: {
enable: true
}
}
};
---
<script>
import { type Container, type Engine, tsParticles } from "tsparticles-engine";
import { loadFull } from "tsparticles";
// the function name is the parameter passed to the init attribute
// required
// add the function to window is mandatory, it will be searched there
window.particlesInit = async function (engine: Engine) {
await loadFull(engine);
}
// the function name is the parameter passed to the loaded attribute
// optional
// add the function to window is mandatory, it will be searched there
window.particlesLoaded = function (container: Container) {
console.log("particlesLoaded callback");
}
</script>
<Particles id="tsparticles" options={options} init="particlesInit" />
```
### Props
| Prop | Type | Definition |
|---------|--------|------------------------------------------------------------------------|
| id | string | The id of the element. |
| init | string | The name of the function to call when the particles instance is ready. |
| loaded | string | The name of the function to call when the particles are loaded. |
| options | object | The options of the particles instance. |
| url | string | The remote options url, called using an AJAX request |
#### particles.json
Find all configuration
options [here](https://particles.js.org/docs/interfaces/tsParticles_Engine.Options_Interfaces_IOptions.IOptions.html).
You can find sample json
configurations [here](https://github.com/matteobruni/tsparticles/tree/main/websites/particles.js.org/presets) 📖
## Demos
Preset demos can be found [here](https://particles.js.org/samples/presets/index.html)
There's also a CodePen collection actively maintained and updated [here](https://codepen.io/collection/DPOage)
Report bugs and issues [here](https://github.com/matteobruni/tsparticles/issues)
[tsParticle Website](https://particles.js.org)
| tsParticles Astro official component | astro,hacktoberfest,javascript,tsparticles,typescript | 2023-01-25T08:26:39Z | 2023-10-29T14:54:09Z | null | 1 | 17 | 19 | 4 | 3 | 32 | null | MIT | Astro |
kylekce/CS50x-2023 | main | # CS50x 2023
#### *CS50’s Introduction to Computer Science*
Harvard University’s introduction to the intellectual enterprises of computer science and the art of programming. This repository contains all of Kyle Español's projects and files made for the course.
- [Week 0 Scratch](https://github.com/kylekce/CS50x-2023/tree/main/Week%200)
- [Week 1 C](https://github.com/kylekce/CS50x-2023/tree/main/Week%201)
- [Week 2 Arrays](https://github.com/kylekce/CS50x-2023/tree/main/Week%202)
- [Week 3 Algorithms](https://github.com/kylekce/CS50x-2023/tree/main/Week%203)
- [Week 4 Memory](https://github.com/kylekce/CS50x-2023/tree/main/Week%204)
- [Week 5 Data Structures](https://github.com/kylekce/CS50x-2023/tree/main/Week%205)
- [Week 6 Python](https://github.com/kylekce/CS50x-2023/tree/main/Week%206)
- [Week 7 SQL](https://github.com/kylekce/CS50x-2023/tree/main/Week%207)
- [Week 8 HTML, CSS, JavaScript](https://github.com/kylekce/CS50x-2023/tree/main/Week%208)
- [Week 9 Flask](https://github.com/kylekce/CS50x-2023/tree/main/Week%209)
- [Final Project](https://flashcodes.fun)
_*Please note that this repository serves as a storage space for my projects and files completed for Harvard University's CS50x course. It is not intended to be used as a source of answers or to encourage academic dishonesty. If you are currently enrolled in the course, please refer to the course materials and complete the assignments on your own*_
| Harvard University’s introduction to the intellectual enterprises of computer science and the art of programming. This repository contains all of Kyle Español's projects and files made for the course. | c,computer-science,cs50,cs50course,cs50courseproblemsets,cs50problemsets,cs50problemsetssolved,cs50x,python,sqlite3 | 2023-01-21T10:42:16Z | 2023-09-23T05:53:14Z | null | 1 | 0 | 58 | 0 | 6 | 30 | null | null | C |
klaus-2/Hope-Public | main | <!-- LOGO -->
<br />
<div align="center">
<a href="https://github.com/klaus-2/Hope-Public">
<img src="https://cdn.discordapp.com/avatars/901243176814276680/0b216cbe24f1dde9e901d95c1f59c5ad.png" alt="Logo" width="80" height="80">
</a>
<h3 align="center"> Hope Bot - Public version </h3>
<p align="center">
<a href="https://hopebot.top">View Demo</a>
</p>
</div>
---
<p align="center"><strong>This is the code currently used by my Discord bot.
I realized that Hope wasn't going anywhere, so I decided to release the source code. However, I will not be providing support, and if you want to use a version of Hope, you are on your own in this adventure.
Feel free to use any part of this repository, although providing some credit (such as a link to my GitHub or this repository, or a star for the repository) will be greatly appreciated.</strong></p>
---
<div id="top"></div>
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
<!-- ABOUT THE PROJECT -->
## About The Project
[![FindBots Homepage Preview][product-screenshot]](#)
<p align="center">(<a href="github-images">More screenshots</a>)</p>
Hope is a Discord bot that has been growing slowly, it has several features such as moderation system, tickets, language system, music, event logs and several commands for user interaction.
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- GETTING STARTED -->
## Getting Started
### Prerequisites
- Modules
<a href="https://github.com/klaus-2/Hope-AutoAnimes-Public">Auto Animes</a>
<a href="https://github.com/klaus-2/Hope-AutoYoutube-Public">Auto Youtube</a>
<a href="https://github.com/klaus-2/Hope-AutoTwitch-Public">Auto Twitch</a>
- Website & Dashboard (Opcional)
<a href="https://github.com/klaus-2/Hope-WebDashboard-Public">Website & Dashboard</a>
### Installation
I will not be providing support for this repository.
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- CONTRIBUTING -->
## 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 a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- LICENSE -->
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- CONTACT -->
## Contact
Discord - [Klaus#1565](https://discordapp.com/users/622812963572809771/)
[DawnForge Server](https://discord.gg/D8dWtRWfYt)
[Top.gg](https://top.gg/bot/901243176814276680/)
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/klaus-2/Hope-Public.svg?style=for-the-badge
[contributors-url]: https://github.com/klaus-2/Hope-Public/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/klaus-2/Hope-Public.svg?style=for-the-badge
[forks-url]: https://github.com/klaus-2/Hope-Public/network/members
[stars-shield]: https://img.shields.io/github/stars/klaus-2/Hope-Public.svg?style=for-the-badge
[stars-url]: https://github.com/klaus-2/Hope-Public/stargazers
[issues-shield]: https://img.shields.io/github/issues/klaus-2/Hope-Public.svg?style=for-the-badge
[issues-url]: https://github.com/klaus-2/Hope-Public/issues
[license-shield]: https://img.shields.io/github/license/klaus-2/Hope-Public.svg?style=for-the-badge
[license-url]: https://github.com/klaus-2/Hope-Public/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/othneildrew
[product-screenshot]: https://i.imgur.com/fE0i4pv.png
| Social media notifications - Music - Moderation - Logs - Reaction Roles - 13+ Languages - Dashboard | bot,discord,discord-bot,discord-js,discord-js-bot,discord-js-v14,general-purpose,javascript,logger-bot,moderation-bot | 2023-01-21T13:42:00Z | 2023-03-01T21:36:39Z | null | 1 | 23 | 16 | 1 | 9 | 28 | null | MIT | JavaScript |
VirajMadhu/OpenAIChatBot | main | # OpenAIChatBot
-- Created By --
* Viraj Madhushan, using OpenAI API on 23rd January 2023
* Node version used : v16.18.1
## How to setup project locally
* Clone the app using ``` git clone https://github.com/VirajMadhu/OpenAIChatBot.git```
## Running Client Side
* Redirect into project folder ```cd /<your-project-folder>/client```
* Install node modules ```npm install```
* Run client ```npm run dev```
## Running Server Side
* Redirect into project folder ```cd /<your-project-folder>/server```
* Install node modules ```npm install```
* Create .env file using ```cp .env.example .env```
* Add your OpenAI Api key at the relant environment key. (more info at https://openai.com/api/)
* Run client ```npm run server```
## Live Demo
* **You can see the live demo using this link :**
https://open-ai-chat-bot-delta.vercel.app/
| This project was created using Open AI API. Everyone please feel free to fork the project and work on it. Also click the below link to see the live demo. | ai,chatbot,javascript,nodejs,openai,openai-api,openai-api-chatbot,openai-chatbot | 2023-01-23T17:49:24Z | 2023-03-11T06:42:00Z | null | 2 | 3 | 9 | 0 | 23 | 27 | null | MIT | JavaScript |
rdancer/brute-lee | main | # Brute "The Leetcode Bruteforcer" Lee
<img src="img/bruce-lee-standing-desk-laptop.jpeg" style=" display: inline; height: 100px; "><img src="img/bruce-lee-shirtless-sitting-at-a-laptop--stable-diffusion.jpeg" style=" display: inline; height: 100px; "><img src="img/bruce-lee-standing-desk-typing-furiously-laptop---stable-diffusion.jpeg" style=" display: inline; height: 100px; ">
*Int. UFC Arena - night*
*Announcer:* Ladies and gentlemen, are you ready for the main event of the evening?
Introducing, from the land of code and algorithms, weighing in at a massive 256
bytes, the one, the only, Brute "The Leetcode Bruteforcer" Lee! This coding
powerhouse has been tearing through lines of code and decimating algorithms
like they were nothing. With his brute force approach, he has been able to
download the problems and grind down the whole Leetcode problem set using the
power of brute force. He has become a legend in the world of coding, and now
he's here to show the world what he's made of. He's a force to be reckoned
with, and he's here to take on all challengers. So put your hands together and
make some noise for the coding heavyweight champion of the world, Brute "The
Leetcode Bruteforcer" Lee!
<p align="center"><a href="https://htmlpreview.github.io/?https://github.com/rdancer/brute-lee/main/coverage/index.html" target="_blank"><img src="coverage/coverage.png" style="max-width: 100%" /></a><i>Each square corresponds to a LeetCode problem. Click on the image for a more detailed report.</i></p>
*The bell rings, and the match begins. BRUTE LEE quickly takes control, using
his brute force approach to grind through the problems one by one. The crowd is
on the edge of their seats as he fights through the final problem.*
*Joe Rogan:* Wow, that was some impressive performance out there tonight, Brute
Lee. You took on the entire Leetcode problem set and came out victorious in
every match. How did you do it?
*Brute Lee:* Well Joe, it's all about the power of brute force. I just keep
trying different solutions until I find the one that works.
*Joe Rogan:* That's incredible, but I have to ask, how do you manage to process
all that data so quickly?
*Brute Lee:* I have a lot of memory and a very fast processor, so I can handle a
lot of information at once. Plus, I'm always running at maximum capacity, so I
never waste any time.
*Joe Rogan:* And what about solutions that are too large for you to submit,
what do you do then?
*Brute Lee:* When a solution is large and a submission is denied, I *smash him*
with Lempel-Ziv like Khabib does. I make it so it decompresses itself just
before the decision.
*Joe Rogan:* That's amazing. And what about updates to the Leetcode problem set,
how do you adapt to those?
*Brute Lee:* I am always updated with the latest problem set, and I use the same
brute force method to solve them.
*Joe Rogan:* That's incredible. You truly are the king of the Leetcode problem
set. Thanks for joining us tonight, Brute Lee.
*Brute Lee (in his mind):* Be like water, my friend.
| LeetCode: All problems; all languages; brute force. | javascript,python3,swift,typescript,c,dart,erlang,go,java,kotlin | 2023-01-24T12:59:55Z | 2023-08-15T20:27:07Z | null | 1 | 0 | 1,102 | 11 | 1 | 25 | null | MIT | HTML |
DestroyPorn/DestroyPorn | main | <br/>
<p align="center">
<a href="https://chrome.google.com/webstore/detail/destroyporn/lgoabbdkdjegjbagmeejkenednmkpcji">
<img src="https://destroyporn.eu/cdn/img/logo3.png" alt="Logo" width="80" height="80">
</a>
<h3 align="center">DestroyPorn</h3>
<p align="center">
Chrome extension that removes unwanted adult content. Our mission is to help people break free from their porn addiction.
<br/>
<br/>
<a href="https://destroyporn.eu/?ref=readme"><strong>View site »</strong></a>
<br/>
<br/>
<a href="https://destroyporn.eu/discord?ref=readme">Discord Server</a>
.
<a href="https://chrome.google.com/webstore/detail/destroyporn/lgoabbdkdjegjbagmeejkenednmkpcji">Chrome Web Store</a>
.
<a href="https://github.com/DestroyPorn/DestroyPorn/issues">Request Feature</a>
</p>
</p>
![Downloads](https://img.shields.io/github/downloads/DestroyPorn/DestroyPorn/total) ![Contributors](https://img.shields.io/github/contributors/DestroyPorn/DestroyPorn?color=dark-green) ![Forks](https://img.shields.io/github/forks/DestroyPorn/DestroyPorn?style=social) ![Stargazers](https://img.shields.io/github/stars/DestroyPorn/DestroyPorn?style=social) ![Issues](https://img.shields.io/github/issues/DestroyPorn/DestroyPorn) ![License](https://img.shields.io/github/license/DestroyPorn/DestroyPorn)
## Table Of Contents
* [About the Project](#about-the-project)
* [How does it work](#how-does-it-work)
* [Installation](#installation)
* [Contributing](#contributing)
* [License](#license)
* [Credits](#credits)
## About The Project
![Screen Shot](https://cdn.discordapp.com/attachments/1071744854616449064/1071802062603567184/image.png)
We believe that pornography is a very serious issue, studies show that it messes with your brain, especially when discovered at a young age.
We want to help people overcome their porn addictions, and improve themselves.
## How does it work
There are few ways DestroyPorn detects NSFW content. Here are the main ones:
- Checks if the website has been marked as a pornography site.
- Scans thru all the images/videos/gifs/ads on a website, and removes it right away.
### Installation
- Install it from [Chrome Web Store](https://chrome.google.com/webstore/detail/destroyporn/lgoabbdkdjegjbagmeejkenednmkpcji)
## Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/DestroyPorn/DestroyPorn/issues/new) to discuss it, or directly create a pull request after you edit the *README.md* file with necessary changes.
* Please make sure you check your spelling and grammar.
* Create individual PR for each suggestion.
* Please also read through the [Code Of Conduct](https://github.com/DestroyPorn/DestroyPorn/blob/main/CODE_OF_CONDUCT.md) before posting your first idea as well.
## License
Distributed under the Apache-2.0 license. See [LICENSE](https://github.com/DestroyPorn/DestroyPorn/blob/main/LICENSE.md) for more information.
## Credits
- [@thejimi](https://github.com/thejimi) - Main Developer / Owner of DestroyPorn
- [@Iceayydev](https://github.com/Iceayydev) & [@evolutionevotv](https://github.com/evoIutionevotv) - Art designers.
- [bryput/porn-site-list](https://github.com/bryput/porn-site-list/blob/master/sites.json)
- [tensorflow/tfjs-node](https://github.com/tensorflow/tfjs)
| Chrome extension that removes unwanted adult content. Our mission is to help people break free from their porn addiction. | ai,chrome-extension,javascript,js,mental-health,nofap | 2023-01-21T18:10:33Z | 2023-02-26T11:53:27Z | 2023-02-16T16:56:02Z | 2 | 5 | 105 | 0 | 2 | 24 | null | Apache-2.0 | JavaScript |
Unleash/unleash-client-nextjs | main | # Unleash Next.js SDK
This package allows easy integration of [Unleash](https://github.com/unleash/unleash) feature flags in a [Next.js](https://nextjs.org/) application.
## Setup
### Installation
To install, simply run:
```sh
npm install @unleash/nextjs
# or
yarn add @unleash/nextjs
# or
pnpm add @unleash/nextjs
```
### Environment variables
This package will attempt to load configuration from
[Next.js Environment variables](https://nextjs.org/docs/basic-features/environment-variables).
When using Unleash **client-side**, with `<FlagProvider />` or `getFrontendFlags()` configure:
- `NEXT_PUBLIC_UNLEASH_FRONTEND_API_URL`. URL should end with `/api/frontend` or `/proxy`
- `NEXT_PUBLIC_UNLEASH_FRONTEND_API_TOKEN` [client-side API token](https://docs.getunleash.io/reference/api-tokens-and-client-keys#front-end-tokens)
if you're using the [front-end API](https://docs.getunleash.io/reference/front-end-api),
or a [proxy client key](https://docs.getunleash.io/reference/api-tokens-and-client-keys#proxy-client-keys)
if you're using a [proxy](https://docs.getunleash.io/reference/unleash-proxy)
If using **server-side** (SSR, SSG, API), using `getDefinitions()` and `evaluateFlags()`, set:
- `UNLEASH_SERVER_API_URL` of you instance. URL should end with `/api`
- `UNLEASH_SERVER_API_TOKEN` [server-side API client token](https://docs.getunleash.io/reference/api-tokens-and-client-keys#client-tokens)
#### Detailed explanation
| Prefixable | Variable | Default |
| -------------- | ---------------------------- | --------------------------------------------------------- |
| `NEXT_PUBLIC_` | `UNLEASH_SERVER_API_URL` | `http://localhost:4242/api` |
| `NEXT_PUBLIC_` | `UNLEASH_FRONTEND_API_URL` | `<(NEXT_PUBLIC_)UNLEASH_SERVER_API_URL>/frontend` |
| **No** | `UNLEASH_SERVER_API_TOKEN` | `default:development.unleash-insecure-api-token` |
| **No** | `UNLEASH_SERVER_INSTANCE_ID` | undefined |
| `NEXT_PUBLIC_` | `UNLEASH_FRONTEND_API_TOKEN` | `default:development.unleash-insecure-frontend-api-token` |
| `NEXT_PUBLIC_` | `UNLEASH_APP_NAME` | `nextjs` |
If you plan to use configuration in the browser, add `NEXT_PUBLIC_` prefix.
If both are defined and available, private variable takes priority.
You can use both to have different values on client-side and server-side.
---
💡 **Usage with GitLab's feature flags**: To use this SDK with [GitLab Feature Flags](https://docs.gitlab.com/ee/operations/feature_flags.html), use `UNLEASH_SERVER_INSTANCE_ID` instead of `UNLEASH_SERVER_API_TOKEN` to [authorize with GitLab's service](https://docs.gitlab.com/ee/operations/feature_flags.html#get-access-credentials).
---
# Usage
## A). 🌟 **App directory** (new)
This package is ready for server-side use with [App Router](https://nextjs.org/docs/app/building-your-application/routing).
Refer to [`./example/README.md#App-router`](https://github.com/Unleash/unleash-client-nextjs/tree/main/example#app-router) for an implementation example.
```tsx
import { cookies } from "next/headers";
import { evaluateFlags, flagsClient, getDefinitions } from "@unleash/nextjs";
const getFlag = async () => {
const cookieStore = cookies();
const sessionId =
cookieStore.get("unleash-session-id")?.value ||
`${Math.floor(Math.random() * 1_000_000_000)}`;
const definitions = await getDefinitions({
fetchOptions: {
next: { revalidate: 15 }, // Cache layer like Unleash Proxy!
},
});
const { toggles } = await evaluateFlags(definitions, {
sessionId,
});
const flags = flagsClient(toggles);
return flags.isEnabled("nextjs-example");
};
export default async function Page() {
const isEnabled = await getFlag();
return (
<p>
Feature flag is{" "}
<strong>
<code>{isEnabled ? "ENABLED" : "DISABLED"}</code>
</strong>
.
</p>
);
}
```
## B). Middleware
It's possible to run this SDK in Next.js Edge Middleware. This is a great use case for A/B testing, where you can transparently redirect users to different pages based on a feature flag. Target pages can be statically generated, improving performance.
Refer to [`./example/README.md#Middleware`](https://github.com/Unleash/unleash-client-nextjs/tree/main/example#middleware) for an implementation example.
## C). Client-side only - simple use case and for development purposes (CSR)
Fastest way to get started is to connect frontend directly to Unleash.
You can find out more about direct [Front-end API access](https://docs.getunleash.io/reference/front-end-api) in our documentation,
including a guide on how to [setup a client-side SDK key](https://docs.getunleash.io/how-to/how-to-create-api-tokens).
Important: Hooks and provider are only available in `@unleash/nextjs/client`.
```tsx
import type { AppProps } from "next/app";
import { FlagProvider } from "@unleash/nextjs/client";
export default function App({ Component, pageProps }: AppProps) {
return (
<FlagProvider>
<Component {...pageProps} />
</FlagProvider>
);
}
```
With `<FlagProvider />` in place you can now use hooks like: `useFlag`, `useVariant`, or `useFlagsStatus` to block rendering until flags are ready.
```jsx
import { useFlag } from "@unleash/nextjs/client";
const YourComponent = () => {
const isEnabled = useFlag("nextjs-example");
return <>{isEnabled ? "ENABLED" : "DISABLED"}</>;
};
```
Optionally, you can configure `FlagProvider` with the `config` prop. It will take priority over environment variables.
```jsx
<FlagProvider
config={{
url: "http://localhost:4242/api/frontend", // replaces NEXT_PUBLIC_UNLEASH_FRONTEND_API_URL
clientKey: "<Frontend_API_token>", // replaces NEXT_PUBLIC_UNLEASH_FRONTEND_API_TOKEN
appName: "nextjs", // replaces NEXT_PUBLIC_UNLEASH_APP_NAME
refreshInterval: 15, // additional client configuration
// see https://github.com/Unleash/unleash-proxy-client-js#available-options
}}
>
```
If you only plan to use [Unleash client-side React SDK](https://github.com/Unleash/proxy-client-react) now also works with Next.js. Check documentation there for more examples.
## D). Static Site Generation, optimized performance (SSG)
With same access as in the client-side example above you can resolve Unleash feature flags when building static pages.
```tsx
import {
flagsClient,
getDefinitions,
evaluateFlags,
getFrontendFlags,
type IVariant,
} from "@unleash/nextjs";
import type { GetStaticProps, NextPage } from "next";
type Data = {
isEnabled: boolean;
variant: IVariant;
};
const ExamplePage: NextPage<Data> = ({ isEnabled, variant }) => (
<>
Flag status: {isEnabled ? "ENABLED" : "DISABLED"}
<br />
Variant: {variant.name}
</>
);
export const getStaticProps: GetStaticProps<Data> = async (_ctx) => {
/* Using server-side SDK: */
const definitions = await getDefinitions();
const context = {}; // optional, see https://docs.getunleash.io/reference/unleash-context
const { toggles } = evaluateFlags(definitions, context);
/* Or with the proxy/front-end API */
// const { toggles } = await getFrontendFlags({ context });
const flags = flagsClient(toggles);
return {
props: {
isEnabled: flags.isEnabled("nextjs-example"),
variant: flags.getVariant("nextjs-example"),
},
};
};
export default ExamplePage;
```
The same approach will work for [ISR (Incremental Static Regeneration)](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration).
Both `getDefinitions()` and `getFrontendFlags()` can take arguments overriding URL, token and other request parameters.
## E). Server Side Rendering (SSR)
```tsx
import {
flagsClient,
evaluateFlags,
getDefinitions,
type IVariant,
} from "@unleash/nextjs";
import type { GetServerSideProps, NextPage } from "next";
type Data = {
isEnabled: boolean;
};
const ExamplePage: NextPage<Data> = ({ isEnabled }) => (
<>Flag status: {isEnabled ? "ENABLED" : "DISABLED"}</>
);
export const getServerSideProps: GetServerSideProps<Data> = async (ctx) => {
const sessionId =
ctx.req.cookies["unleash-session-id"] ||
`${Math.floor(Math.random() * 1_000_000_000)}`;
ctx.res.setHeader("set-cookie", `unleash-session-id=${sessionId}; path=/;`);
const context = {
sessionId, // needed for stickiness
// userId: "123" // etc
};
const definitions = await getDefinitions(); // Uses UNLEASH_SERVER_API_URL
const { toggles } = evaluateFlags(definitions, context);
const flags = flagsClient(toggles); // instantiates a static (non-syncing) unleash-proxy-client
return {
props: {
isEnabled: flags.isEnabled("nextjs-example")
},
};
};
export default ExamplePage;
```
## F). Bootstrapping / rehydration
You can bootstrap Unleash React SDK to have values loaded from the start.
Initial value can be customized server-side.
```tsx
import App, { AppContext, type AppProps } from "next/app";
import {
FlagProvider,
getFrontendFlags,
type IMutableContext,
type IToggle,
} from "@unleash/nextjs";
type Data = {
toggles: IToggle[];
context: IMutableContext;
};
export default function CustomApp({
Component,
pageProps,
toggles,
context,
}: AppProps & Data) {
return (
<FlagProvider
config={{
bootstrap: toggles,
context,
}}
>
<Component {...pageProps} />
</FlagProvider>
);
}
CustomApp.getInitialProps = async (ctx: AppContext) => {
const context = {
userId: "123",
};
const { toggles } = await getFrontendFlags(); // use Unleash Proxy
return {
...(await App.getInitialProps(ctx)),
bootstrap: toggles,
context, // pass context along so client can refetch correct values
};
};
```
# ⚗️ CLI (experimental)
You can use `unleash [action] [options]` in your `package.json` `scripts` section, or with:
```sh
npx @unleash/nextjs
```
For the CLI to work, the following [environment variables](#environment-variables) must be configured with appropriate values:
- `UNLEASH_SERVER_API_URL`
- `UNLEASH_SERVER_API_TOKEN`
The CLI will attempt to read environment values from any `.env` files if they're present. You can also set the variables directly when invoking the interface, as in the [CLI usage example](#example).
## Usage
- `get-definitions <outputFile.json>` Download feature flags definitions for bootstrapping (offline use) of server-side SDK.
- `generate-types [options] <outputFile.ts>` Generate types and typed functions from feature flags defined in an Unleash instance.
It will also generate strictly typed versions of `useFlag`, `useVariant`, `useFlags` and `flagsClient` (unless `--typesOnly` is used).
- `-t, --typesOnly` don't include typed versions of functions exported from `@unleash/nextjs` (default: false)
- `-b, --bootstrap <sourceFile.json>` load definitions from a file instead of fetching definitions - work offline
- `-V` Output the version number
## Example
Try it now
```sh
UNLEASH_SERVER_API_URL=https://app.unleash-hosted.com/demo/api \
UNLEASH_SERVER_API_TOKEN=test-server:default.8a090f30679be7254af997864d66b86e44dcfc5291916adff72a0fb5 \
npx @unleash/nextjs generate-types ./unleash.ts
```
# Known limitation
- In current interation **server-side SDK does not support metrics**.
- When used server-side, this SDK does not support the "Hostname" and "IP" strategies. Use custom context fields and constraints instead.
| Unleash SDK for Next.js | continuous-delivery,continuous-deployment,javascript,nextjs,node,node-js,sdk,typescript,unleash,vercel | 2023-01-19T17:27:00Z | 2024-05-21T11:06:25Z | 2024-05-21T11:06:25Z | 13 | 55 | 122 | 3 | 7 | 24 | null | null | TypeScript |
cottom/chatgpt-prompt-helper | master | # ChatGPT Prompt helper
<img src="./assets/icon.png" width="60px" style="margin: auto; display: block" />
This Browser extension is going to prower chatGPT with awesome chatgpt prompt helper. Data powered by [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts).
> The ChatGPT model is a large language model trained by OpenAI that is capable of generating human-like text. By providing it with a prompt, it can generate responses that continue the conversation or expand on the given prompt.
## Feature
![Icon](./images/feature.png)
- [x] Prompts
- [x] Screenshot
- [ ] collection
- [ ] Cloud storage
## Getting Started
First, run the development server:
```bash
pnpm dev
# or
npm run dev
```
Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
For further guidance, [visit our Documentation](https://docs.plasmo.com/)
## Making production build
Run the following:
```bash
pnpm build
# or
npm run build
```
This should create a production bundle for your extension, ready to be zipped and published to the stores.
## Submit to the webstores
The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.**browser**.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
| help your ChatGPT conversation with prompt | chatgpt,chatgpt-browser-extension,javascript | 2023-01-20T07:16:39Z | 2024-05-09T09:41:51Z | null | 1 | 5 | 51 | 3 | 6 | 23 | null | null | TypeScript |
malstrom72/microtonic-scripts-sdk | main | # Microtonic Scripts SDK
This repository contains all the necessary documentation and resources to create GUI scripts for Microtonic. The
scripting engine in Microtonic uses a proprietary JavaScript engine based on ECMAScript 3. The engine only works when
the Microtonic window is open. There is currently no way to create real-time scripts that process MIDI or audio. Apart
from these restrictions, a script can do pretty much anything with the data in Microtonic, and the user interface can
look and behave in any way you can imagine.
Disclaimer: many proprietary technologies, formats, and languages are involved in creating user interfaces for
Sonic Charge plugins. These technologies have evolved organically over time and will continue to do so in the future.
There is functional overlap and inconsistencies, and there is no guarantee that a script that works in the current
version of Microtonic will work in the next (even though good compatibility is something that we strive for at
Sonic Charge).
The documentation in this repository was written for Microtonic version 3.3.4 (build 1048).
## Technology Overview
Here is a brief list of the technologies used in Microtonic GUIs:
- _Cushy_: the layout engine and file format for describing layouts, based on _Numbstrict_ with _Makaron_ support.
- _ImpD_: a simple imperative computer language disguised as a data format, or the other way around.
- _IVG_ (Imperative Vector Graphics): a language and file-format for 2D vector graphics, based on _ImpD_.
- _Makaron_: a macro expansion syntax, used to make `.cushy` files easier to write.
- _Numbstrict_: an object notation format similar to (but not compatible with) JSON.
- _NuXJScript_: our JavaScript engine, fully ECMAScript 3 compliant with features from ECMAScript 5.
- _PikaScript_: our legacy script language used by older Microtonic scripts and offline tools.
## Repository Structure
- `CushyLint`:
1. Command-line syntax checker for `.cushy` files.
2. Contains [`cushy.schema`](CushyLint/cushy.schema), the official reference for the `.cushy` format.
- `docs`:
- [ImpD Documentation](docs/ImpD%20Documentation.md)
- [IVG Documentation](docs/IVG%20Documentation.md)
- [Makaron Documentation](docs/Makaron%20Documentation.md)
- [Microtonic JS Reference](docs/Microtonic%20JS%20Reference.md)
- `ivgfiddle`: a browser "playground" for experimenting with _IVG_ (compiled with _emscripten_).
- `IVGFontConverter`: a converter from `.ttf` and `.otf` to `.ivgfont` (requires _node.js_).
- `JSConsole.mtscript`: an interactive Javascript console for Microtonic.
- `legacy`: contains documentation for the legacy scripting engine (based on _PikaScript_).
- `tmLanguages`: syntax highlighting support for Sonic Charge formats and languages.
### Cushy
_Cushy_ is the GUI / layout engine used in all Sonic Charge products. `.cushy` files define the layout of views and
configure how the user can interact with the plugin through _GUI variables_ and _GUI actions_. The format is based
on _Numbstrict_, the object notation format used in all Sonic Charge products. _Numbstrict_ is similar to JSON with
the following differences:
1. C-style comments are supported.
2. You use curly brackets (`{` and `}`) for both structures and arrays.
3. To differentiate empty structures from empty arrays, you may use this syntax: `{ : }`.
4. You may express integer values as hexadecimal numbers in this format: `0xABCD`.
5. Real values include infinity (`inf`) and the NaN value (`nan`).
6. Free-form text values without quotes are allowed in many cases.
7. You can use `\U` inside quoted strings to escape a 32-bit Unicode character, e.g., `\U0001F9FF`.
Here is an "outline" of the Cushy file structure:
bounds: { <left>, <top>, <width>, <height> }
autoexecs: {
... actions to run on open, close, or regularly on a timer
}
transitions: {
... visual transition effects applied when this Cushy is opened or closed
}
translations: {
... special string translations used for this Cushy.
}
views: {
... view definitions
}
In Cushy, it's often possible to write mathematical expressions where numerical constants are expected. In these places,
`$` may be used to insert the default value for the field. E.g., `updateRate: $*2` would set `updateRate` to twice the
default. For rectangles such as view bounds you can also use the following variables: `t`, `l`, `w`, `h`, `r`, `b`
for _top_, _left_, _width_, _height_, _right_ and _bottom_ of the default rectangle. E.g.
`bounds: { l+10,t+10,h-20,w-20 }`. The default rectangle for a view bound is the full bounding box of the parent view.
The _Numbstrict_ format can be challenging to write correctly, especially when containing deeply nested hierarchical
views and actions. Therefore we created _CushyLint_, a command-line tool to check the syntax of a `.cushy` file against
the official "schema" specification. Simple run `CushyLint` (Mac) or `CushyLint.bat` (Windows) from a command-line
prompt with the single argument specifying a single `.cushy` file path to check or a directory if you want to check
multiple files. Directories must end with a slash (`/` or `\`).
The files are checked against the official `cushy.schema` file in the `CushyLint` directory, plus any other `.schema`
files existing in the directory next to the `.cushy` file that you are checking. The `cushy.schema` file is designed to
be readable and contains lots of comments, thus also serving as a kind of official reference documentation on `.cushy`
files, available view types, and built-in actions.
Furthermore, you can use macros when writing `.cushy` files for easier development and maintenance. See
[Makaron Documentation](docs/Makaron%20Documentation.md) for documentation on the macro expansion language we use. Macros
you write are expanded when `.cushy` files are loaded inside the plugin, before they are parsed.
See [`cushy.schema`](CushyLint/cushy.schema) and [Microtonic JS Reference](docs/Microtonic%20JS%20Reference.md) for more
information on how to write Cushy.
### IVGFiddle
Included in this distribution is a standalone .html application called _IVGFiddle_. You can run it simply by opening the
[`ivgfiddle.html`](https://htmlpreview.github.io/?https://github.com/malstrom72/microtonic-scripts-sdk/blob/main/ivgfiddle/ivgfiddle.html)
file in your favorite browser (Google Chrome). It will let you experiment with IVG code and see the graphical output in
real-time.
See [IVG Documentation](docs/IVG%20Documentation.md) for more information on IVG.
### IVGFontConverter
Cushy (and IVG) uses a proprietary file format for fonts: `.ivgfont`. You can use _IVGFontConverter_ to convert
a _TrueType_ or _OpenType_ font to this format. To run, you must install [node.js](https://nodejs.org/en/). Then use
it like this:
node IVGFontConverter.node.js <input> [ ?|-|<feature>[,<feature>,...] ] [ <charset>[,<charset>,...] ] > <output>
? List all GSUB features
- No extra GSUB feature
<feature> Enable GSUB feature by [<script>.[<language>.]]<feature>
<charset> Convert Unicode characters [<hex>[-<hex>]] (default is ISO-8859-1)
Example: node IVGFontConverter.node.js font.otf >font.ivgfont
Example: node IVGFontConverter.node.js font.otf ss01 >font.ivgfont
node IVGFontConverter.node.js font.ttf latn.ROM.locl,latn.ss01 >font.ivgfont
node IVGFontConverter.node.js font.ttf - 0020-007f,a0-cf >font.ivgfont
### JSConsole
A console (`JSConsole`) is available for developing scripts. It runs inside Microtonic and allows you to enter
JavaScript code interactively, see traces, reload all resources and see script performance (as frames per second).
Install it by copying `JSConsole.mtscript` to the `Microtonic Scripts` folder. (You can easily find this folder by
choosing `Open Scripts Folder` from the "puzzle menu" in Microtonic.)
### Syntax Highlighting
_TextMate Language Grammars_ are available for most of the custom languages and formats used by Sonic Charge. You find
them in the `tmLanguages` folder. We have tested them in [Sublime Text](https://www.sublimetext.com/) and
[Visual Studio Code](https://code.visualstudio.com/). Installation instructions:
- Sublime Text
Use the menu `Preferences > Browse Packages...` to open `Packages` and copy the `soniccharge` folder into this folder.
- Visual Studio Code
Copy the `soniccharge` folder into the `.vscode/extensions/` directory under your "home folder".
- Windows: `%USERPROFILE%\.vscode\extensions`
- Mac/Linux: `$HOME/.vscode/extensions`
| Useful documentation, resources and tools for creating scripts for Sonic Charge Microtonic | audio,graphics-engine,javascript,user-interface,vst | 2023-01-23T20:22:32Z | 2023-01-25T15:47:55Z | null | 1 | 0 | 15 | 0 | 2 | 22 | null | null | HTML |
appatalks/chatgpt-html | main | # ChatGPT HTML - Using OpenAI APIs;
![screenshot-catdog](core/img/screenshot-catdog.png)
v.2.0
This allows you to easily interact with the OpenAI API.
## Getting Started
1. Add your OpenAI API key to the "OPENAI_API_KEY" variable and (optionally) AWS, Google Keys in config.json for additional functionality.
2. Open index.html and have fun!
3. Optional: - Suno-Ai's Bark TTS Engine Added. Run server.py (GPU Enabled)
4. **Note: You may have to review/adjust the code for your specific env. ie CIDR ranges, NGINX/webserver configuration,scripting piece etc.**
## Features
- GPT-4 Support
- Google Gemini Added
- Google PaLM Legacy Support
- Google Vision API added (AI Image processing)
- Model Selection, Multiple languages, and Print Conversation.
- Convert to Speech using Amazon Polly's Text-to-Speech service.
- Suno-Ai's Bark TTS Added
- Use Google Search with the Keyword "Google"
- Images served with Google Image Search
- Additional scraped data with scripts
- Basic Error handling
## Bugs
- Check Issues
- Response with "usage":{"completion_tokens":420} causes weird display bug on-screen.
- **Not for Production use (really messy code, likely security concerns, all-over-the-place, good playgroud and learning tho!)**
Grabbed the inital idea from here https://www.codeproject.com/Articles/5350454/Chat-GPT-in-JavaScript <br>
Complete overhaul of the code base.
| OpenAI & Google Generative Language Chat | gpt-35-turbo,gpt-4,openai,chatgpt,html,javascript,bard-api,palm,bison,gemini | 2023-01-24T04:03:45Z | 2024-03-16T19:28:34Z | 2024-03-13T20:09:43Z | 1 | 2 | 403 | 5 | 12 | 20 | null | MIT | JavaScript |
bufbuild/protobuf-conformance | main | # Protobuf Conformance Tests
A repository which runs the protocol buffers
[conformance test suite](https://github.com/protocolbuffers/protobuf/tree/main/conformance) against various implementations.
## Implementations
The current implementations being tested are:
* Protobuf-ES: https://github.com/bufbuild/protobuf-es
* protobuf-ts: https://github.com/timostamm/protobuf-ts
* google-protobuf: https://github.com/protocolbuffers/protobuf-javascript
* protobuf.js: https://github.com/protobufjs/protobuf.js/
* protoc-gen-ts: https://github.com/thesayyn/protoc-gen-ts
* ts-proto: https://github.com/stephenh/ts-proto
* protoscript: https://github.com/TateThurston/protoscript
## Results
<!--- RESULTS-START -->
| Implementation | JavaScript | TypeScript | Standard<br>Plugin | Required tests | Recommended tests |
|-----------------------------------------|:------------------:|:------------------:|:------------------:|:-------------------------------------:|:----------------------------------------:|
| [Protobuf-ES](impl/protobuf-es) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | <sub><img src="https://progress-bar.dev/100?width=100&suffix=%25+passing" height="25" width="125" /></sub><br><sup>(0 failures)<sub> | <sub><img src="https://progress-bar.dev/100?width=100&suffix=%25+passing" height="25" width="125" /></sub><br><sup>(0 failures)<sub> |
| [protobuf-ts](impl/protobuf-ts) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | <sub><img src="https://progress-bar.dev/99?width=100&suffix=.9%25+passing" height="25" width="125" /></sub><br><sup>(2 failures)<sub> | <sub><img src="https://progress-bar.dev/99?width=100&suffix=.8%25+passing" height="25" width="125" /></sub><br><sup>(1 failures)<sub> |
| [protoscript](impl/protoscript) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | <sub><img src="https://progress-bar.dev/44?width=100&suffix=.7%25+passing" height="25" width="125" /></sub><br><sup>(1084 failures)<sub> | <sub><img src="https://progress-bar.dev/18?width=100&suffix=%25+passing" height="25" width="125" /></sub><br><sup>(529 failures)<sub> |
| [google-protobuf](impl/google-protobuf) | :heavy_check_mark: | :x: | :heavy_check_mark: | <sub><img src="https://progress-bar.dev/70?width=100&suffix=.8%25+passing" height="25" width="125" /></sub><br><sup>(572 failures)<sub> | <sub><img src="https://progress-bar.dev/53?width=100&suffix=.5%25+passing" height="25" width="125" /></sub><br><sup>(300 failures)<sub> |
| [protobuf.js](impl/protobuf.js) | :heavy_check_mark: | :heavy_check_mark: | :x: | <sub><img src="https://progress-bar.dev/73?width=100&suffix=.3%25+passing" height="25" width="125" /></sub><br><sup>(523 failures)<sub> | <sub><img src="https://progress-bar.dev/73?width=100&suffix=.8%25+passing" height="25" width="125" /></sub><br><sup>(169 failures)<sub> |
| [protoc-gen-ts](impl/protoc-gen-ts) | :x: | :heavy_check_mark: | :heavy_check_mark: | <sub><img src="https://progress-bar.dev/20?width=100&suffix=.2%25+passing" height="25" width="125" /></sub><br><sup>(1564 failures)<sub> | <sub><img src="https://progress-bar.dev/27?width=100&suffix=.8%25+passing" height="25" width="125" /></sub><br><sup>(466 failures)<sub> |
| [ts-proto](impl/ts-proto) | :x: | :heavy_check_mark: | :heavy_check_mark: | <sub><img src="https://progress-bar.dev/62?width=100&suffix=.8%25+passing" height="25" width="125" /></sub><br><sup>(730 failures)<sub> | <sub><img src="https://progress-bar.dev/5?width=100&suffix=.89%25+passing" height="25" width="125" /></sub><br><sup>(607 failures)<sub> |
<!--- RESULTS-END -->
Note: None of the libraries tested implement the text format so the results for those test runs are not shown.
## Running the tests
To run the conformance tests, run `make` from the repo root.
Note that only Linux and OSX operating systems are supported.
| A repository running the Protobuf conformance tests against various libraries | conformance,protobuf,javascript,typescript | 2023-01-20T18:19:06Z | 2024-05-01T15:00:59Z | 2024-05-23T15:52:10Z | 42 | 220 | 105 | 0 | 3 | 20 | null | Apache-2.0 | JavaScript |
Etesam913/Custoplayer | main | <h1>Custoplayer</h1>
<p>A React.js npm package that allows for the rapid creation of customizable video players. </p>
<span>
<img src="https://img.shields.io/badge/license-MIT-green"></img>
<img src="https://img.shields.io/github/issues/etesam913/Custoplayer"></img>
<a href="https://codecov.io/gh/Etesam913/Custoplayer">
<img src="https://codecov.io/gh/Etesam913/Custoplayer/branch/main/graph/badge.svg?token=GOZ1AQ77C2"/>
</a>
<img src="https://github.com/Etesam913/Custoplayer/actions/workflows/linting.yml/badge.svg"/>
<img src="https://github.com/Etesam913/Custoplayer/actions/workflows/tests.yml/badge.svg"/>
<img src="https://img.shields.io/npm/v/custoplayer"/>
</span>
<img src="https://custoplayer.nyc3.cdn.digitaloceanspaces.com/docs%2FWritten-By-Human-Not-By-AI-Badge-white.svg"/>
<h2>Demo Video</h2>
https://github.com/Etesam913/Custoplayer/assets/55665282/fedcb5a5-ec94-4fe0-b554-2bf78cf62c6a
<h2><a href="https://etesam913.github.io/Custoplayer/quick-start">Documentation Page</a> </h2>
<h2>📦 Installation</h2>
<h3>npm</h3>
```
npm install custoplayer
```
<h3>yarn</h3>
```
yarn add custoplayer
```
<h2>💻 Example Usage</h2>
```jsx
import React from 'react';
import { Custoplayer } from 'custoplayer';
function CustoplayerExample() {
return (
<Custoplayer
poster='https://custoplayer.nyc3.cdn.digitaloceanspaces.com/docs/custoplayer-demo-poster.png'
src='https://custoplayer.nyc3.cdn.digitaloceanspaces.com/docs/compressed-custoplayer-demo.mp4'
values={{
previewTooltip: {
id: 'text',
},
controlsBar: {
animate: 'movement',
barColor: 'rgba(28, 28, 28, 0.85)',
},
item1: {
id: 'playButton1',
buttonColor: '#b7cef4',
},
item2: {
id: 'volumeButton1',
barId: 'volumeBar2',
volumeColor: '#a4c3f5',
buttonColor: '#a4c3f5',
},
item3: {
id: 'currentTime',
textColor: '#b7cef4',
},
item4: {
id: 'progressBar1',
progressColor: '#a4c3f5',
},
item5: {
id: 'duration',
textColor: '#b7cef4',
},
item6: {
id: 'settingsButton1',
buttonColor: '#a4c3f5',
settingsMenuColor: '#a4c3f5',
settingsMenuOrientation: 'left',
options: {
playbackSpeed: [0.25, 0.5, 1, 1.5, 2],
},
},
item7: {
id: 'fullscreenButton1',
buttonColor: '#b7cef4',
},
}}
/>
);
}
export default CustoplayerExample;
```
<h2>Overview</h2>
<h3>Things you can customize:</h3>
<h4>🎥 Types of Video Elements</h4>
<ul>
<li>It's your choice regarding what you want for your video player. </li>
<li>The inclusion or absence of a play button, volume button/slider, progress bar, fullscreen button, or a settings button is all up to you.</li>
</ul>
<h4>📍 The Location of Video Elements</h4>
<ul>
<li>Maybe you want your play button to be on the right edge of the video and the fullscreen button to be on the left edge of the video.</li>
<li>Alternatively, you may want your progress bar to be to the right of the play button.</li>
<li>Changing the location of video elements in a custoplayer component is very easy to do through the item prop.</li>
</ul>
<h4>💄 The Appearance of Video Elements</h4>
<ul>
<li>Changing the appearance of video elements is important when trying to create or match a brand identity.</li>
<li>The colors of a play buttons, progress bar, volume bar, fullscreen button, settings button, and more can be customized. </li>
<li>In addition, there are different variants of a component. </li>
</ul>
<h2> See More at the <a href="https://etesam913.github.io/Custoplayer/docs/quick-start">Documentation Page</a> </h2>
| A React.js npm package that allows for the rapid creation of customizable video players. | javascript,npm,react,typescript,video,video-player,video-player-library | 2023-01-20T01:50:06Z | 2023-08-10T01:37:27Z | 2023-05-05T00:45:05Z | 3 | 63 | 322 | 5 | 2 | 19 | null | MIT | TypeScript |
aakashmanjrekar11/ChatGPT-Clone | main | # ChatGPT Clone
### 🚀 [Live Demo](https://chatgpt-clone-aakash.vercel.app/) - Edit (30/3/2023) : Although the website is up and running, my app has exhausted the OpenAI API free trial credits and thus will return error.
ChatGPT Clone is my attempt at developing an ML-AI chatbot based on [OpenAI](https://openai.com/)'s [ChatGPT](https://chat.openai.com/chat) model which interacts in a conversational way.
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg) ](https://opensource.org/licenses/MIT) [![Website shields.io](https://img.shields.io/website-Up-Down-green-red/http/shields.io.svg)](https://chatgpt-clone-aakash.vercel.app/)
## Tech Stack
**Front-end:** ![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=for-the-badge&logo=vite&logoColor=white) ![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white) ![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) ![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)
**Back-end:** ![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) ![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge&logo=express&logoColor=%2361DAFB)
**Hosting:** ![Vercel](https://img.shields.io/badge/vercel-%23000000.svg?style=for-the-badge&logo=vercel&logoColor=white) ![Render](https://img.shields.io/badge/Render-%46E3B7.svg?style=for-the-badge&logo=render&logoColor=white)
**Dependencies:** `npm: ^9.3.1`; `vite: ^4.0.0`; `openai: ^3.1.0`; `cors: ^2.8.5`; `dotenv: ^16.0.3`; `express: ^4.18.2`; `nodemon: ^2.0.20`
## Methods
- I have made use of the [`text-davinci-003`](https://beta.openai.com/docs/models/gpt-3) model, which is the most capable GPT-3 model. It can do any task the other models can do, often with higher quality, longer output and better instruction-following. Also supports [inserting](https://beta.openai.com/docs/guides/completion/inserting-text) completions within text.
- Tested and deployed the chat-bot with a lower sampling-temperature value so that it takes lesser risks and gives
well-defined answers.
![](https://cdn.openai.com/chatgpt/draft-20221129c/ChatGPT_Diagram.svg)
_Photo credits: [OpenAI Blog](https://openai.com/blog/chatgpt/)_
## Contributions
This project is open to contributions, so if you want to submit any bug reports, suggestions, improvements then please open an issue and I'll get back to you. Thank you!
## Acknowledgment
Huge thanks to [Adrian Hajdin - JS Mastery](https://github.com/adrianhajdin) for coming up with the idea and implementation. Make sure to check out his channel 🤝
## License
This project is licensed under the MIT License.
| 🤖 ChatGPT Clone is my attempt at developing an ML-AI chatbot based on OpenAI's ChatGPT model which interacts in a conversational way. | chatgpt,expressjs,javascript,nodejs,openai-api,render,text-davinci-003,vercel,vitejs | 2023-01-19T20:33:37Z | 2023-03-30T22:12:53Z | null | 1 | 0 | 13 | 0 | 4 | 17 | null | null | JavaScript |
home-assistant-tutorials/01.development-environment | main | # Tutorial 01 - Home Assistant - The Development Environment
* @published: January 2023
* @author: Elmar Hinz
This repository is the first one of a series of tutorials addressing different
parts of the development with Home Assistant seen with the eye of the skilled
user. Each tutorial is shipped as a standalone github repository holding the
code alongside with the README (if any).
## The Development Environment
Today development is often done within *Docker containers* to get the same
environment for all developers. This is as useful to get the same environment
for all users of a tutorial. The recommended method to run Home Assistant itself
is based upon *Docker Containers*, the *"Home Assistant Operating System"*.
While there are different containers around, let's go directly into the lion's
den and use [the development container of the Home Assistant
core](https://github.com/home-assistant/core). It is well elaborated and most
likely up-to-date. Let's address the downside of this approach, too. It is a
large one. However, it is good to know the handling on the long run and you will
be able reuse this container for most of the future tutorials.
A downside is that this container is loading the latest developments of the core
and it happens that is it is broken. This tutorial can't address the issues.
In case refer to the [discord chat](https://discord.com/invite/home-assistant) to
follow the latest developments.
## Prerequisites
### Machine and Operating System
A contemporary machine being able to run *Docker* containers and *Visual Studio
Code*. Unix, Linux, Mac OS or Windows should be usable as Operating System
equally well.
### Internet access
Just to mention it.
### Docker
Docker should have been set up for your machine. You should know how to run it.
### Visual Studio Code
*VS Code* should have been set up for your machine and you should have figured
out how to use it.
The development container for core development is integrated with *VS Studio
Code*. It does automate most of the setup for you. There is also a manual setup
and you may use other editors. I hold to *VS Code* for this tutorial. Vim users
will find a well done plugin with vim bindings in *VS Code* and they get the IDE
on top for free.
### Shell
Even within *VS Code* you should know how to use a shell. The container offers
*zsh* and *bash*.
### Git
You should know how to use *Git* on the command-line. While *VS Code* offers a
graphical interface to *Git* it is difficult to really understand the usage
without a fundamental background.
### Github account
You should have registered for a Github account to be able to fork your own
instances of different parts of the tutorial. You should have registered your
local machine for your Github account, to easily push and pull from the command
line.
### JavaScript
To follow along the tutorials you should have a basic experience with JavaScript
and understand it's implementation of the class concept.
### Python
Will depend upon the tutorial.
### Installation
Begin by setting up the container as instructed by [the documentation
here](https://developers.home-assistant.io/docs/development_environment). You
actually have to visit the page and to use the given form, for to start up your
container.
![instructions](img/instructions-for-dev-container.png)
This may take a while depending upon your connections. Open the terminal window
at the bottom of *VS Code* to follow along the process of the installation.
![log of setup](img/process-of-container-setup.png)
In the dashboard of the *Docker Desktop* you can observe, how a bootstrapping
container is setting up the development container.
![bootstrapping](img/bootstrapping.png)
It gets a silly `NAME` assigned. In my case it is `blissful_gagarin`. You
recognize the container by the name of the `IMAGE`. It contains the name, which
you assigned to your fork on Github (here `ha.core2`). In the shell of your host
machine assign a meaningful name.
```sh
docker rename blissful_gagarin ha.tutorial
```
![starting ha](img/starting-ha.png)
Follow the instructions to start Home Assistant. Open the command palette of *VS
Code*. Select `Tasks: Run Task`. Select `Run Home Assistant Core`. Follow along
the start up log in the terminal window, to check if everything goes well.
![deprecation warning](img/deprecation-waring.png)
You can ignore a warning regarding the version of Python. Home Assistant wants
to support older versions to a certain extend. When time has come, the core team
will update the container.
In your browser go ahead to [http://localhost:8123](http://localhost:8123) or
whatever address your local machine set up to. Create an account for the
administrator as usual.
### Exploring the container
Open the terminal in the bottom of *VS Code*. Click the **down arrow** right
hand of the **plus** symbol. You can select a shell of your taste.
![shell selection](img/shell-selection.png)
Note how the *zsh* shell ships a lot of popular aliases by typing `alias` in it.
Open the shell of your choice to explore the directory structure:
![exploring the container](img/exploring.png)
In `/workspaces` you find the repository you have cloned.
Change into it and type `ls -a` to also list the hidden files.
![root directory of the repository](img/repo-root.png)
Among a lot of other stuff, you find the local `.git/` repository and the
`.gitignore` file. You find the configuration directory of *VS Code* `.vscode`.
There is the `config/` directory for the customization of Home Assistant.
Explore `.gitignore`. Type `head .gitignore`. You also find it within the file
explorer of *VS Code* on the left hand side.
![head of .gitignore](img/head-gitignore.png)
The most important line for us is the first one containing `/config`. You
observe, that the configuration directory is ignored by this repository. Your
can freely place your own git repositories into it without having to fear any
conflicts.
### Restarting the Container
When closing the remote connection the shutdown of the container is triggered
automatically. The remote connections also gets closed when quitting *VS Code*.
To restart *VS Code* inside the container the shortcut is to select it from the
menu with `File > Open Recent`. The default approach is the command `Remote
Explorer: Focus on Containers View`. Then right click the container and select
`Open Folder in Container`.
### Mounting
It is not necessary to mount your projects into the development container, but
you may want to do so. Without mounting them, you have to start up the container
first to access them. That's fine as long as it is your default workflow and you
push the code regularly into a repository outside of the container. In this case
you have to configure the SSH settings of the container to connect to the repo.
Here I describe how to mount directories instead, so that you can access the repo
with the tools and setup of the host.
You may consider to mount the full `config/` directory. As you have already
observed, it is not empty. If you want to mount it you have to take care to copy
the files back into it. I choose a different approach for this tutorial and show
the mounting on a more fine-grained level.
In a future tutorial we will show how to create cards and ship them as HACS
repositories. HACS does install cards into `config/www/community`. Let's mount a
development workspace for tutorials alongside, that is to `config/www/tutor`.
Add the `mounts` entry to the json array in `.devcontainer/devcontainer.json`.
Replace `<WorkspaceOfCards>` with the full path to your local workspace of cards
and `<YourRepoName>` with the matching directory name inside your container.
```json
"mounts": [
"source=/<WorkspaceOfCards>,target=/workspaces/<YourRepoName>/config/www/tutor,type=bind,consistency=cached"
]
```
**IMPORTANT HINT:**
The directory `www` did belong to `root:root` when I tried this again. But Home
Assistant is running as `vscode:vscode` and could not write to it. Additionally
I could not change it from within the shell of *vscode*. I could solve this
by manually creating the `www/` directory before mounting. I guess there is
a smarter solution than manually fixing this in advance.
Rebuild the container with the command `Dev Containers: Rebuild Container`.
Find the official documentation of the mount syntax
[here](https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount).
#### Trouble shouting
Did you put the `mounts` entry into the top level of the array, as it should be?
Don't put it into `settings` or any other wrong location.
Are the paths right? In doubt change into them and use `pwd` to spell out the full paths.
Then use copy and paste to avoid typos.
#### Challenge
You changed the `devcontainer.json` file and you can push the change to your
personal git repository. That's one good reason to keep your own fork of it.
This commit would get into your way, if you would like to create a pull request
for the Home Assistant core. It doesn't matter for the tutorial, though. You can
work around this by using different branches of your repository.
It would even be better, if you could mount directories without having to touch
the official `devcontainer.json`. I don't know a solution so far. Maybe you can
figure out one and contribute the solution.
| Setting up the development environment for the tutorials | developer-tools,home-assistant,python,tutorial,javascript,yaml,docker,vscode | 2023-01-24T09:49:38Z | 2023-05-24T13:44:26Z | null | 1 | 0 | 16 | 1 | 2 | 16 | null | null | null |
adarshswaminath/NFT-Finder | master | null | null | alchemyapi,javascript,nft,solidity | 2023-01-24T16:52:47Z | 2023-01-27T11:55:01Z | null | 1 | 0 | 13 | 0 | 0 | 16 | null | null | JavaScript |
sapachev/error-pages | main | [![Quality Check](https://github.com/sapachev/error-pages/actions/workflows/ci.yml/badge.svg)](https://github.com/sapachev/error-pages/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/sapachev/error-pages/badge.svg?branch=main)](https://coveralls.io/github/sapachev/error-pages?branch=main)
# The Error Pages
Lightweight tool to create static custom HTTP Error Pages in minimalistic adaptive and accessible design with customization and localization support.
![Screenshot](https://sapachev.github.io/error-pages/assets/screenshot.png?3)
## Features
* Static pages with simple and responsive design
* Lightweight and fast running
* Extensibility
* Customization
* Localization (i18n)
* Accessibility (a11y)
* Automated typography support
* Built-in web server config generator (Nginx)
## Demo
* [400 Bad Request](https://sapachev.com/error-pages/bad-request)
* [401 Unauthorized](https://sapachev.com/error-pages/unauthorized)
* [403 Forbidden](https://sapachev.com/error-pages/forbidden)
* [404 Not Found](https://sapachev.com/error-pages/not-found)
* [410 Gone](https://sapachev.com/error-pages/gone)
* [500 Internal Server Error](https://sapachev.com/error-pages/internal-server-error)
* [502 Bad Gateway](https://sapachev.com/error-pages/bad-gateway)
* [503 Service Unavailable](https://sapachev.com/error-pages/service-unavailable)
* [504 Gateway Timeout](https://sapachev.com/error-pages/gateway-timeout)
## Primitive Usage
If you want to get already precompiled packages, please download latest version from [official website](https://sapachev.github.io/error-pages/#precompiled-packages).
The installation steps are following:
1. Download [package](https://sapachev.github.io/error-pages/#precompiled-packages) and extract files from it
2. Copy static html files from `dist` directory to your server
3. Copy and apply config snippet from `dist` to your web server configuration.
## Basic Usage
Requirements: installed Node.js 11+
1. Checkout this repository to your local machine
2. Run `npm install --production` command to install dependencies
3. Run `npm run build` command to compile error pages and web server configs
4. Copy static html files from `dist` directory to your server
5. Copy and apply config snippet from `dist` to your web server configuration.
```
$ git clone git@github.com:sapachev/error-pages.git
…
$ npm install --production
…
$ npm run build
…
INFO: Start building process
INFO: Flush build directory ‘/home/error-pages/dist’
INFO: Compile pages from source data:
• /home/error-pages/dist/400.html
• /home/error-pages/dist/401.html
• /home/error-pages/dist/403.html
• /home/error-pages/dist/404.html
• /home/error-pages/dist/410.html
• /home/error-pages/dist/500.html
• /home/error-pages/dist/502.html
• /home/error-pages/dist/503.html
• /home/error-pages/dist/504.html
INFO: Compile web servers config snippets from source data:
• /home/error-pages/dist/nginx-error-pages.conf
INFO: Build Tailwind CSS styles
INFO: Run ‘INPUT="/home/error-pages/themes/minimalistic/@assets/css/main.twnd.css" OUTPUT="/home/error-pages/dist/@assets/css/main.css" npm run build:tailwind’ command
INFO: Tailwind CSS styles were built
INFO: Copying assets to ‘/home/error-pages/dist/@assets’ directory
INFO: Building process was completed in 1.727s
```
## Advanced Usage
In addition to steps from Basic Usage, you can improve results by changing some parts of the default package: templates, styles, texts, web server snippets.
The main configuration is stored in the `config.json` file in a root directory and you can change this config file according to your needs:
```
{
"tailwind": true,
"theme": "minimalistic",
"locale": "en"
}
```
There possible to run hot-reload server to develop your own theme with custom markup, styles, and scripts. To start dev-server just run command `npm run dev`. This command will start server on 8080 port ([http://localhost:8080](http://localhost:8080). By default, this address will be opened with a first status code, defined in `src` directory, which corresponds to configured `locale` value. You can choose any other code to continue specific page development. Don't be surprised with injected parts of code in a rendered page, because this is a part of hot-reload mode. Any change of the main configuration will require dev-server restart. The only configured theme and locale directories are watching during development.
### Templates
All templates are located in the `themes` directory. You can change the existing `minimalistic` theme or add a new one. There are no special requirements to page templates: every template is a usual HTML document with injected variables for the text messages from locale files. The [mustache.js](https://www.npmjs.com/package/mustache) library was used to handle variables injection and compile templates. So if you want to have something specific around templates, you can refer to this library documentation to get more information about templating.
After adding your own template, just specify it in the config file to compile a new page with this template.
### Styles
Templates styling is based on the [Tailwind CSS](https://tailwindcss.com/) framework. With this framework you can quickly create page styles without writing separate CSS code. The entry point of Tailwind styles must be located in the `themes/<name>/@assets/css/main.twnd.css` file. From this point will be created the `main.css` file with compiled and minified styles. In addition, you can tune the Tailwind by creating a custom `theme.tailwind.config.js` file located in the root of your theme directory and adding to it any Tailwind options, which you want. Full list of Tailwind options you can find in Tailwind [documentation](https://tailwindcss.com/docs/configuration).
However, if you don’t want to use Tailwind and prefer to use already existing CSS styles, you can disable Tailwind in the main configuration (`config.json` file). In this case, the Tailwind Build step will be just skipped without any side effects on results.
### Text Messages and Localization
All text messages are stored in JSON files, splitted by languages, which are placed in the `src` directory. Each page will be created from its locale file `<HTTP code>.json` (`<HTTP code>` is a number, related to specific HTTP status code). So if you want to create a page for the non-existing status code, then just create a JSON file with this status description.
Every locale file can be extended with any number of variables that you want to display on a page. To define common variables, you can use the `common.json` file — variables from this file will be applied to every page.
To localize your pages, just create a new directory in the `src` with any pages you want to generate. You are able to choose any set of HTTP status codes (for example, only for the 4xx errors), just follow the naming convention and don’t forget to extract common messages to the `common.json` file of your locale.
All texts are processing with [Typograf](https://github.com/typograf/typograf) library by default. This works automatically, so you don't need to adapt texts in the source directory. In case of new locale adding, please check a list of [supported locales](https://github.com/typograf/typograf/blob/dev/docs/LOCALES.en-US.md) and update locales mapping in `TYPOGRAF_LOCALES` constant.
### Server Configurations
During the build process, the Tool will automatically create a config snippet for your server. This snippet will contain information about handled errors and locations to reach the pages that represent them. At the moment, the only Nginx server supported.
You just need to copy all files from the `dist` directory to your server and apply automatically created config snippet to existing server configuration. According to the snippet template, all pages must be located in the `/usr/share/nginx/html/error-pages` directory. In case if you want to change something in a snippet, you can edit the template in the `snippets` directory. Same as for the page templates, these templates support the mustache.js engine, so you can use any render logic you want (lists, conditions, loops, etc).
The config snippet itself I would recommend to place in the `/etc/nginx/snippets/` directory and use the following line to include it to your configuration: `include /etc/nginx/snippets/nginx-error-pages.conf;`.
Here is an example of web server configuration with included the error pages snippet:
```
server {
server_name example.com;
access_log /var/log/nginx/example.access.log;
include /etc/nginx/snippets/nginx-error-pages.conf;
location / {
root /data/www;
}
}
```
## Contributing
This project is open to contributions and if you have any ideas and wish to realize them, then add Pull Request to discuss your idea solution. I will provide you with full support during this process. Don’t hesitate to ask me about code and solutions of your ideas.
| Lightweight tool to create static custom HTTP Error Pages in minimalistic adaptive and accessible design with customization and localization support. | accessibility,error-handling,html,http-error-pages,http-errors,javascript,localization,nginx,nginx-configuration,nodejs | 2023-01-20T20:16:23Z | 2023-11-03T18:47:32Z | null | 2 | 25 | 34 | 0 | 1 | 16 | null | MIT | TypeScript |
machumzd/MZEE-Shoes | mzee | null | E-Commerce project for Brototype which involves managing users, products, categories, coupons, and payments. To achieve this,I utilizing the powerful combination of Node.js, Express.js, and MongoDB. | express,hbs,javascript,mongodb,mvc,node,hacktoberfest | 2023-01-21T05:58:21Z | 2023-08-23T10:56:57Z | null | 2 | 3 | 25 | 0 | 2 | 16 | null | null | Handlebars |
Talha-Hanif5666/Todo-list-new | master | <a name="readme-top"></a>
<!-- TABLE OF CONTENTS -->
# 📗 Table of Contents
- [📗 Table of Contents](#-table-of-contents)
- [📖 To-do List Project ](#-to-do-list-project--)
- [🛠 Built With ](#-built-with-)
- [Key Features ](#key-features-)
- [🚀 Live Demo ](#-live-demo-)
- [💻 Getting Started ](#-getting-started-)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [👥 Author ](#-author-)
- [🔭 Future Features ](#-future-features-)
- [🤝 Contributing ](#-contributing-)
- [⭐️ Show your support ](#️-show-your-support-)
- [🙏 Acknowledgments ](#-acknowledgments-)
- [📝 License ](#-license-)
<!-- PROJECT DESCRIPTION -->
# 📖 To-do List Project <a name="about-project"></a>
**To-do List Project** is a tool that can help a person organize their everyday tasks.
## 🛠 Built With <a name="built-with"></a>
- HTML
- CSS
- JS
- Linter Checks
- Webpack
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- Features -->
### Key Features <a name="key-features"></a>
- **Add a task**
- **Delete a task**
- **Rearrange a task**
- **Mark a task as complete**
- **Remove all complete tasks**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LIVE DEMO -->
## 🚀 Live Demo <a name="live-demo"></a>
> Our live demo can be found on
- [Live Demo Link](https://talha-hanif5666.github.io/Todo-list-new/dist/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- GETTING STARTED -->
## 💻 Getting Started <a name="getting-started"></a>
To get a local copy up and running, follow these steps.
- Create a local directory where you can clone the project.
- Clone the project into your repository
- Install the dependencies
- Open the project on a browser
<p align="right">(<a href="#readme-top">back to top</a>)</p>
### Prerequisites
In order to run this project you need:
- Git and GitHub
- A code editor
- Nodejs
- A browser
<p align="right">(<a href="#readme-top">back to top</a>)</p>
### Setup
- Create a local directory where you can clone the project.
- Clone the project into your repository
- Install the dependencies
- Open the project on a browser
<p align="right">(<a href="#readme-top">back to top</a>)</p>
### Install
Just run npm i to install all dependencies
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- AUTHORS -->
## 👥 Author <a name="author"></a>
**Muhammad Talha Hanif**
- GitHub: [@githubhandle](https://github.com/Talha-Hanif5666)
- Twitter: [@twitterhandle](https://twitter.com/TalhaHa45039660?t=R4git6jFgsysI4xPxmN-ag&s=09)
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/muhammad-talha-hanif-6b1355116)
Contributions, issues, and feature requests are welcome!
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- FUTURE FEATURES -->
## 🔭 Future Features <a name="future-features"></a>
> Describe 1 - 3 features you will add to the project.
- [ ] **Improve the UI**
- [ ] **Add Structure**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- CONTRIBUTING -->
## 🤝 Contributing <a name="contributing"></a>
Contributions, issues, and feature requests are welcome!
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- SUPPORT -->
## ⭐️ Show your support <a name="support"></a>
If you like this project kindly leave a star
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- ACKNOWLEDGEMENTS -->
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thank microverse for the great resources shared.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
## 📝 License <a name="license"></a>
This project is [MIT](https://github.com/Talha-Hanif5666/To-Do-List/blob/list-structure/MIT.md) licensed. | This is a minimal to-do list used to organize your daily schedule. The system also helps to mark and unmark the completion progress of your daily tasks. It is done for educational purposes. | html,javascript | 2023-01-18T09:45:44Z | 2023-01-20T09:35:10Z | null | 1 | 3 | 27 | 0 | 0 | 15 | null | null | JavaScript |
cappig/steam-workshop-downloader | master | # Steam workshop downloader
## ⚠️ $\textcolor{red}{\textsf{This script no longer works}}$ ⚠️
![screenshot](steamdownloader.png)
## [Get the script ↡](https://greasyfork.org/en/scripts/458567-steam-collection-downloader)
A simple userscript that downloads mods and mod collections from the steam workshop.
A few notes:
- It takes some time for the download to begin.
- If it stops near the end wait a few seconds/minutes.
- It should take at most 2 minutes to download around 100 items.
- Almost all Cities: Skylines mods are downloadable. Some more popular mods for other games are available but less popular ones may not be.
A huge thanks to the folks at [smods.ru](https://smods.ru/) and [steamworkshop.download](http://steamworkshop.download/). They are the ones who provide all the mod downloads <3
Please [report](https://github.com/cappig/steam-workshop-downloader/issues) any bugs.
<br>
have fun :)
| A userscript that downloads items and collections from the steam workshop | greasyfork,javascript,steam-workshop,steam-workshop-scraper,userscript | 2023-01-19T22:51:11Z | 2023-08-24T14:16:12Z | null | 1 | 0 | 11 | 0 | 5 | 15 | null | GPL-3.0 | JavaScript |
tthayza/bora-codar | main | null | Esse repositório tem como objetivo armazenar os projetos semanais propostos pela RocketSeat no desafio #boraCodar. 🚀 | boracodar,rocketseat,javascript,programming,react,reactjs,webdevelopment,css3,css-grid,lucide-react | 2023-01-24T17:35:19Z | 2023-08-28T01:33:08Z | null | 1 | 0 | 151 | 0 | 2 | 15 | null | null | JavaScript |
Itsfoss0/power-learn-project | master |
![logo](./logo.webp)
# Power Learn Project
## About
This repo documents my Sofware Developement training journey at [Power Learn Project](https://powerlearnproject.org/) to become a __#1MillionDev4Africa__
## Curriculum
These are the modules covered in the curriculum
[Python Programming](./python-incubation)
- [X] Introduction to python
- [X] Python Data Strucutures
- [X] Flow control
- [X] Functions
- [X] Python Libraries
- [ ] Django
[Shell Scripting Basics](./shell-scripting)
- [X] CLI navigation
- [X] Linux Directory structure
- [X] Basic CLI commnads
- [X] Permissions
- [X] Bash Scripting
[Web Technologies](./web-development)
- Introduction to web Development
- [X] Introduction to HTML
- [X] HTML Links and Images
- [X] HTML forms
- [X] HTML input fields
- [X] HTML tables
- Styling websites using CSS
- [X] CSS selectors
- [X] Padding, Margin and Opacity
- [X] The Box model
- [ ] Flexbox
- Introduction to Javascript
- [X] Javascript Events, eventlisteners and DOM
- [X] Control flow in Javascript
- [X] Loops
- [X] Functions in Javascript
[Dart with Flutter](./hello-dart)
- [X] Introduction to Dart
- [X] Dart Datatypes
- [ ] Control flow and functions in Dart
- [ ] Object Oriented Programming
[Databases](./databases_basics)
- [X] Database Systems
- [X] Data VS information
- [X] Entities and attributes
- [X] Data modelling
- [X] Relationships
- [X] Introduction to SQL
- [X] Working with SQL
✅ Creating tables
✅ Joining tables
✅ Grouping Data
✅ Filtering Data
✅ Conditional statements
✅ Aggregate functions
✅ Set operations
## Projects
[Python Mini Project](./python-incubation/mini_project): Find the dictionary definition of a word
| This repository documents my journey as a Web Development Student at @PLPAfrica | dart,flutter,plp,javascript,python,plpafrica,html,power-learn-project | 2023-01-25T08:48:36Z | 2023-09-02T08:47:56Z | 2023-04-14T18:15:22Z | 1 | 0 | 439 | 0 | 1 | 14 | null | MIT | Python |
boenshao/leetcode-difficulty-rating-extension | main | # leetcode-difficulty-rating-extension
[![chrome web store](https://storage.googleapis.com/web-dev-uploads/image/WlD8wC6g8khYWPJUsQceQkhXSlv1/iNEddTyWiMfLSwFD6qGq.png)](https://chrome.google.com/webstore/detail/leetcode-difficulty-ratin/hedijgjklbddpidomdhhngflipnibhca)
## Introduction
Replace Leetcode problem's difficulty with a more precise contest rating sourced from [here](https://github.com/zerotrac/leetcode_problem_rating).
The green/yellow/red text color is preserved, so you can still tell the official difficulty.
Problems in 1st-62nd weekly contests and problems that did not come from contests don’t have rating data and `N/A` is shown by default. You can change the setting in the extension popup.
## Preview
![screenshot-1](/images/screenshot-1.png)
![screenshot-2](/images/screenshot-2.png)
## Installation
### Chrome Web Store
* [Leetcode Difficulty Rating](https://chrome.google.com/webstore/detail/leetcode-difficulty-ratin/hedijgjklbddpidomdhhngflipnibhca)
### Manually
1. Clone this repository
2. Open the browser and go to `chrome://extensions/`
3. Enable `Developer mode` on the top-right
4. Click `Load unpacked` on the top-left
5. Select the cloned repository
## Acknowledgement
* Ratings are based on <https://github.com/zerotrac/leetcode_problem_rating>
| Replace Leetcode problem's difficulty with a more precise contest rating. | chrome-extension,javascript,leetcode | 2023-01-21T14:36:02Z | 2023-09-12T13:55:10Z | 2023-09-13T05:12:29Z | 1 | 2 | 44 | 0 | 4 | 14 | null | MIT | JavaScript |
raihan2bd/hungry-hub | dev | # Hungry Hub - Online foods hub.
<p>
Hungry Hub is an online platform built using React, Redux, and Firebase, which allows users to browse and cart food items from a variety of restaurants and place orders for home delivery. Users can sign up, browse the menus of different restaurants, add food items to their cart, and proceed to checkout. The platform integrates with Firebase to provide secure payment options and order tracking for users. With Hungry Hub, users can enjoy the convenience of online food ordering and get their favorite meals delivered straight to their doorstep.
</p>
### Tech Stack
I used React, Redux, Firebase, Html, Javascript and css to build this Full Stack Project.
<summary>Full Stack</summary>
<ul>
<li>React</li>
<li>Redux</li>
<li>Firebase</li>
<li>JAVASCRIPT</li>
<li>Html</li>
<li>CSS</li>
</ul>
<summary>Dependencies</summary>
<ul>
<li><a href="https://www.npmjs.com/package/react-router-dom">react-router-dom</a></li>
<li><a href="https://www.npmjs.com/package/@reduxjs/toolkit">@reduxjs/toolkit </a></li>
<li><a href="https://www.npmjs.com/package/react-redux">react-redux</a></li>
<li><a href="https://www.npmjs.com/package/react-icons">react-icons</a></li>
<li><a href="https://www.npmjs.com/package/axios">axios</a></li>
<li><a href="https://www.npmjs.com/package/dotenv">dotenv</li>
</ul>
## Demo
### Click here to [Live Demo](https://hungry-hub.onrender.com)
![Capture](https://user-images.githubusercontent.com/35267447/223940500-3aea07b1-4bc6-4705-ae49-e64f96544b44.PNG)
![Capture3](https://user-images.githubusercontent.com/35267447/223940542-1d5d6920-0aa8-48a0-865a-97005077adac.PNG)
![Capture4](https://user-images.githubusercontent.com/35267447/223940600-fb056f9d-6c0e-483c-adad-2ea2fa7d29a5.PNG)
![Capture2](https://user-images.githubusercontent.com/35267447/223940635-6ac10b5b-490f-4d8b-8d80-3f511d0791ba.PNG)
![Capture5](https://user-images.githubusercontent.com/35267447/223940666-b7784a86-53bc-42ff-bc6c-bf9d0d0cfc29.PNG)
![Capture_mb_1](https://user-images.githubusercontent.com/35267447/223940706-81844f8d-abb5-41d6-919d-9d600d679453.PNG)
![Capture_mb_2](https://user-images.githubusercontent.com/35267447/223940725-9c61fece-fceb-40ce-9fb6-6a1430a3176f.PNG)
![Capture_mb_3](https://user-images.githubusercontent.com/35267447/223940745-ec7d0d5c-e08c-4bb5-8db3-24c859261b47.PNG)
## 💻 Getting Started
- To get star with this package first of all you have to clone the project ⬇️
``` bash
git clone https://github.com/raihan2bd/hungry-hub.git
```
- Make sure you have firebase authenticate api key. [See Firebase Rest Api documention](https://firebase.google.com/docs/reference/rest/auth)
- Then you have to create a file called **.env.local** in your project root lavel and you have to add your api key as like as below
![Capture](https://user-images.githubusercontent.com/35267447/219415563-f8faadff-3d27-4f48-aa8c-ec1a680f1a9d.PNG)
- Then Make sure you have install [NodeJs](https://nodejs.org).
- Then make sure you have install [React](https://reactjs.org/) on your local mechine if you want to use this project as localy.
- To install all the npm packages navigate the folder address on your terminal and enter the below command ⬇️
``` bash
npm install
```
# Usages
> *Note: Before enter the below command make sure you are in the right directory.*
- After downloading the packages To build the project as a single executable just run the below command. ⬇️
``` sh
npm run build
```
- After finishing the avove instructions you can see the project in your local mechine by entering the below command ⬇️
```sh
npm start
```
- Then you can see this project live on your browser by this link http://localhost:3000 or your given the port nuber you set for the project.
## 👥 Author
👤 **Abu Raihan**
- GitHub: [@githubhandle](https://github.com/raihan2bd)
- Twitter: [@twitterhandle](https://twitter.com/raihan2bd)
- LinkedIn: [LinkedIn](https://linkedin.com/in/raihan2bd)
## ⭐️ Show your support <a name="support"></a>
Thanks for visiting my repository. Give a ⭐️ if you like this project!
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thanks Microverse and [Academind](https://academind.com/) especially **Maximilian Schwarzmüller** who help me learn React and redux and help me to build this project.
## 📝 License <a name="license"></a>
This project is [MIT](./LICENSE) licensed.
## Contribution
*Your suggestions will be more than appreciated. If you want to suggest anything for this project feel free to do that. :slightly_smiling_face:*
| Hungry Hub is an online platform for food ordering built with React, Redux, and Firebase. Users can browse menus, add food items to their cart, and securely pay for their order. The platform provides order tracking and home delivery services to ensure a hassle-free experience. | css,firebase,html,javascript,locastorage,react,redux | 2023-01-21T09:34:02Z | 2023-03-11T14:29:58Z | null | 1 | 15 | 101 | 0 | 0 | 14 | null | MIT | JavaScript |
ehsanmorgan/django-eccomerce | main | ![plot](screencapture-127-0-0-1-8000-2023-03-19-17_51_28.png)
| online store website built with Python contain products , orders , payments , user accounts , full Api with documentation and testing | css,django,git,github,html,javascript,python,aws,bootstrap,docker | 2023-01-23T20:06:52Z | 2023-08-15T10:30:38Z | null | 1 | 0 | 214 | 0 | 0 | 13 | null | null | Python |
dsrvlabs/czg-keremony | main | # CZG-Keremony
Proto-danksharding requires a new cryptographic scheme: KZG Commitments.
This client was created to participate in KZG Ceremony for Proto-danksharding (aka [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844)) in Ethereum.
For more information about KZG Ceremony, please read [Announcing the KZG Ceremony](https://blog.ethereum.org/2023/01/16/announcing-kzg-ceremony) at Ethereum foundation blog.
## Which BLS library did the CZG-Keremony client use?
The BLS library used in the CZG-Keremony client is the [noble-curves](https://github.com/paulmillr/noble-curves) library.
## Why do we make a client with JavaScript?
JavaScript is a versatile language that can run on a wide range of platforms and devices. While there are clients available for other programming languages such as Go, Rust, Java, and C++, there are currently no clients written in pure JavaScript. As a result, a client has been developed in JavaScript for the diversity of the client availability. Having clients written in multiple programming languages can help decentralize the ceremony and make it more robust and secure.
## Dependencies
1. Install `Node.js v18+` and `npm`.
2. Run `npm install`.
## How to use CZG-Keremony client?
This CZG-Keremony client provides an interactive prompt to participate in KZG ceremony.
To participate in ceremony, you must have at least one that satisfies the following:
- Ethereum - An Ethereum address is required to have sent at least 3 transactions before Jan. 13, 2023 (block number 16,394,155)
- GitHub - A GitHub account that has a commit dated before 1 August 2022 00:00 UTC.
### Contribution in one machine
#### Step 1. Start interactive prompt
If you want to participate in the actual contribution, please start.
```
~$ ./index.js start
```
If you want to start with a different sequencer address, use the `-s` or `--sequncer` flag.
```
~$ ./index.js start --sequencer https://kzg-ceremony-sequencer-dev.fly.dev
```
#### Step 2. Select authentication method
Choose the authentication method you want, Ethereum or GitHub.
```
Authentication
? Which method do you prefer for authentication? (Use arrow keys)
❯ ethereum
github
```
If you select either `ethereum` or `github`, you will receive a URL.
```
? Which method do you prefer for authentication? ethereum
https://oidc.signinwithethereum.org/authorize?xxxxxx
```
#### Step 3. Input your session ID
After accessing the given URL, you need to go through the authentication process and get a session ID, which you then need to input. Once you have inputted your session ID, you can start contributing.
If there is another contributor, the client retries every 30 seconds. Wait until your turn comes.
```
? Input your session ID: <session ID>
2023-03-02 20:46:00 [ info ] Try and Wait...
2023-03-02 20:46:01 [ info ] another contribution in progress - retry after 30 seconds
2023-03-02 20:46:32 [ info ] another contribution in progress - retry after 30 seconds
2023-03-02 20:47:02 [ info ] another contribution in progress - retry after 30 seconds
2023-03-02 20:47:33 [ info ] another contribution in progress - retry after 30 seconds
```
When it's your turn, run the ceremony
```
2023-03-02 20:43:18 [ info ] Run Ceremony...
2023-03-02 20:43:18 [ info ] Decoding contributions....
2023-03-02 20:43:35 [ info ] Update Power of Tau...
2023-03-02 20:43:35 [ info ] Run contribute worker
2023-03-02 20:43:35 [ info ] Run contribute worker
2023-03-02 20:43:35 [ info ] Run contribute worker
2023-03-02 20:43:35 [ info ] Run contribute worker
2023-03-02 20:44:12 [ info ] Receive new contribution
2023-03-02 20:44:44 [ info ] Receive new contribution
2023-03-02 20:45:44 [ info ] Receive new contribution
2023-03-02 20:47:41 [ info ] Receive new contribution
2023-03-02 20:47:41 [ info ] Update Witnesses...
2023-03-02 20:47:41 [ info ] Encoding...
2023-03-02 20:47:42 [ info ] Send contributions
2023-03-02 20:47:50 [ info ] Successfully contributed!
2023-03-02 20:47:50 [ info ] {
receipt: ...
signature: ...
}
```
If the contribution is successful, you can obtain two files.
- `contributions.json`: Contribution actually submitted to the sequencer.
- `receipt.json`: Receipt received from sequencer for your contribution.
### For Air-Gapped Contribution
There are additional command for air-gapped contribution.
Below steps will be procees with two separated machined
and also recommended to use network blocked a machine, will calculate the contribution.
#### Step 1: Authenticate and download previous contribution files
First, on the network-connected machine, try below to retrieve previous contributions.
```
~$ ./index.js try-contribute
2023-03-31 14:04:43 [ info ] Start try contribution
? Which method do you prefer for authentication? github
https://oidc.signinwithethereum.org/authorize?xxxxxx
? Input your session ID: <session ID>
2023-03-31 14:04:56 [ info ] Try and Wait...
2023-03-31 14:04:59 [ info ] Previous contribution is written on contribution_<session ID>.json
```
You will get the new json file, which the name forms `contribution_<session ID>.json`.
#### Step 2: Move prev. contribution file to air-gapped machine
Then, copy the contribution file and copy it into air-gapped machine.
You may use flash memory(USB memory) to copy the contribution file into air-gapped machine.
I definitely recommend that do not connect air-gapped machine for copying the contribution file.
#### Step 3: Create new contribution
Now, try to calculate new contribution from air-gapped machine.
```
~$ ./index.js execute-ceremony -f ./contribution_<session ID>.json
2023-03-31 14:14:04 [ info ] Start Execute Ceremony
2023-03-31 14:14:04 [ info ] Run Ceremony...
2023-03-31 14:14:04 [ info ] Decoding contributions....
2023-03-31 14:14:14 [ info ] Update Power of Tau...
2023-03-31 14:14:14 [ info ] Run contribute worker
2023-03-31 14:14:14 [ info ] Run contribute worker
2023-03-31 14:14:14 [ info ] Run contribute worker
2023-03-31 14:14:14 [ info ] Run contribute worker
2023-03-31 14:14:35 [ info ] Receive new contribution
2023-03-31 14:14:48 [ info ] Receive new contribution
2023-03-31 14:15:17 [ info ] Receive new contribution
2023-03-31 14:16:14 [ info ] Receive new contribution
2023-03-31 14:16:14 [ info ] Update Witnesses...
2023-03-31 14:16:15 [ info ] Encoding...
2023-03-31 14:16:15 [ info ] Previous contribution is written on new_contribution.json
```
#### Step 4: Copy the new contribution file
Similary to Step 2, move the result file to internet-connected machine.
I also recommend that do not connect internet.
#### Step 5: Upload new contribution file
If you copy the new contribution file into internet connected machine,
the final step is uploading it to the sequencer.
```
~$ ./index.js contribute -f ./new_contribution.json --session_id <session ID>
2023-03-31 14:32:27 [ info ] Submit contribution
2023-03-31 14:32:27 [ info ] Send contributions
2023-03-31 14:33:29 [ info ] Successfully contributed!
2023-03-31 14:33:29 [ info ] {
receipt: ...
signature: ...
}
```
If the file is uploaded successfully, you will get `receipt.json` file.
#### Step 6: Destory the machine, which is used at Step 3
Most important step. Destory air-gapped machine!
## Contact us
Please, contact [us](mailto:validator@dsrvlabs.com) if you have any improvements and need any further information about **CZG-Keremony**.
**DSRV** is a blockchain infrastructure company that provides powerful and easy-to-use solutions to enable developers and enterprises to become architects of the future. Visit [DSRV](https://dsrvlabs.com/), if you are interested in various products we build for the Web 3.0 developers.
[<img alt="Homepage" src="https://user-images.githubusercontent.com/63234878/210315637-2d30efdd-5b9e-463e-8731-571916a6e1e3.svg" width="50" height="50" />](https://www.dsrvlabs.com/)
[<img alt="Medium" src="https://user-images.githubusercontent.com/6308023/176984456-f82c5c67-ebf3-455c-8494-c64ebfd66c58.svg" width="50" height="50" />](https://medium.com/dsrv)
[<img alt="Github" src="https://user-images.githubusercontent.com/6308023/176984452-c73aa188-563a-4b93-8ad8-cd7974770275.svg" width="50" height="50" />](https://github.com/dsrvlabs)
[<img alt="Youtube" src="https://user-images.githubusercontent.com/6308023/176984454-52c20db5-6b8f-4c15-a621-dd4a0052e99f.svg" width="50" height="50" />](https://www.youtube.com/channel/UCWhv8Kd430cEMpEYBPtSPjA/featured)
[<img alt="Twitter" src="https://user-images.githubusercontent.com/6308023/176984455-d48b24a9-1eb4-4c38-b728-2f4a0ccff09b.svg" width="50" height="50" />](https://twitter.com/dsrvlabs)
| JavaScript-based client to participate in Ethereum KZG Ceremony | bls12-381,eip4844,ethereuem,javascript,kzg,kzg-commitment,nodejs,powers-of-tau | 2023-01-17T06:32:31Z | 2023-04-19T13:21:02Z | null | 13 | 24 | 48 | 5 | 4 | 13 | null | MIT | JavaScript |
ilyasbelfar/ONetwork-Forum | main | # <p align="center">🌐 ONetwork Forum</p>
<p align="center"><img src="https://github.com/ilyasbelfar/ONetwork-Forum/blob/main/images/Capture_Forum.PNG" alt="ONetwork Forum Capture" style="max-width: 100% !important"></p>
<p align="center">✨🚀<em>Full-stack forum website built with MERN Stack (ReactJS, NodeJS, ExpressJS, MongoDB).</em>✨🚀</p>
[Live Demo](https://onetwork.ilyasbelfar.me)
---
### <p align="center">☄ Features ☄</p>
- User authentication using JSON Web Tokens (JWT) with BFF (Backend-For-Frontend) security pattern.
- Allow users to create, read and delete topics.
- Allow users to create, read and delete comments.
- Allow users to create, read and delete replies.
- Search engine for searching topics supported with sorting filters.
- Allow users to upvote and downvote topics and comments.
- Allow users to see their published comments, created topics, upvoted topics, their following list and their followers list.
- Allow users to reset their account password if they forgot it.
- Nested comments threading.
- Homepage feed (Front Page).
- Allow users to follow each other.
- Allow users to edit their profile informations and change their profile avatar and cover.
- Users can't access their account after signin-up till they activate it from the link sent to the email associated with their account.
- Sending users an email in case they request a password reset or an email verification.
- ... And more to come with next updates!
<br>
---
## <p align="center">💻 Used Technologies 💻</p>
- ReactJS
- ExpressJS
- NodeJS
- MongoDB
- Redux
- Redux Toolkit
- React Bootstrap
---
## <p align="center">❓ How to use ❓</p>
<br>
<p align="center"><strong>1- Clone this repo.</strong></p>
```
git clone https://github.com/ilyasbelfar/ONetwork-Forum.git
cd ONetwork-Forum
```
<p align="center"><strong>2- Install Client dependencies.</strong></p>
```
cd client/
npm i
```
<p align="center"><strong>3- Install Server dependencies.</strong></p>
```
cd server/
npm i
```
<p align="center"><strong>4- Configure environment variables by creating .env file in the server directory and copy the content of env.example file in .env file, and fill it with your own secrets.</strong></p>
```
cd server/
cp env.example .env
```
<p align="center"><strong>5- Create a MongoDB database and name it 'my_app', You can use MongoDB Atlas cloud free tier.</strong></p>
<p align="center"><strong>6- Start server.</strong></p>
```
cd server/
npm start
```
<p align="center"><strong>7- Start client in another terminal while the server is running.</strong></p>
```
cd client/
npm start
```
---
## <p align="center">📌 Other 📌</p>
<br>
<p align="center">I encourages contributions! Feel free to discuss any bug fixes/features in the issues section. And if you wish to work on this project:</p>
1. Fork [this project](https://github.com/ilyasbelfar/ONetwork-Forum)
2. Create a branch (`git checkout -b new-branch`)
3. Commit your changes (`git commit -am 'add new feature'`)
4. Push to the branch (`git push origin new-branch`)
5. [Submit a pull request!](https://github.com/ilyasbelfar/ONetwork-Forum/pull/new/master)
| 🌐 ONetwork Forum - Built from scratch with MERN Stack | mern,forummern,forumwebsite,mernwebsite,javascript,mongodb,nodejs,reactjs,jwt,jwt-authentication | 2023-01-21T23:48:32Z | 2023-04-15T00:38:56Z | null | 1 | 0 | 30 | 0 | 2 | 13 | null | null | JavaScript |
Nikita-Filonov/playwright_typescript | main | # Playwright Typescript
[Demo allure report](https://nikita-filonov.github.io/playwright_typescript/)
**Project setup**
```
git clone https://github.com/Nikita-Filonov/playwright_typescript.git
cd playwright_typescript
yarn install
yarn playwright install
```
**Starting auto tests**
```
npx playwright test
```
| null | automation,cypress,javascript,playwright,playwright-javascript,playwright-typescript,test-automation,typescript,ui,allure | 2023-01-22T19:41:35Z | 2023-02-18T15:44:42Z | null | 1 | 0 | 13 | 0 | 3 | 13 | null | Apache-2.0 | TypeScript |
sgi-demos/sgi-demos | main | ## SGI demos from long ago, running in your browser [today](https://sgi-demos.github.io).
_Old problems require modern solutions._
This is the original SGI demo source code, compiled for the web using Emscripten and SDL2. Rendering is done using an IRIS GL software rasterizer from the [Alice 4 project](https://lkesteloot.github.io/alice/alice4/libgl.html). Event handling is done by SDL2, with events translated into GL's event system. Each demo is a separate web page, with its own Javascript + WASM compiled by Emscripten from the original C/C++ source. Minimal modifications have been made to the original source, in order to run in the browser and to work with compilers 35 years newer.
Working demos:
- [Buttonfly](https://sgi-demos.github.io/)
- [Bounce](https://sgi-demos.github.io/sgi-demos/bounce/web/bounce_full.html)
- [Ideas](https://sgi-demos.github.io/sgi-demos/ideas/web/ideas_full.html)
- [Insect](https://sgi-demos.github.io/sgi-demos/insect/web/insect_full.html)
- [Jello](https://sgi-demos.github.io/sgi-demos/jello/web/jello_full.html)
- [Logo](https://sgi-demos.github.io/sgi-demos/logo/web/logo_full.html)
- [Twilight](https://sgi-demos.github.io/sgi-demos/twilight/web/twilight_full.html)
Work in progress demos:
- [Flight](https://sgi-demos.github.io/sgi-demos/flight/web/flight_full.html) (cockpit glitches, planes too slow in web version, night mode 'shimmers', no network play)
- [Newave](https://sgi-demos.github.io/sgi-demos/newave/web/newave_full.html) (no mesh editing, no popup menus, only wireframe)
- [Arena](https://sgi-demos.github.io/sgi-demos/arena/web/arena_full.html) (no network play)
Next up:
- Electropaint, Cedit, any other IRIS GL demos I can find
To do:
- Arbitrary window size
- Triangle rendering via OpenGLES/WebGL
- Popup menus
- Rudimentary context for each demo: name, author, year (as text in lower corner), code link
- Virtual mouse and keyboard:
- Only display virtual keys and mouse functions used by the demo; use demo's qdevice() calls to determine this
- Displayed as transparent virtual mouse and key pictures overlaid on demo
- On always for touch devices
- On/off for mouse/keyboard devices, as hints
- More demos, _all the demos_. WIP: IRIS GL, TBD: OpenGL, GLUT, Inventor, Performer
- Run GL demo in its own WASM worker, to avoid slicing up the code for SDL's event loop
- Description/history/context for each demo - can obtain some descriptions from .Info slide files
- Man pages
Credits:
- Everyone who worked at [SGI](https://en.wikipedia.org/wiki/Silicon_Graphics), for the eye candy and the baller computers.
- The [Alice 4 folks](https://lkesteloot.github.io/alice/alice4/), for the inspiration and the GL implementation.
- [Emscripten](https://emscripten.org) and [SDL](https://www.libsdl.org) teams, for making a web port possible.
- [Internet Archive](https://archive.org/search?query=sgi&and%5B%5D=mediatype%3A%22software%22), [Bitsavers](https://bitsavers.org/bits/SGI/mips/cd/), [WinWorld](https://winworldpc.com/search?q=irix), [IRIXNet](https://irixnet.org/files.html), and others, for saving the history.
| SGI demos from long ago, running in your browser today. | emscripten-port,opengl,opengles,sgi,silicon-graphics,irisgl,emscripten,demo,irix,javascript | 2023-01-18T15:19:43Z | 2023-06-07T19:26:17Z | null | 1 | 0 | 139 | 0 | 3 | 12 | null | Apache-2.0 | C |
fuma-nama/discord-fp | master | <p align="center">
<img alt="logo" src="./document/logo.png" width="200" />
<h1 align="center">Discord-FP</h1>
<p align="center">A Beautiful Application Command Framework For <b>Discordeno & Discord.js</b></p>
</p>
## Features
- **Type-safe**
- Light-weight
- High performance
- Auto-complete & Middlewares
- File-system Based
- Beautiful code with Functional Programming
- Support both **Discordeno and Discord.js**
- Compatible with **ESM and CommonJS**
## Install
### Discordeno
Refer to [here](./packages/discordeno/README.md) for Documentation of Discord-FP for discordeno
```
npm install @discord-fp/discordeno
```
### Discord.js
```
npm install @discord-fp/djs
```
> **Note** <br />
> Example below uses commonjs + typescript + import alias <br />
> you may convert it into normal common js syntax yourself
## Slash command in the Best way
Stop writing lots of `interaction.options.get("name")` just for getting the value of an option
Let us handle **everything!**
```typescript
import { options } from "@discord-fp/djs";
import { command } from "@/utils/dfp";
export default command.slash({
description: "Say Hello to you",
options: {
name: options.string({
description: "Your name",
}),
},
execute: async ({ event, options }) => {
await event.reply(`Hello, ${options.name}`);
},
});
```
## Find your Command _Instantly_
Tired of finding your command all the place? All commands are file-system based!
Search file by name, you are able to find your command **instantly**
For slash command: `test hello`
> commands/test/\_meta.ts
```ts
import { command } from "@/utils/dfp";
export default command.group({
description: "Your Command Group description",
});
```
> commands/test/hello.ts
```ts
import { command } from "@/utils/dfp";
export default command.slash({
//...
});
```
## Powerful & Beautiful
Not just slash commands, you are able to create context menu commands with **few lines of code**
> commands/Delete Message.ts
```ts
import { command } from "@/utils/dfp";
export default command.message({
async execute({ event }) {
await event.reply("I don't wanna delete message!");
},
});
```
## Middleware
Wanted to run something before executing a command?
With middleware, you can control how an event handler being fired, or pass context to the handler
> utils/dfp.ts
```ts
import { initDiscordFP } from "@discord-fp/djs";
export const dfp = initDiscordFP();
export const command = dfp.command;
//Don't return anything to prevent calling the handler
export const protectedCommand = command.middleware(({ event, next }) => {
return next({
ctx: {
message: "hello world",
},
event,
});
});
```
> commands/your-command.ts
```ts
import { protectedCommand } from "@/utils/dfp";
export default protectedCommand.slash({ ... })
```
## Everything is Type-safe + Null-safe
From config, middleware context, to options values, It's all type-safe!
```ts
export default command.slash({
description: "Say Hello to you",
options: {
enabled: options.boolean({
description: "Enabled",
required: false,
}),
number: options.number({
description: "Example number",
required: true,
}),
},
//...
});
```
Take a look at `options`:
```
(parameter) options: {
enabled: boolean | null;
number: number;
}
```
## Getting Started
Try our [template](https://github.com/SonMooSans/discord-bot-starter) which includes everything you need
| Discord.js | Discordeno |
| -------------------------------- | --------------------------------------- |
| [Docs](./packages/djs/README.md) | [Docs](./packages/discordeno/README.md) |
## ESM Usage
ESM has been supported since v0.2.1
> **Note** <br />
> If you have any problems with relative path, you may pass an absolute path instead
### Common js
```ts
const { ... } = require("@discord-fp/djs");
```
### ESM
```ts
import { ... } from "@discord-fp/djs";
```
## Any issues?
Feel free to open an issue! <br />
Give this repo a star if you loved this library
| A Beautiful Application Command Library for Discord.js and Discordeno | application-command,discord,discord-bot-framework,discord-framework,discord-js,javascript,javascript-library,typescript,discord-library,discordeno | 2023-01-21T16:46:30Z | 2023-04-25T13:25:15Z | 2023-04-24T15:59:48Z | 2 | 6 | 126 | 0 | 1 | 12 | null | MIT | TypeScript |
urbit/js-http-api | master | # Urbit JS HTTP API
This project allows you to connect to an [Urbit](https://urbit.org) ship via a JavaScript application. In-depth usage can be found in [the guide](https://developers.urbit.org/guides/additional/http-api-guide).
## Example
Check out the `example` directory for examples of how to use this code.
1. Open `example/index.html` in your browser and follow the instructions there, or
2. With a ship running in the same fashion as indicated in the file above, run `node example/index.js`
The code for either of these can be found in `src/example/browser.js` or `src/example/node.js`, depending on your context.
## Design
This library is designed to be useful for node applications that communicate with an urbit running either on the local computer or on a remote one.
The majority of its methods are asynchronous and return Promises. This is due to the non-blocking nature of JavaScript. If used in a React app, response handlers should be bound with `this` to `setState` after a message is received.
## NOTE
You must enable CORS requests on your urbit for this library to work in browser context. Use `+cors-registry` to see domains which have made requests to your urbit, and then approve the needed one, e.g. `|cors-approve http://zod.arvo.network`.
| A JS library for interfacing with Urbit over HTTP | http,javascript,urbit | 2023-01-20T21:51:05Z | 2024-03-14T15:39:35Z | null | 14 | 13 | 53 | 0 | 6 | 12 | null | null | TypeScript |
jarolthecoder/Portfolio-V3 | main | # Jarol Riera Portfolio V3
This is the code base of my most recent portfolio website, built with React and Vite. As my second project with React I wanted to dive right into practice and put my new skills to the test. The project includes the use of components, routing, and implementation of the [AOS](https://github.com/michalsnik/aos) animation library, allowing for a seamless and dynamic user experience. I also wanted to challenge myself further and work with more complex animations, so I also explored the use of the [GSAP](https://greensock.com/) library. I am very satisfied with the outcome as not only did I improve my understanding of React, but I also feel more confident in my ability to utilize this technologie in future projects, including the implementation of more advanced animations working with GSAP.
<p align="center">
<img src="/src/assets/jarolriera-portfolio-cover.webp" alt="project image">
</p>
This project includes the use of several key features of the React library, such as:
- Components, to break down the UI into reusable and modular parts
- Routing, to handle client-side navigation
- Animation libraries, to add dynamic and engaging user experience
## Tools
- React.js
- React Router
- GSAP Animations
- AOS Animation
| Code base of my portfolio website V3 built with React | css3,html5,javascript,react,reactjs,aos,aos-animation,gsap,gsap-animation | 2023-01-25T20:24:39Z | 2023-12-17T20:08:04Z | null | 1 | 0 | 36 | 0 | 1 | 12 | null | null | JavaScript |
zehracakir/JavascriptNotlarim | main | # Javascript
## NodeJS Nedir?
- Node.js, açık kaynaklı, genelde sunucu tarafında çalışan ve ağ bağlantılı uygulamalar için geliştirilmiş bir çalıştırma ortamıdır.
- NodeJS kurulumu için : [https://nodejs.org/en/download/](https://nodejs.org/en/download/)
- NodeJS versiyon kontrolü için cmd de → node —version komutunu çalıştırmamız gerekir.
## **JavaScript Nedir?**
JavaScript, kısaltılmış haliyle JS,minimum maliyetle maksimum verim alınmasına yönelik programlama (tasarım) konseptidir.
### **JavaScript ile Java farklı dillerdir.**
JavaScript ve Java arasında; isimleri, yazım şekli ve standart kütüphanelerindeki benzerlikler dışında bir bağlantı yoktur ve iki dilin semantikleri çok farklıdır.
![resim1.PNG](images/resim1.png)
## **HTML, CSS ve JavaScript (Web'in temel taşları)**
HTML ve CSS ile JavaScript, World Wide Web'in (kısaca WWW veya Web) **temel üç öğesinden** biridir. Yaygın olarak web tarayıcılarında kullanılmakta olan JavaScript ile yazılan istemci tarafı betikler sayesinde tarayıcının kullanıcıyla etkileşimde bulunması, tarayıcının kontrol edilmesi, asenkron bir şekilde sunucu ile iletişime geçilmesi ve web sayfası içeriğinin değiştirilmesi gibi işlevler sağlanır.
Aşağıda yer alan görseldeki gibi HTML bir web sitesinin iskeletini yani ana yapısını oluşturmakta, CSS bu ana yapıya görsellik ve şekil vermekte, JavaScript ise yapının fonksiyonel olarak çalışmasını sağlamaktadır.
![resim2.PNG](images/resim2.png)
## **JavaScript'in Kullanılabileceği Alanlar**
- Front-end
- Back-end
- Mobil (Mobile)
- Masaüstü (Desktop)
- Oyun (Game)
- Makine Öğrenmesi, Derin Öğrenme ve Yapay Zeka (Machine Learning, Deep Learning & Artificial Intelligence)
## Merhaba Dünya
```csharp
console.log("Merhaba Dünya")
alert("Merhaba Dünya") // Sitede uyarı penceresi olarak göstermek için
document.write("Merhaba Dünya") // Dokümana yazdırmak için
```
console.log kullanımı :
![resim3.PNG](images/resim3.png)
## Değişken Tanımlama
- Değişkenler, girdiğimiz verileri, bilgileri tutar. Değişken isimlendirmede dikkat etmemiz gerekenler şunlardır.
- Değişken isimleri harf, _ veya $ işareti ile başlayabilir.
- İlk harften sonra değişken isimlerinde rakamlar da kullanılabilir. $ ve _ dışında başka noktalama işaretleri kullanılamaz.
- Değişken ismindeki harfler arasında boşluk kullanılamaz.
- JavaScript loosely typed bir programlama dilidir. Yani bir değişkeni tanımlarken değişkenin türünü (sayısal, metinsel, boolean) belirtmemize gerek yoktur.
### var
- Değişken değerleri değiştirilebilir.
- Aynı isimle tekrardan tanımlanabilirler.
- var ile tanımlanan değişkenler global scope veya function scope'tur. Global scope'ta tanımlanan değişkenlere her yerden ulaşılabilir. Function içerisinde tanımlanan değişkenlere ise tanımlı olduğu fonksiyonda ulaşılabilir.
```jsx
// var ile değişken tanımlamak
var serverName = "zehracakir";
console.log(serverName);
```
### let
- Değişken değerleri değiştirilebilir.
- Aynı isimle tekrardan aynı blokta tanımlanamaz. Farklı block'larda aynı isimle tanımlanabilir.
```jsx
// let ile değişken tanımlamak
let serverName;
console.log(serverName);
// let ile değişkene bilgi atamak
serverName = "https://github.com/zehracakir";
console.log(serverName);
//let ile değişkene bilgi atayarak tanımlamak
let password = "1234";
console.log(password);
// değişken ataması yapmadan önce kullanmaya çalışmak
/* console.log(fullName);
let fullName = "Zehra Çakır";
--> yukarıdaki kullanımda hata alırız.
Değişkeni tanımlamadan ekrana bastırmaya çalıştık.
Bunu var ile tanımlasak hatayı göremezdik sadece undefined derdi.*/
let fullName = "Zehra Çakır";
console.log(fullName);
// let kullandığımızda hataları daha net şekilde görebiliyoruz. var da böyle bir imkanımız olmuyor.
//let ile tanımlanan değişkenin içindeki bilgiyi değiştirmek
fullName = "Lorem Ipsum";
console.log(fullName);
// let ile tanımlanan değişkenlerin içlerindeki bilgiler birden fazla kez değiştirilebilir
// let ile birleştirme veya ekleme işlemi
fullName = "Zehra"; + fullName
console.log(fullName);
console.log(fullName + " Deneme");
fullName += " Yeni Eklenen Bilgiler";
console.log(fullName);
fullName = "Sıfırlandı";
fullName += " ve yeni fullName";
console.log(fullName);
```
### const
- const ile tanımlanan objelerin özellikleri (properties) değiştirilebilir fakat objenin kendisi değiştirilemez. Diziler içinde aynısı geçerlidir. Dizi değerleri değiştirilebilir fakat dizinin kendisi değiştirilemez.
```jsx
// const ile değişkeni boş tanımlamaya çalışmak
const serverPassword = ""; // içi boş bir değişken tanımladım
console.log(serverPassword);
const SERVER_PASSWORD = "sdü";
console.log(SERVER_PASSWORD);
// SERVER_PASSWORD = "1234";
// Bu kısımda hata alırız. Çünkü const ile tanımlanan değişkenlerin içerikleri daha sonradan DEĞİŞTİRİLEMEZ. Değiştirilebilecek bir değişken istersek bunu let ile tanımlayabiliriz.
```
## Number Veri Türü Kullanımı
JavaScript dili weakly-typed yani güçsüz türlü bir dildir. Değişkenlerin ve parametrelerin türlerini bildirmek gerekmez. Tür kullanımdan dolaylı olarak çıkartılır.
- Number veri türü tanımlamak :
```jsx
// number veri türü tanımlamak
let price = 100;
let tax = 0.18;
let priceTax = price * tax;
let total = price + priceTax;
console.log("fiyat :",price,
"kdv oranı : ",tax,
"kdv tutarı: ",priceTax,
"Toplam Fiyat",total);
```
- Aritmetik işlemler yapmak :
```jsx
// toplama işlemi
let counter = 320;
counter = counter + 1; // uzun yöntem
console.log(counter);
counter +=1;
console.log(counter); // kısa yöntem
counter++;
console.log(counter); // en kısa yöntem
// çıkarma işlemi
counter--; // 1 azaltma
console.log(counter);
counter -=1; // 1 azaltma
console.log(counter);
// çarpma işlemi
counter *=10;
console.log(counter);
// bölme işlemi
counter /=10;
console.log(counter);
// işlem önceliği
console.log(2 + 3 * 10); // 32
console.log((2 + 3) * 10); // 50
// mod(kalan) alma %
// Örnekler üzerinden gidelim
// 1-) sayı tek mi çift mi --> 0 ise çift, 1 ise tek
console.log(3 % 2); // kalan 1 olur
console.log(14 % 2); // kalan 0 olur
// 2-) 8 ürün alan koliye tüm ürünler sığıyor mu ?
console.log("kalan ürün sayısı :",18 % 8);
// üs alma **
console.log("normal çarpma ile",2 * 2 * 2 * 2);
console.log("üs alma ile",2 ** 4);
// aşağı yuvarlama işlemi --> Math.floor()
console.log("aşağı yuvarlama sonucu:",Math.floor(1.9)); // 1
// // yukarı yuvarlama işlemi --> Math.ceil()
console.log("yukarı yuvarlama sonucu:",Math.ceil(1.9)); // 2
// yakına yuvarlama işlemi --> Math.round()
console.log("yakına yuvarlama sonucu:",Math.round(1.5)); // 2
console.log("yakına yuvarlama sonucu:",Math.round(1.4)); // 1
```
- String i number a dönüştürme
```jsx
let stringNumber = "11";
console.log(stringNumber);
let newNumber = Number(stringNumber);
console.log(newNumber); // türü değişti
```
## **Boolean Veri Türü Kullanımı**
Boolean veri tipleri sadece iki değerden birini ifade eder. Bunlar true ya da false'dur.
- 0 ve 1 i anlamak
```jsx
let isActive = false; // 0
isActive = true; // 1
console.log(isActive); // true
```
- True ve false’u neye göre döndürür
```jsx
let userName;
let isUserName = Boolean(userName); // false
console.log(isUserName); // false döndü
console.log(Boolean("11")); // true
console.log(Boolean("")); // false
/*
Boolean içi boş olursa false, dolu olursa true döndürür.
*/
userName = "user";
console.log("User Name :",Boolean(userName)); //true
// 0 ve -0 da Boolean false döndürür.
console.log(Boolean(0)); // false
console.log(Boolean(-0)); // false
console.log(Boolean(-0.1)); // true
console.log(Boolean(5 == 5)); // 5, 5 e eşit mi --> true
console.log(Boolean(5 == 10)); // 5, 10 a eşit mi --> false
```
- Karar yapılarında boolean kullanırız.
```jsx
console.log("büyük mü",Boolean(userName.length > 0)); // true
```
### **Boolean Veri Türü JavaScript'te Neyi İfade Eder?**
JavaScript'te boolean veri türü, primitive yani ilkel veri tiplerinden bir tanesidir. Mantık olarak diğer dillerle tamamen aynıdır. If-else, switch, while gibi koşullu ifadelerle birlikte oldukça sık bir şekilde kullanılır. Boolean veri türü Mozilla Firefox, Google Chrome, Safari, Opera ve Internet Explorer tarafından desteklenmektedir.
### **Değişken Türünü Kontrol Etmek ve Değişken Türünü Değiştirmek**
- typeof() ile verilerimizin türlerini kontrol edebiliriz.
```jsx
// veri turunu ogrenmek "typeof",
let price = 111;
let stringPrice = "111";
let hasPassword = true;
console.log(
"price :",typeof(price)
)
console.log(
"stringPrice :",typeof(stringPrice)
)
console.log(
"hasPassword :",typeof(hasPassword)
)
```
- typeof() u Console da da kullanabiliriz.
![Untitled](images/Untitled%201.png)
- === ifadesiyle typeof() içinde verilen veriyle türlerinin aynı olup olmadığını kontrol edebiliriz.
![Untitled](images/Untitled%202.png)
- Bir başka şekilde isInteger(), isFinite() veya isNaN() kullanarak da kontrol sağlayabiliriz.
```jsx
//isInteger( ) yöntemi, sayıların tam sayı olup olmadığını belirler.
Number.isInteger(123) //true
Number.isInteger(-123) //true
Number.isInteger(0.5) //false
//isFinite () yöntemi, bir değerin sonlu bir sayı olup olmadığını belirler.
Number.isFinite(0) //true
Number.isFinite('123') //false
Number.isFinite('Hello') //false
Number.isFinite(-Infinity) //false
Number.isFinite(0 / 0) //false
// Number.isNaN () yöntemi, bir değerin NaN (Not-A-Number) olup olmadığını belirler.
Number.isNaN(123) //false
Number.isNaN(0) //false
Number.isNaN('123') //false
Number.isNaN('Hello') //false
Number.isNaN('') //false
Number.isNaN(true) //false
Number.isNaN(undefined) //false
Number.isNaN('NaN') //false
Number.isNaN(NaN) //true
```
### **Değişken Türünü Değiştirmek**
- String ifadeleri int ve float a dönüştürmek :
```jsx
// string(metinsel) bilgileri int ve float a donusturmek
let number1 = "11";
number1 = parseInt(number1)
console.log(
"number1 :",parseInt(number1),typeof(number1)
)
let number2 = "11px";
number2 = parseInt(number2)
console.log(
"number2 :",parseInt(number2),typeof(number2)
)
```
—> ekran çıktımız
![Untitled](images/Untitled%203.png)
- Burada çevrim yapamaz. Başında string bir ifade bulunmasından dolayı.
```jsx
let number3 = "px11px";
number3 = parseInt(number3)
console.log(
"number3 :",parseInt(number3),typeof(number3)
)
```
—> ekran çıktımız
![Untitled](images/Untitled%204.png)
```jsx
let number4 = "11px";
number4 = Number(number4)
console.log(
"number4 :",number4,typeof(number4)
) // number4 : NaN number
// Number; sadece sayı varsa çevrim yapabilir. Başka herhangi bir karakter varsa çevrim yapamaz.
let number5 = "11";
number5 = Number(number5)
console.log(
"number5 :",number5,typeof(number5)
) // number5 : 11 number
let number6 = "11.4px";
number6 = parseFloat(number6)
console.log(
"number6 :",number6,typeof(number6)
) // number6 : 11.4 number
```
- Number’dan stringe dönüşüm
```jsx
// number veri tipinden string e donusturmek
let number7 = 55;
number7.toString()
console.log(typeof(number7)); // number
number7 = number1.toString(); // number --> string
console.log(typeof(number7)); // string
```
## **Template Literals Kullanımı**
- Template literals, birden fazla satır yazabilme imkanı tanıyan ve kod okunabilirliğimizi artıran bir yapıdır.
```jsx
let username= "zehracakir";
const DOMAIN = "github.com"
// stringleri birleştirme
let email = username +"@"+DOMAIN
console.log("Merhaba",username,"sitemize hoşgeldin","mail adresin:",email);
// let info = `Merhaba username` // istedigimiz gibi değil çıktısı -> Merhaba username
// console.log(info)
// template literals ile
let info = `Merhaba ${username} sitemize hoşgeldin.
Mail adresin: ${email}
kisa isminiz: ${username[0]}.
mail adresinin uzunluğu: ${email.length}
borcunuz: ${(2+3)*10} TL
gunun saat bilgisi: ${new Date().getHours()}`
console.log(info) /* Merhaba zehracakir sitemize hoşgeldin.
Mail adresin: zehracakir@github.com
kisa isminiz: z.
mail adresinin uzunluğu: 21
borcunuz: 50 TL
gunun saat bilgisi: 23*/
```
### Kısaca
- Kod okunabilirliğini kolaylaştırır
- Stringler içerisinde değişken yazma kolaylığını sağlar
- Şablon etiketlerini daha az karmaşık hale getirir
## **String Veri Türü İşlemleri**
JavaScript metinlerin tümü “string” veri tipi içinde tutulur ve string veri türü ile ilgili yapabileceğimiz birden fazla işlem vardır.
1. String veri tipinde bulunan bir ifadenin ne kadar uzun olduğunu bulmak için length özelliğimizi kullanırız.
```jsx
let email = "zehracakir@gmail.com";
let firstName = "Zehra";
let lastName = "Çakır";
// string karakter sayısı --> length
console.log(email.length); // 20
```
1. Metnin içinde aramayı indexOf() ile yaparız. Aramak istediğimiz değerin index numarasını bize verir.
```jsx
console.log(DOMAIN.indexOf(".")); // . nın nerde olduğunu bulduk --> 5.indexteymiş
console.log(DOMAIN.slice(0,DOMAIN.indexOf("."))); // sadece gmail kısmını aldık
```
1. search(), indexOf() ile aynı sonuçlara ulaşırız genel olarak "***Regular Expressions***" işlemleri için çok kullanılan bir metottur.
```jsx
// String içinde istediğimiz bilgiyi aramak ve yerini bulmak --> search
console.log(email.search("@")); // 10
console.log(email[10]); // @
// Eğer olmayan bir şeyi arıyorsak bize -1 döndürür.
console.log(email.search("github.com")); // emailde github.com olmadığından -1 döner.
```
1. Metin içinden almak istediğimiz yerleri slice() ile alırız. Index numaralarını vererek metin içinde bulunan parçayı alabiliriz.
```jsx
// string içerisinden belli bir aralığı almak
console.log(email.slice(0,10)); // zehracakir
// domain bilgisi almak
let DOMAIN = email.slice(email.search("@")+1); // almak istediğimiz yeri alırken +1 diyip almalıyız. Çünkü son elemanı dahil etmiyor.
console.log(DOMAIN); // gmail.com
```
1. replace() ile aranan metni istediğimiz metin ile değiştiririz.
```jsx
// bilgiyi değiştir --> replace
email = email.replace('gmail.com','github.com');
console.log(email);
```
1. concat() ile elimizde bulunan iki string türündeki veriyi birleştiririz.
```jsx
// string birleştirme
let firstName1="Zehra";
let lastName1="Çakır";
console.log(firstName1.concat(" ",lastName1)); // Zehra Çakır
```
1. charAt() ile belirtilen index numarasında yer alan karakteri buluruz.
```jsx
console.log(firstName.charAt(0)); // Z
// Burada ilk karakteri bulduk.
```
1. charCodeAt() ile belirtilen index numarasında yer alan karakterin Unicode değerini buluruz.
```jsx
var name1= "Zehra Çakır";
console.log(name1.charCodeAt(1)); // 101
```
9. split() ile istenilen metin diziye çevirebiliriz. Kullanılan parametre ile metnin nasıl parçalanacağı belirtiriz.
```jsx
var name2= "Zehra,Çakır";
console.log(name2.split(",")); // ['Zehra', 'Çakır']
```
1. String bir ifadenin içerisinde, aradığımız karakterin yerini bulmak için [ ] de kullanabiliriz.
```jsx
console.log(firstName[0]); // Z
```
1. String bir ifadeyi tamamen büyük veya küçük harf yapmak istiyorsak. Büyük harf için toUpperCase(), küçük harf için ise toLowerCase() metotlarını kullanırız.
```jsx
// buyuk harf - kucuk harf donusumleri
firstName=firstName.toUpperCase(); // hepsini büyük harfe çevirdik
console.log(firstName); // ZEHRA
firstName=firstName.toLowerCase(); // hepsini küçük harfe çevirdik
console.log(firstName); // zehra
```
1. İlk harfi büyük diğerlerini küçük yapmak.
```jsx
let fullName = `${firstName[0].toUpperCase()}${firstName}`; // Zzehra --> olmadı
console.log(fullName);
let fullName1 = `${firstName[0].toUpperCase()}${firstName.slice(1)}`; // Zehra
console.log(fullName1);
```
1. Aldığımız veri istediğimiz bilgiyle başladı mı? Veya istediğimiz bilgiyle bitti mi? Bu durumu kontrol etmek için startsWidth() ve endsWidth() metodunu kullanırız.
```jsx
console.log(email.startsWith("zehra")); // true
console.log(email.endsWith("@")); // false
```
## **Document Object Model (DOM) Nedir?**
**Document Object Model**, programların ve komut dosyalarının bir belgenin içeriğine, yapısına ve stiline dinamik olarak erişmesine ve güncellemesine izin veren bir platform ve dilden bağımsız bir arayüzdür.
Bir HTML belgesini iç içe geçmiş kutular olarak hayal edebilirsiniz. <body> ve </body> gibi çevreleyen etiketler, sırayla başka etiketler veya metinler içeren diğer etiketleri kapsar.
Tarayıcının belgeyi temsil etmek için kullandığı veri yapısı bu şekli izler. Her kutu için, hangi HTML etiketini temsil ettiği ve hangi kutuları ve metni içerdiği gibi şeyleri bulmak için etkileşime girebileceğimiz bir nesne vardır. Bu temsil, **Document Object Model** veya kısaca **DOM** olarak adlandırılır.
DOM’da HTML ile hazırladığınız sayfa, ”document”; bu document'in içine yerleştirdiğiniz her türlü öğe ise ”element” olarak adlandırılır. DOM'da nesnelerin birer element olarak kullanılabilmesi için hiyerarşik bir düzen izlenerek çağrılmaları gerekir. HTML’deki her bir elamanın birbiri ile hiyerarşik bir yapı oluşturması ile oluşur. DOM bir ağaç dizini gibi bütün dokümanları birbirine bağlar.
![Untitled](images/Untitled%205.png)
- DOM ile yapabileceğimiz işlemlere birkaç örnek kod
```jsx
console.log(document.URL); // http://127.0.0.1:5500/index.html
console.log(document.location); // host, hostname vs şeylere ulaşırız.
console.log(document.location.hostname); // 127.0.0.1
console.log(document.location.pathname); // /index.html
console.log(document.body); // dokumanin body kısmına ulaşırız
console.log(document.head); // dokumanin head kısmına ulaşırız
console.log(document.baseURI); // http://127.0.0.1:5500/index.html
```
- Ayrıca !
```jsx
document.body.style.backgroundColor = "aqua"; // document üzerinden body nin arka plan rengini aqua olarak değiştirdik
```
! Arkaplan rengi değiştirme vs gibi işlemleri CSS ile de yapabiliriz fakat Javascript bize dinamiklik sağlar.
- **Dosya oluşturmak, elementleri ve içeriklerini silme/ekleme gibi fonsiyonları vardır.**
```jsx
<html><head><titte>Form</titte><script type="text/javascript">document.formAdi.isim.value = 'Baran Balin';
document.getElementbyId('yas').value = '25';
</script></head><body><form name="formAdi" method="post" action=""><input type="text" name="isim"><input type="text" id="yas"></form></body>
</html>
```
HTML içerisine yerleştirilmiş öğeleri çağırmak için, içinde bulunduğu diğer öğelerin çağrılması bir yöntem iken, bir öğeye bir id vererek bu id üzerinden çağırmak da bir başka yöntemdir.
Javascript kodumuzun ilk satırında metin kutusunun değeri hiyerarşik olarak çağırılmış ve değiştirilmiştir**.** İkinci satırda ise hiyerarşik yapı daha az önemsenerek Javascript içindeki DOM’un temellerinden olan ”getELementbyId” metodu kullanılmıştır.
### **DOM içerisinden Etiket ve ID ile Öğe Seçimi**
Document Object Model'de öğeler birden fazla yöntem ile seçilebilir.
1. getElementById ile
```jsx
<ul id="list">
<li>
<a href="#">Link Bilgisi</a>
</li>
</ul>
```
Yukarıda verilen Link Bilgisini getElementById ile seçelim:
```jsx
//innerHTML ile içerisinde yazan bilgiye ulaşırız.
//getElementBYId ile öge secimi
let title=document.getElementById('title')
//console.log(title.innerHTML="Deneme") //hem eşitleme hem de yazdırma işlemi yapar, çok iyi bir kullanım değil
title.innerHTML="Degisen bilgi" //içerisindeki bilgiyi değiştirdik
console.log(title.innerHTML) //değişen bilgiyi ekrana yazdırdık
```
1. getElementsBytTagName ile
Elemanları etiket isimlerine göre seçmek için getElementsByTagName() metodu kullanılır. Birden çok elemente ulaşmak amacı ile kullanılır. Girdi olarak bir html elementi alır ve buna uygun bir HTMLCollection döndürür.
```jsx
<h2 id="title">Merhaba Dünya</h2>
```
Yukarıda verilen Merhaba Dünya bilgisini getElementsByTagName ile seçelim:
```jsx
let h2=document.getElementsByTagName('h2') //çok efektif bir çözüm olmadı
```
getElementsByTagName ile sayfadaki tüm etiketleri de getirebiliriz:
```jsx
document.getElementsByTagName('*')
// Çıktı: HTMLCollection(33) [html, head, meta, link#.....
```
1. getElementsByName ile
Elemanları isimlerine göre getirmek için getElementsByName() metodu kullanılır. Elemanların name değerlerine göre bir Nodelist objesi döndürür.
```jsx
<input type="text" name="e-posta">
<input type="tel" name="telefon">
<input type="date" name="tarih">
```
Yukarıda verilen e-posta bilgisini getElementsByName ile seçelim:
```jsx
const emails = document.getElementsByName('e-posta');
// Çıktı: NodeList [input]
```
1. querySelector ile
querySelector() yöntemi, CSS seçicilere dayalı olarak DOM'dan html elemanlarını seçmenize izin veren iki modern JavaScript yönteminden biridir. Bu yöntem ile hem css class'larını hem de id'lerini kullanabilirsiniz. Bunu yaparken class için ön ek olarak nokta **"."**, id'ler için kare **"#"** kullanmanız gerekir. Sayfada eşleşen ilk elemanı size döndürecektir. Belirtilen elemanın eşleşememesi durumunda geriye null dönecektir.
```jsx
<ul id="list">
<li>
<a href="#">Link Bilgisi</a>
</li>
</ul>
```
Yukarıda verilen Link Bilgisini querySelector ile seçelim:
```jsx
//querySelector ile öge secimi
let link=document.querySelector("ul#list>li>a") //querySelector bir tane eleman seçebilir.querySelectorAll hepsini seçer.
// console.log(link.innerHTML)
// link.innerHTML="Yeni link bilgisi"
link.innerHTML+=" eklenen bilgi" //var olan link içerisindeki bilgiye ekleme yapar
link.style.color="red" //renk bilgisi eklemek
link.classList.add('btn') //class eklemek
```
1. querySelectorAll ile
querySelectorAll() metodu, querySelector() metodu ile aynı mantık ile çalışır tek farkı eşleşen ilk elamanı döndürmek yerine eşleşen tüm elemanları bir NodeList objesi olarak döndürmesidir.
```jsx
const elems = document.querySelectorAll('.bird, .animal');
console.log(elems.length); // 4
```
Öğrendiğimiz bu 5 metodu birlikte kullanabiliriz.Önce tek bir elemanı seçerek ardından içinde ikinci bir sorguyu yapabiliyoruz.
### **Prompt ile Kullanıcıdan Nasıl Bilgi Alınır?**
Prompt() kullanıcıya soru sorup klavyeden girilen bilgiyle işlem yapan, o bilgiyi döndüren bir window metodudur. alert() gibi Html üzerinde, HTML sayfasından bağımsız çalışır ve karşımıza diyalog penceresi şeklinde çıkar.
```jsx
let fullName=prompt("lütfen adınızı giriniz: ")
console.log(fullName) //kullanıcıdan adını aldık ve bunu console da görüntüledik
```
Kullanıcının da görmesini istersek
```jsx
<h1 id="greeting">Front-End</h1>
//id ekledik
```
```jsx
let fullName=prompt("lütfen adınızı giriniz: ")
let greeting=document.querySelector("#greeting") //kullanıcı da bunu görsün istiyorsak
greeting.innerHTML=`${greeting.innerHTML} <small style="color:red">${fullName}</small>
```
- Ekran Görüntüsü:
![Untitled](images/Untitled%206.png)
![Untitled](images/Untitled%207.png)
- Prompt mantığı: Kullanıcı **Tamam** düğmesini tıkladığında, giriş alanına girilen metin döndürülür. Kullanıcı herhangi bir metin girmeden Tamam'ı tıklarsa, boş bir dize döndürülür. Kullanıcı **İptal**
düğmesini tıklarsa, bu işlev boş döndürür.
### **Liste İçerisindeki Öğeye Erişmek ve Yeni Öğe Eklemek**
JavaScript’de çoğu zaman HTML elementlerine JavaScript ile müdahale ederiz. Bazen doğrudan bir elemente ulaşmaya çalışıyorken bazen spesifik bir liste öğesine ulaşmamız gerekebilir.
Listemiz:
```jsx
<ul class="sinif" id="list">
<li>Zehra</li>
<li>Bilgisayar</li>
<li>Kod</li>
</ul>
```
- **Öğelere Erişim Yöntemleri**
- Kimlik (id) ile öğeye ulaşmak
- Sınıf (class) ile öğelere/öğeye ulaşmak.
- Etiket adı ile öğelere ulaşmak.
- getElementById ile
```jsx
let item = document.getElementById("list");
```
Yukarıda önce bir değişken tanımlayıp sonrasında ise list id değerine sahip elementi seçtik.Sayfamızda eğer ki bu id’ye sahip bir element var ise bize o elementi döndürür.
- getElementsByClassName ile
```jsx
let item2 = document.getElementsByClassName("sinif");
```
Burada ise item isminde bir değişken tanımlayıp sinif sınıfına sahip olan tüm öğeleri alıyoruz. Burada önemli nokta ise getElementsByClassName i bize class’a sahip tüm öğeleri nodeList olarak döndürür.
- Seçtiğimiz sınıfa müdahale edelim.
item2 olarak tanımladığımız değişkenimizin içerisinde döngü yardımı ile dönelim ve sinif
sınıfına sahip olarak öğelerin renklerini değiştirelim. Döngü kullanmamızın bir sebebi de getElementsByClassName metodunun bize nodeList dönüyor olması.
```jsx
for (var i = 0; i < item2.length; i++) {
item2[i].style.color = "red";
}
```
- querySelector ile
```jsx
let item =document.querySelector("ul#list>li:last-child") //en sondaki li yi döndürür
console.log(item)
let item1 =document.querySelector("ul#list>li:first-child") //en bastaki li yi döndürür
console.log(item1)i
let item2 =document.querySelector("ul#list>li:first-child").innerText //en baştaki li nin icerisinde yazan text i döndürür
console.log(item2)
let item3 =document.querySelector("ul#list>li:first-child").innerText="değistii"//en bastaki li nin icerisinde yazan text i değistirir döndürür
console.log(item3)
let item4 =document.querySelector("ul#list>li:first-child")//en bastaki li nin icerisinde yazan text degistirir ve döndürür
item4.innerHTML="ilk öge değisti"
let item5 =document.querySelector("ul#list>li:last-child")//en sondaki li nin icerisinde yazan text degistirir ve döndürür
item5.innerHTML="Son öge değisti"
```
Yeni bir eleman eklemek için:
```jsx
let ulDOM=document.querySelector("ul#list")
let liDOM=document.createElement('li') // createELement ile eleman ekliyoruz
liDOM.innerHTML="Kendi olusturdugum li"
ulDOM.append(liDOM) //append ile oluşturduğumuz elemanı en sona ekleriz
ulDOM.prepend(liDOM) //prepend ile oluşturduğumuz elemanı en başa ekler
```
### **DOM'a CSS Class Bilgisi Eklemek veya Çıkarmak**
- **ClassList**
```jsx
let greeting =document.querySelector("#greeting")
console.log(greeting.classList) //şu anda icerisi bos
//add() : HTML öğesine bir veya daha fazla class ekler.
greeting.classList.add("text-primary") //html dosyasında style ile renk ekledik
greeting.classList.add("title")
greeting.classList.add("new-info","second-class") //bu şekilde birden fazla class ekleyebiliriz
//remove() : HTML öğesinden bir veya daha fazla class'ı siler.
greeting.classList.remove("title","second-class") //birden fazla class silebiliriz bu şekilde
//olmayan bir class adı yazarsak hata döndürmez
//item() : HTML de class'ı verilen index sırasına göre döndürür. Eğer index, class length'inden (sayısından) daha büyük veya length'ine eşit olursa undefined döner.
let div = document.querySelector('#greeting');
div.classList.item(0);
//contains() : Element verilen class'ı içeriyorsa true, içermiyorsa false döner. Bu sayede bir işlem yaptırmadan önce kontrol edebiliriz.
let div0 = document.querySelector('#greeting');
div.classList.contains('zehra')
//Toggle() : classList.add() ve classList.remove() yöntemini aynı anda çağırmak yerine classList.toggle() yöntemini kullanılabilir.
let div1 = document.querySelector('#greeting');
div.classList.toggle('visible');
//replace() : Bir CSS sınıfını başka bir sınıfla değiştirmek için kullanılır.
let div2 = document.querySelector('#greeting');
div.classList.replace('text-primary','block');
//length() : Bir öğede bulunan sınıf sayısını bilmemizi sağlar.
console.log(greeting.classList)
```
## Karar Yapıları / Koşullar
### **Karşılaştırma Operatörleri**
Karşılaştırma operatörleri, değişkenler veya değerler arasındaki eşitlik ve farkı bulmak için kullanılır. Bu iki değerin karşılaştırmasını yaparak true (doğru) veya false (yanlış) sonucu verir.
- ****`==` Eşitse**
```jsx
let price="100" //string turunde
console.log(price==1) // false
console.log(price==100) //true
```
- ****`===` Hem değeri hem de türü eşitse**
```jsx
let price="100"
console.log("=== : ",price===1) //false : turu de degeri de esit degil
console.log("=== : ",price===100) // false : degeri esit fakat turu esit degil
```
- ****`!=` Eşit değilse**
```jsx
let price="100"
console.log(price!=1) //true : price ın degeri 1 e esit degildir.
```
- ****`<` Küçükse**
```jsx
let price="100"
console.log("price<100",price<100) //false
```
- ****`<=` Küçük veya eşitse**
```jsx
let price="100"
console.log("price<=100",price<=100) //true
```
- ****`>` Büyükse ve `>=` Büyük veya eşitse**
```jsx
let price="100"
// > Buyukse
console.log("price>100",price>100) //false
// <= Buyuk veya esitse
console.log("price=>100",price>=100) //true
```
### **Mantıksal Operatörler**
JavaScript mantıksal operatörleri kullanarak karşılaştırma işlemini birden fazla koşula göre yapabiliriz. Birden fazla koşulu karşılaştırıp operatörün işlevine göre true (doğru) veya false (yanlış) sonucunu verir.
- ****`&&` ve**
```jsx
let price="100"
let user="zehra"
console.log( price==100 && user == "zehra") //true : tum sartlar dogruysa true
```
- ****`||` veya**
```jsx
let price="100"
let user="zehra"
console.log( price==100 || user == "cakir")//true : herhangi bir sart dogruysa true
```
- ****`!` değil**
```jsx
let price="100"
let user="zehra"
console.log( !(price==100 && user == "zehra")) //false
```
### **Koşul Yapısı Kullanımı (if / else)**
If else yapısı içerisinde koşulun sağlandığı kodlar **if** içerisinde yer alırken, koşulun sağlanmadığı kodlar ise **else** içerisinde yer alır.
Eğer ilk koşul yanlışsa başka bir koşul belirtmek amacıyla **else if** kullanılır. If/Else kullanımı aşağıdaki gibidir:
```jsx
// eger kullanici bilgisi varsa ekrana ismini yazdır
/* eger(username.length>0)
{
console.log(username)
}degilse{
console.log("bilgi yok")
}
*/
let username=prompt("Kullanıcı adınızı giriniz : ")
if(username.length>0){ //if kismi her zaman true ise calisir.
console.log(`Kullanıcı adınız : ${username}`)
}
else{
console.log("bilgi yok")
}
```
- Hackerrank → ****Day 3: Intro to Conditional Statements****
```jsx
/*
Bir tamsayı verildiğinde, n, aşağıdaki koşullu eylemleri gerçekleştirin:
n tek ise, Weird yazdır
n çift ise ve to dahil aralığındaysa, Not Weird yazdırın
n çift ise ve to dahil aralığındaysa, Weird yazdırın
n çift ve değerinden büyükse, Not Weird yazdırın
n'nin tuhaf olup olmadığını yazdırmak için düzenleyicinizde verilen saplama kodunu tamamlayın
*/
function main() {
const N = parseInt(readLine().trim(), 10);
if(N%2==1){
console.log("Weird")
}
if((N%2==0) && ((N>2)&&(N<=5))){
console.log("Not Weird")
}
if((N%2==0) && ((N>6)&&(N<=20))){
console.log("Weird")
}
if((N%2==0) && (N>20)){
console.log("Not Weird")
}
}
```
### **Çoklu Koşul Yapısı Kullanımı**
JavaScript'te if-else koşul yapısındaki koşulların arttığı durumlarda kod okunabilirliğini artırmak ve daha performanslı sayılabilecek bir yapı olan **switch** yapısı tercih edilebilir.
Switch yapısı belirli bir değere göre hangi kodun çalıştırılacağını yönetmek için kullanılır. Bir switch yapısı tanımlarken switch keywordunu kullanırız ve ardından parantez içerisinde bir değer ya da değişken tanımlarız. Sonrasında switch ile birlikte açılan blok içerisinde yerine getirilmesi gereken koşulları **case** ifadeleriyle birlikte tanımlayabiliriz, tanımlanmış her bir case etiketinden sonra `:` koymalıyız.
Case tanımlamalarından sonra çalışmasını istediğimiz deyimleri belirtebiliriz. Program akışında switch ifadesine verilmiş değeri sağlayan case etiketine geçerek ilgili deyimleri çalıştıracaktır, bu kontrol switch ifadesine verilmiş değerlerin tanımlanmış case etiketleri ile değer ve tip kontrolünün (===) otomatik tip dönüşümü olmadan yapılmasıdır.
- Switch
```jsx
switch(ifade) {
case a:
// kod bloğu
break;
case b:
// kod bloğu
break;
default:
// kod bloğu
}
```
### **Ternary Operatör ( Koşul ? Doğruysa : Yanlışsa) ile If Kullanımı**
**Ternary Operator** 3 adet parametre alan tek JavaScript operatörüdür. If kullanarak kontrol etmek istediğimiz koşullarda ternary operator kullanarak satır sayısı olarak avantaj sağlayabiliriz.
**Ternary operatörünün aldığı 3 parametre şu şekildedir:**
- İlk önce bir condition belirtiriz ve sonrasında hemen bir *`?`* koyarız
- Sonrasında, eğer yazdığımız condition doğru ise ne yapmak istediğimizi belirtir ve sonuna *`:`* koyarız
- Ve sıra geldi koşulumuz yanlış ise ne yapmak istediğimize.
```jsx
let userName=prompt("Kullanıcı Bilginizi yazınız")
let info =document.querySelector("#info")
/* ternary kullanımı :
kosul ? dogruysa : yanlissa
*/
info.innerHTML=`${userName.length>0?userName:"kullanıcı bilginiz bulunamadı"}`
```
### **Koşullarla Çalışmak-**Bölüm sonu Egzersizi
1. Prompt ile aldığın bilgiye göre aşağıdaki yapııyı kullanarak notun bilgisini #info ya yazdır
AA→90-100
BA→85-89
BB→80-84
CB→75-79
CC→70-74
DC→65-69
DD→60-64
FD→50-59
FF→0-49
1. Kullanıcının girdiği verinin istediğimiz aralıkta olup olmadığını kontrol et
2. FF bilgisinde üzgün surat ikonu, diğerlerinde gülücük ikonu olsun
3. FF class bilgisi text-danger, diğerlerinin ise text-primary olsun
```jsx
const gulucuk=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-smile" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M4.285 9.567a.5.5 0 0 1 .683.183A3.498 3.498 0 0 0 8 11.5a3.498 3.498 0 0 0 3.032-1.75.5.5 0 1 1 .866.5A4.498 4.498 0 0 1 8 12.5a4.498 4.498 0 0 1-3.898-2.25.5.5 0 0 1 .183-.683zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zm4 0c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5z"/>
</svg>`
const uzgun=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-frown" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M4.285 12.433a.5.5 0 0 0 .683-.183A3.498 3.498 0 0 1 8 10.5c1.295 0 2.426.703 3.032 1.75a.5.5 0 0 0 .866-.5A4.498 4.498 0 0 0 8 9.5a4.5 4.5 0 0 0-3.898 2.25.5.5 0 0 0 .183.683zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zm4 0c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5z"/>
</svg>`
let not=prompt("Puanınızı giriniz: ")
let harfNotu;
let info=document.querySelector("#info")
if(not>=0 && not<=100){ //kapsayici blok
harfNotu = gulucuk;
info.classList.add('text-primary')
if(not>=90){
harfNotu+=" AA";
}
else if(not>=85){
harfNotu+=" BA";
}
else if(not>=80){
harfNotu+=" BB";
}
else if(not>=75){
harfNotu+=" CB";
}
else if(not>=70){
harfNot+=" CC";
}
else if(not>=65){
harfNotu+=" DC";
}
else if(not>=60){
harfNotu=" DD";
}
else if(not>=50){
harfNotu+=" FD";
}
else if(not<50){
harfNotu=uzgun;
harfNotu+=" FF";
info.classList.remove('text-primary')
info.classList.add('text-danger')
}
}
else{
harfNotu="Bilgiler doğru değil"
}
info.innerHTML=`${harfNotu} --> ${not}`
```
### Ödev-1
Girişte isminizi isteyip sonra bu ismi karşılama ekranına yerleştirerek o anki saati ve günü gösteren bir ekranın kodlarını yazınız.
```jsx
const gulucuk=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-emoji-smile" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
<path d="M4.285 9.567a.5.5 0 0 1 .683.183A3.498 3.498 0 0 0 8 11.5a3.498 3.498 0 0 0 3.032-1.75.5.5 0 1 1 .866.5A4.498 4.498 0 0 1 8 12.5a4.498 4.498 0 0 1-3.898-2.25.5.5 0 0 1 .183-.683zM7 6.5C7 7.328 6.552 8 6 8s-1-.672-1-1.5S5.448 5 6 5s1 .672 1 1.5zm4 0c0 .828-.448 1.5-1 1.5s-1-.672-1-1.5S9.448 5 10 5s1 .672 1 1.5z"/>
</svg>`
let kullanici=prompt("Lütfen ad-soyad bilgilerinizi giriniz : ")
let kullaniciAdi=document.querySelector("#myName")
kullanici+=" "+gulucuk
kullaniciAdi.innerHTML=`${kullanici}`
function currentTime() {
let date = new Date();
let hh = date.getHours();
let mm = date.getMinutes();
let ss = date.getSeconds();
let session = "AM";
var gunler= ["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"];
if(hh > 12){
session = "PM";
}
hh = (hh < 10) ? "0" + hh : hh;
mm = (mm < 10) ? "0" + mm : mm;
ss = (ss < 10) ? "0" + ss : ss;
let time = hh + ":" + mm + ":" + ss + " " + session+" "+gunler[date.getDay()];
document.getElementById("myClock").innerText = time;
var t = setTimeout(function(){ currentTime() }, 1000);
}
currentTime();
```
- Ekran çıktısı :
![Untitled](images/Untitled%208.png)
### **Fonksiyon Nedir? Neden Kullanırız?**
Fonksiyonlar adından anlaşılacağı gibi belli bir amacı gerçekleştirmek için oluşturulmuş yapılardır. Koda işlevsellik katmak için bunu sık sık kullanırız. Nasıl tanımlandığına gelecek olursak:
- Fonksiyonu Adlandırmak
- İlk olarak `function` ibaresinden sonra fonksiyon adı yazılır. Bir fonksiyonu adı varsa bunlara Normal-Adlandırılmış Fonksiyonlar (**Regular/Named Functions**) deriz.
- Burada önemli olan kodun okunabilirliği açısından fonksiyonu işlevine uygun bir biçimde adlandırmaktır, dahası bu bir işlevi belirttiği için fonksiyon adımız bir eylem olmalıdır. Bunun için bazı ön ekler kullanabiliriz.
- Örneğin değer almak istediğimiz bir fonksiyon adında ön ek olarak `get` kullanabiliriz.
- Bununla birlikte şunu da unutmamalıyız istendiğinde adı olmayan anonim bir fonksiyon da kullanılabilir. Aşağıda bu fonksiyon türünden bahsediliyor :wink:
- ****Fonksiyon Parametreleri ve Gövdesi****
- Sonrasında parantezler içinde alacağı parametreler belirlenir. Parametre olması zorunlu olmadığı gibi fazla parametre geçmek kodun okunurluğunu bozabilir.
- Parametre alan fonksiyonları kullandığımız zaman o parametrelere kendimiz bir değer atarız. Atanan bu değere argüman adı verilir.
```jsx
function hello(isim){ //isim adında bir parametre aldı.
console.log("Merhaba "+ isim);
}
hello("Zehra"); //// bir argüman vererek fonksiyonu çağırdık. Çıktı: Merhaba Zehra
```
- Son olarak da süslü parantezleri açarak içine çalışmasını istediğimiz JavaScript kodunu eklenir. Bu JavaScript koduna fonksiyonun gövdesi- body denir.
- Anonim fonksiyonların (**Anonymous Functions**) bir adı yoktur ve bir değişkene atanarak yeri geldiğinde kullanılırlar.
- Değişken adı kullanılarak çağrıldıkları için birden çok anonim fonksiyonu aynı dizide kullanabilirsiniz.
- Dahası bir değişkene atandıklarından bu değişkeni başka bir fonksiyonun parametresine koyarak callback (geri arama) yapabilirsiniz.
```jsx
var add = function (sayi1,sayi2){ //Anonim bir fonksiyon oluşturduktan sonra bu
//fonsksiyonu bir değişkene atadık
console.log(sayi1+sayi2);
}
```
- **Değer Döndüren Fonksiyonlar**
- Bazen fonksiyonun geriye göndereceği değeri ekrana çıktı vermek yerine bir değişken ya da başka bir fonksiyonda daha sonra kullanmamız gerekebilir. Bu gibi durumlarda fonksiyon gövdesinde **return** ifadesini kullanırız.
- **Callback Fonksiyonlar ve Asenkron Çalışma**
- Senkron dediğimiz kavram şunu ifade etmektedir: kodumuz yukarıdan aşağı doğru sırayla işlenir ve bir satırdaki işlem bitmeden bir sonraki satıra geçilmez. Asenkron yapıda ise fonksiyonların birbirlerini beklemelerine gerek yoktur. Uzun zaman alan veya farklı görevleri olan fonksiyonlar aynı anda çalışabilir. JavaScript asenkron yapıdaki bir programlama dilidir. Bunu anlamak için içinde setTimeout(parameter1, parameter2) fonksiyonunu kullanacağız. Bu fonksiyon gördüğünüz gibi iki parametre ile kullanılacak: ilk parametre çalışması istenen fonksiyonu, ikinci parametre ise ne kadar süre sonra çalışması istendiğini ifade ediyor. Örneğin 1000 yazılarak 1000 milisaniye yani 1 saniye gecikme sağlanıyor.
```jsx
function printScreen1 (){
console.log(“İlk ekran çıktısı”);
}
function printScreen2 (){
setTimeout(function(){
console.log(“İkinci ekran çıktısı”)
}, 3000);
}
function printScreen3 (){
console.log(“Üçüncü ekran çıktısı”);
}
printScreen1();
printScreen2();
printScreen3();
/*
Ekran Çıktısı :
İlk ekran çıktısı
Üçüncü ekran çıktısı
İkinci ekran çıktısı
*/
```
- **Fonksiyon İfadeleri (Function Expressions)**
- JavaScript bir değişkene fonksiyon atanmasına ve daha sonra bu değişkenin fonksiyon olarak kullanılmasına izin verir. Buna fonksiyon ifadeleri denir.
- ****Arrow Functions****
- Fonksiyon yaratmanın bir diğer yolu ise ES6 ile birlikte hayatımıza giren, daha okunabilir daha basit bir syntax yapısına sahip olan arrow functions yapısıdır.
```jsx
let func = (param1, param2, param3) => expression;
```
- ****Recursion****
- Bir fonksiyonu çağırdığımız zaman o fonksiyon bir çok fonksiyonu daha çalıştırabilir. Kısaca bir fonksiyon kendisini tekrar çağırıyor ise biz buna recursion diyoruz.
```jsx
// bir fonksiyon yazalım bu fonksiyon sayının kuvvetini alsın.
// pow(2,2) = 4
// pow(2,3) = 8
// pow(2,4) = 16 değerlerini verecek şekilde diyelim.
// 1.ci yol (recursion patterni ile düşünmeden)
function pow(x, n) {
let result = 1;
for (let i = 0; i < n; i++) {
result *= x;
}
return result;
}
alert(pow(2, 3)); // 8
// recursion ile
function pow(x, n) {
if (n == 1) {
return x;
} else {
return x * pow(x, n - 1);
}
}
alert(pow(2, 3)); // 8
```
**Fonsiyona Parametre (params) ve Geridönüş (return) Eklemek**
Fonksiyonlar, JavaScript'te oldukça önemli bir konudur. Genel işlevi itibariyle diğer programlama dillerindeki fonksiyonlara oldukça benzerler. Fakat, diğer programlama dillerinden farklı olarak JavaScript'te fonksiyonlar, birer nesne olarak değerlendirilir ve çok farklı şekillerde kullanılırlar.
Fonksiyonlar, parametreli veya parametresiz fonksiyonlar, değer döndüren veya değer döndürmeyen fonksiyonlar olarak farklı şekillerde oluşturulabilir. Hangi fonksiyon tipini kullanacağımız, yazmak istediğimiz algoritmanın ihtiyacına göre değişmektedir.
```jsx
// Temel Kurallar
// 1: Bir fonksiyon bir veya birden fazla parametre alabilir veya hiç almayabilir
// 2: Bir fonksisyon dışarı bilgi gönderebilir (return) veya göndermeyebilir
// 3: Mümkünse fonksiyonun bağımlılıklarını azaltmak gerekir
let firstName= "Zehra" //Bizi disariya bagimli kılıyor. Disariya bagimliligi azaltmak icin firstName i fonksiyona parametre olarak gonderebiliriz.
function greeting(){
console.log(`Merhaba ${firstName}`);
}
greeting(); //parametre gonderilmeyen fonksiyon
function greeting(firstName1){ //default parametre alıyor
console.log(`Merhaba ${firstName1}`);
}
greeting("Çakır"); //parametre gonderilen fonksiyon
function greeting2(firstName,lastName){
let info=`Merhaba ${firstName} ${lastName}`
return info
}
greeting2("Zehra","Ç") //bu bilgiyi yakalamamız lazım, disariya vermis
let info=greeting2("Zehra","Ç")
console.log(info)
function domIdWriteInfo(id,info){ //id ile bilgi gonderme
let domObject=document.querySelector(`#${id}`)
domObject.innerHTML=info;
}
domIdWriteInfo("greeting",greeting2("Zehra","Ç"))
let htmlInfo=`<span style="color:red">Color Red</span>`
domIdWriteInfo("greeting",htmlInfo)
```
- **Örnek 1** : Herhangi iki sayıyı toplayıp, bir değişkene atayan fonksiyon ifadesini yazalım.
```jsx
function toplama (a , b) // a ve b toplanacak iki sayıyı temsil eden fonksiyon parametreleri(girdileri)
{
var sonuc = a+b; // Fonksiyonda aldığımız parametrelerle yaptığımız işlem
return sonuc; // Herhangi iki sayının toplamından elde edeceğimiz işlem sonucunu, return ifadesinden hemen sonra belirtiyoruz.
}
```
- Fonksiyonlarda return komutunun 2 önemli işlevi vardır.
1. Fonksiyonun geri dönüş değerini oluşturur.
2. Fonksiyonu sonlandırır.
Return komutundan sonra işlem, değişken veya sabit yazılabilir.
### **Fat Arrow () => Fonksiyonu Kullanımı**
Fat Arrow()⇒ daha az kod satırı ile fonksiyonu yazmamıza olanak sağlıyor.
```jsx
function hello(name){
console.log(name)
}
hello("Javascript");
// bu fonksiyonu arrow function olarak aşağıda yazalım
const helloFuncV1=(name)=>{
console.log(name)
}
helloFuncV1("Merhaba")
const helloFuncV2=(name,surname)=>{
console.log(name,surname)
}
helloFuncV2("zehra","çakır")
const helloFuncV3=(name,surname)=>{
let info=name+surname
console.log(info)
}
helloFuncV3("zehra1","çakır1")
```
- **Arrow fonksiyon kullanırken dikkat etmemiz gereken bazı durumlar vardır.**
- **"return"** keyword;
- Statement'lar süslü{ } parantez kullanılarak yazılırlar. Eğer fonksiyon içerisinde bu parantezlerden varsa return keyword'ü kullanmamız gerekir.
```jsx
var kediAcMi = (kedi) => {
if (kedi === 'ac') {
return 'Kedi aç';
} else {
return 'Kedi aç değil';
}
}
```
- **"this"** keyword;
- this'in arrow fonksiyonlardaki davranışı, regular fonksiyonlardaki davranışından farklıdır. Nasıl ve nerede oluşturulursa oluşturulsun this'in arrow fonksiyonu içerisindeki değeri her zaman parent fonksiyonuna eşittir. Diğer bir deyişle arrow fonksiyonu kendi execution context'ini oluşturmaz. Yani kendisini referans göstermez, her zaman parent'ına bakar.
### **DOM Etkinlikleriyle Çalışmak**
### Etkinlik Ekleme ve Özelliklerine Ulaşma
Etkinlikler yani "events"ler uygulanacak eylemlerin ne zaman gerçekleşeceğinin öğrenilmesine ve sonrasında kodun çalıştırılmasına olanak sağlar. Sayfa üzerindeki eylemlere göre bir çok etkinlik eklemek mümkündür.
- Event Listener ile Çalışmak
Event oluşumu öncelikle nesnenin seçimi ile başlar. Bir butona tıklandığında tıklandı uyarısı ekrana uyarı(alert) olarak ekrana yazdırabiliriz.
1. Metot
```jsx
element.addEventListener(event, function);
// id =button olan nesne seçildi
const buton = document.querySelector("id");
// Nesneye bir etkinlik atandı..
const buton = document.querySelector("#button");
//Burada ilk olarak tip ('click') ,ikinci olarak da fonksiyonun kendisi parametre olarak eklenir
buton.addEventListener('click' , function(){
alert("Buton Tıklandı");
})
// Çıktı : Buton Tıklandı
```
1. Metot
Fonksiyon etkinlik parametresi olarak da çalışabilmektedir. Burada parametre olan "event"i bir değişkene atayıp hedef etkinlik tanımlandıktan sonra butona basıldığında hangi butonun tıklandığı bilgisine ulaşılabilmektedir.
```jsx
element.addEventListener(event, functionName);
//id =button olan nesne seçildi
const button = document.querySelector("#button");
//nesneye bir etkinlik atandı.Burada ilk olarak tip ('click')
//ikinci olarak da aşağıda fonksiyon tanımlanır ,fonksiyon ismi parametre olarak girilir.
button.addEventListener('click',btnClicked);
function btnClicked(){
alert("Buton Tıklandı!!!")
}
// Çıktı : Buton Tıklandı!!!
```
- Mouse Etkinliği
Mouse tıklaması ile gerçekleşen etkinliktir.
```jsx
//id=text olan buton çağrıldı
//dblclick=çift tıklama etkinliği nesneye atandı,fonksiyon ismi parametre olarak tanımlandı
const button = document.querySelector("#text");
button.addEventListener('dblclick',clickFonksiyonu);
//fonksiyonda id=text olan element çağrılarak innerHTML ile içeriği değiştirildi.
function clickFonksiyonu(){
document.getElementById("text").innerHTML = "NEW FORM";
}
```
- Klavye Etkinliği
Klavyeden herhangi bir tuşa tıklanması sonucu gerçekleşen etkinliklerdir.
```jsx
//id=fname olan nesne çağrılarak keyboard değişkenine atandı
const keyboard =document.querySelector('#fname');
//keyboard isimli değişkene "cut" etkinliği atandı ve fonksiyon ismi parametre olarak atandı
keyboard.addEventListener("cut",cuttingFunction);
//cuttingFunction isimli fonksiyon ile form inputuna yazılan girdileri klavye ctrl+c ile kesildiğinde etkinlik çalışmaktadır
function cuttingFunction(event){
console.log("etkinlik tipi: " , event.type)
}
//console ekranı : etkinlik tipi: cut
```
## **LocalStorage ile Veri Eklemek, Düzenlemek ve Silme**
### **Local Storage Nedir?,**
- Web Storage terimi web sayfasında yapılan değişikliklerin kaydının tutulmasına karşılık gelmektedir. Örneğin bir web sayfasında kayıt formu doldurulurken sayfanın kapatıldığını veya başka sayfaya geçtiğimizi varsayalım. Kayıt form sayfasına döndüğümüzde kayıtların kaybolması sinir bozucu bir durum olabilir. Bu durumun önüne geçmek için cookie yani çerez dediğimiz sistemlerle geçici veriler saklanabilmekteydi. Ancak bu çerez dosyalarının hem 4 kb ile sınırlı olması hem de üçüncü şahıslar tarafından kolay erişilebiliyor olması Local Storage teriminin yaygınlaşmasına neden olmuştur. HTML 5 ile birlikte web sayfaları veriyi yerel (local) veya tarayıcı (browser) içinde saklayabilir hale gelmiştir. Bu sayede eskiden cookie’ler ile yaptığımız işlemler daha güvenli ve daha hızlı şekilde yapılabilir hale gelmiştir. Daha hızlı çalışmasının nedeni artık veriler her sunucu istediğinde değil, sadece çağırıldıklarında gelmektedir. Veriler **key/value** şeklinde saklanmaktadır ve web sayfaları sadece kendi oluşturdukları verilere erişebilmektedir. Birçok tarayıcı Web Storage API yapısıyla uyumlu şekilde çalışabilmektedir.
### **Nasıl Kullanılır?**
- HTML 5 ile tarayıcılar iki tane yerel kayıt türünü desteklemektedir.
- localStorage
- sessionStorage
Bu iki kayıt türü arasındaki en temel fark localStorage kayıtları zaman aşımı olmaksızın tutarken sessionStorage kayıtları oturum sonlanana kadar ya da veri kaybolana kadar tutmaktadır. Ancak LocalStorage ve SessionStorage kullanıcı tarafından kolayca okunabilir ve değiştirilebilir, bu sebeple uygulama içerisindeki güvenlik ile ilgili verilerin depolanmaması gerekmektedir. LocalStorage ve SessionStorage sayfalar arasındaki ve client işlemleri arasındaki hassas olmayan verilerin taşınmasında tercih edilmektedir.
1. **Veri Ekleme**
```jsx
window.localStorage.setItem("key","value");
```
Eğer daha önce belirttiğiniz bir anahtarı kullanırsanız kaydetmek için veri eski kaydın üzerine yazılacaktır. Veriniz güncellenmiş olacaktır. Veriyi kontrol edip yoksa kaydetmek isterseniz. verinin oluşturulup oluşturulmadığını kontrol etmeniz yeterli olacaktır. Verileri kaydederken sadece string biçiminde kayıt yapıldığını bilmemiz gerekmektedir. Karmaşık bir veriyi kaydetmek istediğinizde toString() metodu çalıştırılmalı ve üretilen değer kaydedilmelidir. Json verisini kaydetmek içinse JSON.stringify() metodu kullanılmalıdır.
1. **Veri Okuma**
localStorage üzerinde kayıtlı olan anahtarları okumak için getItem metodu kullanılır.
```jsx
window.localStorage.getItem("key");
```
Eğer veri daha önce kaydedilmeyen bir veriyi okumaya çalıştığımızda null değeri geri dönmektedir.
1. **Veri Silme**
Tüm verileri silmek istiyorsak clear() metodunu kullanmamız gerekir. Şayet istediğimiz bir anahtarı silmek istiyorsak removeItem() metodunu kullanmamız gerekmektedir.
```jsx
localStorage.removeItem("key");
localStorage.clear();
```
### **LocalStorage İçine Farklı Türde Veriler Eklemek**
```jsx
let user = {userName: 'zehra', isActive: true}
localStorage.setItem('user', user)
```
Bu kodun localStorage içerisindeki karşılığı [object Object] biçiminde olacak.
Bunun sebebi localStorage içindeki bilgilerin key: value şeklinde, yalnızca string türünde değerler ile saklanmasıdır.
- String e çevirelim
```jsx
let user = {userName: 'zehra', isActive: true}
localStorage.setItem('userInfo', JSON.stringify(user)
```
- **LocalStorage'den Veri Alma**
LocalStorage'da değişkenler string olarak tutulduğundan, localStorage'tan user objesini almak istediğimizde userName ve isActive değerlerine erişemeyiz. Stringify işlemini geri almak için parse() metodu kullanılabilir.
```jsx
let user={userName:"zehracakir",isActive:true}
user=localStorage.getItem("user")
user=JSON.parse(localStorage.getItem("user")) //parse islemi
console.log(user.userName)
console.log(user.isActive)
```
### LocalStorage Bölüm Sonu Egzersizi
```jsx
let counter=localStorage.getItem("counter") ? Number(localStorage.getItem("counter")) : 0
let counterDOM=document.querySelector("#counter")
let increaseDOM=document.querySelector("#increase")
let decreaseDOM=document.querySelector("#decrease")
counterDOM.innerHTML=counter
increaseDOM.addEventListener("click",clickEvent)
decreaseDOM.addEventListener("click",clickEvent)
function clickEvent(){
console.log(this.id)
this.id=="increase" ? counter+=1:counter-=1
localStorage.setItem("counter",counter)
counterDOM.innerHTML=counter
}
```
## Form-Form Submit Yönetimi
Form tanımlama
```jsx
<form action="siteadi" method="get|post">*form elementleri*</form>
```
Form genelde backende istek yapmak istediğimizde kullanılan yapıdır.
- **GET Methodu**: Form verilerini URL üzerinden gönderir. Örneğin; elimizde kullanıcıdan yaşını istediğimiz bir form elementi bulunsun. Kullanıcı yaşını girip gönder butonuna bastığı zaman mail alanına girdiği veri URL üzerinden gönderilir.
**UYARI:** Get metodu önemsiz verilerde kullanılmalıdır, kullanıcı adı, şifre gibi bilgilerin bu method ile gönderilmesi uygun değildir.
- **POST Methodu**: Verileri arka planda gönderir. Örneğin; kullanıcı mail adresini girip gönder butonuna bastığı zaman veriler kullanıcıya gözükmeyecek şekilde sayfaya gönderilir.
### **Giriş (Input) elementi/etiketi**
Form oluşturulduktan sonra içerisine text, buton, şifre vb. tiplerinde input (giriş) elementleri oluşturulur. Bu input tipleri ile tasarımcının isteğine göre formlar tasarlanabilir.
1. Input(giriş) elementi text tipinde belirlenir. Yani klasik textbox kullanımı olarak ifade etsek yanlış olmaz. Örn; kullanıcı adı girişi için idealdir.
```jsx
<input type="text">
```
1. Şifre tipinde veri girişi için kullanılır. Textbox’a girilen ifadeler “*****” şeklinde gizlenerek gösterilir.
```jsx
<input type="password">
```
1. Radio button tipinde, istenilen verileri seçmek için geliştirilen giriş yöntemidir.
```jsx
<input type="radio">
```
1. Checkbox tipinde, onay gerektiren durumlarda kullanılması için geliştirilen giriş yöntemidir.
```jsx
<input type="checkbox">
```
1. Klasik buton oluşturur. Varsayılan olarak herhangi bir işlem yapmaz. JavaScript vb. programlama dilleri ile birlikte işlevsel hale gelir.
```jsx
<input type="button">
```
1. Form içerisindeki elementlere girilen verileri, gönderme işlemini yapar. action ile açılacak yeni sayfaya veya mevcut sayfanın kendisine, get veya post metoduna göre değişecek şekilde veri gönderme işlevini gerçekleştirir. methot="get" kullanılmışsa action durumunda göre sayfanın adres çubuğundaki url’in sonunda, methot="post" kullanılmışsa sayfanın arka planında veriler saklanır.
```jsx
<input type="submit">
```
1. Buton tipinde bir nesne oluşturur. Form içerisindeki elementlere veriler girilmiş halde iken reset’e tıklandığında görünen tüm verileri temizler ve elementleri ilk haline getirir.
```jsx
<input type="reset">
```
1. Sadece e-mail girişi yapabilmek için kullanılır. E-mail formatı dışındaki girişlerde, düzgün veri girişi yapılması gerektiği yönünde uyarı vermektedir. Safari dışındaki tüm tarayıcılar desteklemektedir.
```jsx
<input type="email">
```
1. Sadece sayı girişi yapabilmek için kullanılır. Sayı dışındaki girişlerde, düzgün veri girişi yapılması gerektiği yönünde uyarı vermektedir. Safari dışındaki tüm tarayıcılar desteklemektedir.
```jsx
<input type="number">
```
1. Arama yapmamızı sağlayan giriş tipidir. Aktif olacak form içerisinde, girilecek olan veri aranır. Sadece Google Chrome ve Safari tarafından desteklenmektedir.
```jsx
<input type="search">
```
**onSubmit:** Form submit olduğu anda ne yapacağını söyleyeceğimiz event'tir.
**onChange:** Form'un içindeki form elementlerinin(input) value'su her değiştiğinde bu değişen value'yu bizim her defasında elde etmemize olanak sağlayan eventtir
## Form Özellikleri
- **ACTION:** action = Formunuzu submit ettikten sonra nasıl bir aksiyon alacağını belirlersiniz. Genellikle formlarda gönderi işlemi tamamlandıktan sonra form datası server'a gönderilir. Fakat server haricinde kendimiz bu form datasını başka bir dosyaya atayabiliriz. Örneğimizde görüleceği gibi dosyamız "script.js" adlı bir dosyaya gönderiliyor. Form datasının yönetimi bundan sonra bu dosya üzerinden yürütülür.
**Örnek kullanım** `<form action="/script.js"></form>`
- **METHOD:** method = Form datanızın hangi methodla gönderileceğine karar verir. "Get" veya "Post" request olarak. Bu özellik verilmemesi durumunda default olarak "Get" methodu formunuza atanır.
**Örnek kullanım** `<form action="/script.js" method="get">" veya "<form action="/script.js" method="post">`
- **AUTOCOMPLETE:** autocomplete = Ingilizce isminden de anlaşılacağı üzere formunuzda otomatik tamamlama özelliğini açıp veya kapatmak için işinize yarar. Bu özelliği açmak daha önceki entry'lerinize göre formun tamamlama yapmasını sağlayacaktır.
**Örnek kullanım** `<form action="/script.js" autocomplete="on"> veya <form action="/script.js" autocomplete="off">`
- **NOVALIDATE:** novalidate = Aktif olduğu sürece gönderdiğiniz form datanızın otomatik olarak doğrulanmamasını söyler.
**Örnek kullanım** `"<form action="/my_script.js" novalidate>"`
Form tag'lerinizde birden fazla element bulundurabilirsiniz. Bunlardan olmazsa olmazı input'lar & butonlardır. Input elemanlarının başlıca özellikleri olarak ;
**fname =** Görünecek olan yazıyı belirler. Bu yazı, adete bir html etiketi gibi görünür.
**type =** Bu kısımda formunuzun text/numerik bir form olacağına karar verirsiniz.
**name =** Input'unuzun name özelliğini belirlersiniz. Genelde isimlendirme küçük harf verilir backend kısmına uygun olması için
**value =** Input'taki aktif görünecek olan yazı için verilir. Örnek olarak butonların üzerindeki yazı gibi düşünebiliriz.
### Input İçerisinden Değer Almak
- Inputu index.html dosyası içerisinde oluşturalım.
```jsx
<div class="container mt-5">
<div class="row">
<div class="col-sm-8 offset-sm-2">
<form id="userForm" method="GET">
<input type="number" name="score" id="score">
<button type="submit" class="btn btn-success">Gönder</button>
</form>
</div>
</div>
</div>
```
- İlgili .js uzantılı dosyamızdan inputumuzun içerisindeki değerleri alalım.
```jsx
let formDOM=document.querySelector("#userForm")
formDOM.addEventListener("submit",formSubmit)
function formSubmit(event){
event.preventDefault()
console.log("işlem gerçekleşti")
let scoreInputDOM=document.querySelector("#score") //inputtan bilgiyi alma
console.log(scoreInputDOM.value) //alınan bilgiyi ekrana yazdırma
```
Aldığımız bilgiyi istersek localStorage de kaydedebiliriz :
```jsx
localStorage.setItem("score",scoreInputDOM.value) //localstorage e kaydetme
```
### Form Bölüm Sonu Egzersizi
- index.html dosyası içerisine :
```jsx
<div id="alert"></div>
<div class="container mt-5">
<div class="row">
<div class="col-sm-8 offset-sm-2">
<form id="userForm" method="GET">
<div class="mb-3">
<label class="form-label" for="userName">Kullanıcı adı</label>
<input class="form-control" type="text" name="userName" id="userName">
</div>
<div class="mb-3">
<label class="form-label" for="score">Not bilgisi</label>
<input class="form-control" type="number" name="score" id="score">
</div>
<div class="mb-3">
<button type="submit" class="btn btn-success">Gönder</button>
<button type="reset" class="btn btn-danger">Resetle</button>
</div>
</form>
</div>
<div class="col-sm-8 offset-sm-2 mt-4">
<ul class="list-group" id="userList">
</ul>
</div>
</div>
```
- İlgili .js dosyası içerisine :
```jsx
// Form bolum sonu egzersizi
/* 1-formu sec
2-input icerisindeki bilgiyi sifirla
3-form icindeki bilgiyi sifirla
4-eger forma bilgi girilmezse kullaniciyi uyar
*/
let userFormDOM = document.querySelector('#userForm')
userFormDOM.addEventListener('submit', formHandler)
const alertDOM = document.querySelector('#alert')
const alertFunction = (title, message, className="warning") => `
<div class="alert alert-${className} alert-dismissible fade show" role="alert">
<strong>${title}</strong> ${message}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
`
function formHandler(event) {
event.preventDefault()
const USER_NAME = document.querySelector("#userName")
const SCORE = document.querySelector("#score")
if (USER_NAME.value && SCORE.value) {
addItem(USER_NAME.value, SCORE.value) // gonderdikten sonra sifirladik
USER_NAME.value = ""
SCORE.value = ""
} else {
alertDOM.innerHTML = alertFunction(
"Baslik Bilgisi",
"Eksik Bilgi Girdiniz",
"success"
)
}
}
let userListDOM = document.querySelector('#userList')
const addItem = (userName, score) => {
let liDOM = document.createElement('li')
liDOM.innerHTML = `
${userName}
<span class="badge bg-primary rounded-pill">${score}</span>
`
liDOM.classList.add(
'list-group-item', 'd-flex', 'justify-content-between', 'align-items-center'
)
userListDOM.append(liDOM)
}
```
## **Dizi (Array) Oluşturmak ve Dizi İçindeki Elemanlara Ulaşmak**
### **Array Nedir?**
Programlamanın temel amaçlarından birisi verileri saklamak ve manipüle edebilmektir. Arrays (diziler) bu işe yaramaktadır. Array'lerde bir değişken (variable) tanımlayarak birden fazla değeri (value) saklayabilir ve onları daha sonra çeşitli metotlarla kullanabiliriz. Array oluşturmak için köşeli parantez kullanırız. Oluşturulan array'de her bir değere 'element' (eleman) denir.
- Bir array'in veri tipi object'dir.
**DİKKAT:** Array'leri tanımladığımız değişkenin let veya const ile deklare edilmesi arasında fark bulunmaktadır. let ile deklare ettiğimiz bir array daha sonra yeniden tanımlanabilir. const ile deklare ettiğimiz bir array'i yeniden tanımlayamayız. const ile deklare ettiğimiz bir array yeniden tayin edilemese de içerisindeki elemanlara erişme ve değiştirme noktasında let ile aynıdır.
- JavaScript'te array(dizi) tanımı birden çok value(değer) saklamamızı sağlar.Bir dizi oluşturmak için yapmamız gereken dizi ismini verip eşittir dedikten sonra köşeli parantezler içinde dizi elemanlarını yazmak. Her eleman arasında bir virgül koymamız gereklidir.
- Dizi tanımlama :
```jsx
let dizi = [1,2,3,false,"zehra"];
```
- Bir dizi içinde farklı bir dizi(diziler) tanımlayabiliriz. Örneğin:
```jsx
let dizi1=[1,"zehra",["a",2,"b"],true]
```
### Dizi İçerisindeki Elemanlara Erişim
Her dizi elemanının index değeri vardır. İlk elemanın index değeri 0’dır.Bu index değerlerini kullanarak bizler dizi elemanlarına erişebiliriz. Örneğin:
```jsx
let dizi2 = [1,2,3,"dört","beş"];
console.log( dizi2[3] ); //dört
console.log( dizi2[0] ); //1
```
Tüm elemanlara for döngüsü ile erişebiliriz:
```jsx
let dizi2 = [1,2,3,"dört","beş"];
for (let i = 0; i < dizi2.length; i++) {
console.log(dizi2[i]);
}
```
Ya da tüm elemanlara forEach döngüsüyle de erişebiliriz:
```jsx
let dizi3 = [1,2,3,"dört","beş"];
dizi3.forEach((item, index) => {
console.log(item, index);
});
```
Burada arrow function şeklinde yazılmış forEach metodu her bir dizi elemanı için çalıştırılır. `item`
değeri dizinin o anki elamanını tutar ve `index` değeri ise o anki elemanın index değeridir.
```jsx
//array olusturmak
let domain="zehra"
let isActive=false
let items=[1, 2 ,3, isActive, domain]
console.log(items)
let emptyArray=[] //bos bir dizi
//array icerisindeki eleman/oge sayisini ogrenmek
console.log(items.length)
//array icindeki ilk elemani cagirmak
console.log(items[0])
//array icindeki son elemani cagirmak
console.log(items[items.length-1])
// degisken icindeki bilginin array olup olmaduğı bilgisini almak
console.log(typeof(items)) //object doner
console.log(Array.isArray(items)) //true
console.log("[]: ",Array.isArray([])) //true
console.log("1: ",Array.isArray(1)) //false
console.log("true: ",Array.isArray(true)) //false
//arrayin icindeki ortadaki elemanin cagirilmasi
console.log(items[Math.floor(items.length/2)])
```
## **Diziye Yeni Eleman Eklemek, Çıkartmak ve Güncellemek**
- Diziye Yeni Eleman Eklemek
Dizilere push(), unshift() ve splice() metotlarıyla yeni eleman ekleyebiliriz.
### **push() metot**
push() metot, var olan bir dizinin sonuna eleman eklemeye yarar.
```jsx
let items=[10, 20, 30, 40]
console.log("items - ilk hali : ",items)
//arrayin sonuna eleman eklemek
items.push(50)
console.log(items)
```
### **unshift() metot**
unshift() metot, var olan bir dizinin başına eleman eklemeye yarar.
```jsx
let items=[10, 20, 30, 40]
console.log("items - ilk hali : ",items)
//arrayin basina eleman eklemek
items.unshift(5)
console.log(items)
```
### **splice() metot**
splice() metot diziye hem eleman eklemek için hem de eleman silmek için kullanılır. Metodun ilk parametresi işlemin yapılacağı index numarasını, ikinci parametre ise kaç elemanın silineceğini belirtir.
```jsx
var sports = ['basketball', 'football', 'tennis' ];
console.log(sports); // basketball, football, tennis
sports.splice(1,0,'baseball');
console.log(sports); // basketball, baseball, football, tennis
```
- Diziden Eleman Silmek
Dizilerden pop(), shift() ve splice() metotlarıyla eleman silebiliriz.
### **pop() metot**
pop() metot, var olan bir dizinin en sonundaki eleman silmeye yarar.
```jsx
let items=[10, 20, 30, 40]
console.log("items - ilk hali : ",items)
//arrayin sonundaki elemani cikarmak
let lastItem=items.pop() //elemani cikardik yakaladik degiskene atadık
console.log(items)
console.log(lastItem)
```
### **shift() metot**
shift() metot, var olan bir dizinin başından eleman silmeye yarar.
```jsx
let items=[10, 20, 30, 40]
console.log("items - ilk hali : ",items)
//arrayin basindaki elemani cikarmak
let firstItem=items.shift() //elemani cikardik yakaladik degiskene atadık
console.log(items)
console.log(firstItem)
```
- Dizide Eleman Güncellemek
Dizi içerisindeki her bir eleman 0' dan başlayan bir indeks numarasına sahiptir. Bu sayede indeks numaralarını kullanarak güncelleme yapabiliriz.
```jsx
let items=[10, 20, 30, 40]
console.log("items - ilk hali : ",items)
//array icindeki ilk ogenin bilgisini degistirmek
items[0]=2;
console.log(items)
//array icindeki ilk ogenin bilgisini degistirmek
items[items.length-1]=80
console.log(items)
```
## **Array (Dizi) Metotlarının Kullanımı ve Array içinde Array Oluşturma**
### **.includes()**
- Includes metodu bir elemanın dizi içerisinde bulunup bulunmadığını kontrol eder. Boolean (true/false) olarak çıktı alınır.
```jsx
//x elemani array de var mi ?
const arananElemanVar = items.includes("elma");
console.log("aranan eleman var mı : ",arananElemanVar);
```
### **.join()**
- Bazen Dizi içerisinde topladığınız verileri, string (sözdizimi) olarak yazdırmak isteyebilirsiniz. Join metodu bu konuda yardıma yetişiyor.
- Parantez içerisine dizi elemanları arasına koymak istediğimiz string'i parametre olarak girebiliriz. Eğer bir parametre vermezsek virgül bastırır.
```jsx
console.log(allUsers.join(" --- "))// birlestirme islemi yapabiliriz joinle
```
### **.concat()**
- Bu metot farklı dizileri birleştirip tek bir diziye çevirmemizi sağlıyor.
### Örnek Kullanımlar
```
let items=[1, 2, 3, 4, 5]
//array icinde array
let femaleUsers= ["ayse", "fatma", "hayriye"]
let maleUsers=["ali", "ahmet", "mehmet"]
items.unshift(femaleUsers) //basa eklemek
console.log(items)
items.push(maleUsers) //sona eklemek
console.log(items)
//x elemani array de var mi ?
const arananElemanVar = items.includes("elma");
console.log("aranan eleman var mı : ",arananElemanVar);
console.log(items.length) //items ın boyutu
// array icinde array de icerdeki her bir array 1 eleman olarak sayilir
console.log(items[0]) // (3)['ayse', 'fatma', 'hayriye']
console.log(items[0][0]) //ayse
console.log(items[0][1]) //fatma
console.log(items[0][2]) //hayriye
console.log(items[0].length) //array icindeki istedigimiz arrayin length bilgisine ulastik
//array icerisinden oge ayirmak
let newItems=items.splice(2,4)
console.log("newItems : ",newItems)
console.log("items : ",items)
//array icerisindeki ogenin index bilgisini bulmak
items.unshift("lorem")
items.push("zehra")
console.log(items)
console.log(items.indexOf("zehra"))
//array kopyalamak
let copyItems=items
console.log(items)
copyItems.pop()
//burda iki array de de degisiklik oldu. Biz bunu istemiyoruz.
console.log(items)
console.log(copyItems)
//o zaman nasil yapmaliyiz ?
console.log("kopyalandiktan sonra : ")
copyItems=items.slice()
copyItems.pop()
console.log(items)
console.log(copyItems)
let es6Items=[...items] //es6 ve sonrasinde gelen kopyalama islemi. slice ın yerine bu da kullanilabilir.
console.log(es6Items)
//iki array bilgisini birlestirmek
let allUsers=[...femaleUsers,...maleUsers] //es6 iile arrayleri birlestirmek
console.log(allUsers)
//array icerisindeki bilgiyi stringe cevirmek
console.log(allUsers.toString())
console.log(allUsers.join(" --- "))// birlestirme islemi yapabiliriz joinle
//istedigimiz index bilgisine gore oge eklemek
allUsers.splice(allUsers.length-1,0,"Melisa") //en sondaki elemandan bir önceki index e eleman ekledik
console.log(allUsers)
```
## Döngüler
### **for Döngüsü Kullanımı**
Bir for döngüsü, *belirtilen koşul doğru olduğu sürece komutların çalıştırılmasını sağlar.*
Koşul sağlanmazsa döngü çalışmayı durdurur.
```jsx
for(baslangicAtamasi; kosulIfadesi; arttirimIfadesi){
yapilacak islemler
}
```
Örnek tanımlama
```jsx
for(let i=0; i<10; i++){
console.log(i)
}
//i yi disarida da tanimlayabiliriz
let i=0
for(; i<10; i++){
console.log(i)
}
```
- Array in elemanlarini bastiralim
```jsx
let users=["Zehra", "Çakır", "SDU"]
let i=0
for(; i<users.length; i++){
console.log(users[i])
}
```
### **Break ve Continue Kullanımı**
**Break :** break ifadesi içinde bulunduğu döngüyü sonlandırmak diğer bir deyişle döngüden çıkılması hizmetini sunar. Bu hususta öneminin yeniden vurgulanması gereken nokta "break" ifadesinin sadece kendine en yakın yani içinde bulunduğu döngü içerisinde geçerli oluşudur.
```jsx
const LOREM_LIST=[
"lorem", "ipsum", "dolor", "sdü", "bilgisayar", "kod", "js"]
let counter=0
for(; counter<10; counter++){
if(counter===5){
break //5 gelince cikti
}
console.log(counter)
}
// baska ornek
const UL_DOM=document.querySelector("#userList")
for(let index=0; index<LOREM_LIST.length; index++){
if(LOREM_LIST[index] == "dolor"){ //dolor a gelince bitirir
break
}
let LI_DOM=document.createElement("li")
LI_DOM.innerHTML=LOREM_LIST[index]
UL_DOM.append(LI_DOM)
}
```
**Continue :** Continue ifadesi ise bulunduğu döngü içinde o anki çalışacak olan devir işlemini pas geçerek bir sonraki devir işlemini başlatır. Yine burada da vurgulanması gereken nokta "continue" ifadesinin sadece kendine en yakın yani içerisinde bulunduğu döngü içinde geçerli oluşudur.
```jsx
const LOREM_LIST=[
"lorem", "ipsum", "dolor", "sdü", "bilgisayar", "kod", "js"]
let counter=0
for(; counter<10; counter++){
if(counter===5){
continue // 5 i atlayip devam etti
}
console.log(counter)
}
//baska ornek
const UL_DOM=document.querySelector("#userList")
for(let index=0; index<LOREM_LIST.length; index++){
if(LOREM_LIST[index] == "dolor"){ //dolor u atlayip devam eder
continue
}
let LI_DOM=document.createElement("li")
LI_DOM.innerHTML=LOREM_LIST[index]
UL_DOM.append(LI_DOM)
}
```
### while **Döngüsü Kullanımı**
While döngüsü oluşturabilmek için ilk olarak parametre olarak bir koşul vermemiz gerekmektedir verdiğimiz koşul sağlandığı sürece döngü devam eder. Bu koşul sınırsız olursa döngü de sonsuz kere devam eder ve biz bunu istemeyiz genel olarak sonlanacağı bir durumla döngü sonlandırılmalıdır.
```jsx
let counter=0;
//standart while kullanımı
while(counter<10){
console.log(counter)
counter ++
}
//baska ornek
let userName="";
while(userName==""){ //kullanici adi girilmedigi surece while calisir, girildiginde sonlanir.
userName=prompt("Kullanici adinizi giriniz: ")
console.log(userName)
}
```
**JavaScript'de forEach Nasıl Kullanılır?**
JavaScript'te forEach , döngü oluşturmamızı ve bu döngüyü sırayla çalıştırmamızı sağlayan bir array metodudur.
forEach fonksiyonu item, index, array olmak üzere 3 parametre alabilir.
```jsx
arr.forEach(function(value, index, array) {
// index ve array kullanmak opsiyoneldir
}
```
Örnek
```jsx
const PRODUCTS=["laptop", "phone", "speaker", "desktop pc", "server", "mouse", "keyboard"]
PRODUCTS.forEach((product,index,array) =>{
console.log(product, index, array)
})
```
**Filter Metodu**
Bir Array metodu olan **filter()**, dizi elemanlarını döngüye alıp, istediğimiz koşula sahip olanlarla yeni bir dizi oluşturmak için kullanılır.
Örnek
```jsx
//5 harften fazla olanları istiyorum
const PRODUCTS=["laptop", "phone", "speaker", "desktop pc", "server", "mouse", "keyboard"]
const NEW_PRODUCTS = PRODUCTS.filter(item=>item.length>5)
console.log(NEW_PRODUCTS)
//aktif kullanicilari bulmak istiyorum
const USERS=[
{fullName: "Ayşe Sümer", isActive:false},
{fullName: "Zehra ç", isActive:true},
{fullName: "yusuf d", isActive:true},
{fullName: "Ayça k", isActive:false}
]
const ACTIVE_USERS=USERS.filter(user=>user.isActive==true) //true istiyorsak true yazmasak da olur
console.log(ACTIVE_USERS)
```
**Map ile Array İçerisideki Yapının Değiştirilerek Yeni Liste Oluşturulması**
Array Map metodu, parametre ile kendisine gönderilen dizinin her bir elemanı için ayrı ayrı çalışır ve belirlenen işleme tabi tutup, yeni bir dizi meydana getirir.
Öncelikle Array Map metodunun kullanımına bir göz atalım.
```jsx
array.map( function(value, index, array), this)
```
**Gönderilen parametreleri inceleyelim;**
- array : Üzerinde işlem yapılacak olan diziyi belirtir. Bu dizinin her bir elemanı map metotunun içinde belirleyeceğimiz işleme tabi tutulacaktır.
- value : Üzerinde işlem yapılan dizi değerini belirtir.
- array : Üzerinde işlem yapılan diziye erişimi sağlar
- this : Kullanımı zorunlu değildir(opsiyoneldir). this değişkenine iletilecek olan değeri belirtir.
Örnek
```jsx
const USERS=["AYSE", "MehMet", "TugCe", "AkSEL"]
//userName icinde orijinal isim kalsin
//shortName icinde ilk harf buyuk
//newName icinde ilk harf buyuk olsun
const NEW_USERS=USERS.map(user => user.toLowerCase())
console.log(NEW_USERS)
const USERS_OBJECT=USERS.map(item=>
{
return {userName: item, shortName: `${item[0]}`, newName:`${item[0].toUpperCase()}${item.slice(1).toLowerCase()}`}
})
console.log(USERS_OBJECT)
```
## **Object(Nesne) Nedir? Nasıl Oluşturulur?**
Objeler, içerisinde birden fazla değeri depolayan yapılardır. Property olarak bilinen bu değerler primitive(String,number, boolean vb.) veya başka objeler olabilirler ve her bir değer string veya sembol ile isimlendirilebilir.
- Object Oluşturmak
Objeler üç şekilde oluşturulabilir. Object literal, new Object keyword’ü ve Object.create() fonksiyonuyla. Object literal ve new Object yöntemleri, normal bir objeyi oluştururken kullanılan yöntemlerdir. Object.create() yöntemi ise, mevcut bir objeden kalıtım yoluyla bazı bilgiler alarak yeni bir obje oluşturmaya yarar.
1. **Object Literals**
JavaScript’te obje oluşturmanın en kolay yolu olarak bilinir. Süslü parantez `{}` kullanılarak oluşturulan objenin içerdiği property'lerin değerleri iki nokta `:` işaretiyle belirtilir. Property'ler birbirlerinden virgül `,` ile ayrılır.
```jsx
let literalObjEx={
"name":"zehra",
"surname":"cakir"
}
console.log("literalObjEx tipi : ",typeof(literalObjEx)) //object
```
1. ****New Keyword****
New keyword'ü yeni bir obje oluşturup başlatır. Oluşturulurken belli başlı bazı constructor invocation’lardan(kurucu çağrılarından) birini(Object, Array, Date vb.) yazmak ve sonuna mutlaka fonksiyon çağrısı olduğunu belirten parantezleri `()` eklemek gerekir. Fonksiyon çağrısı, objenin başlatılması için olmazsa olmazdır.
```jsx
let item=new Object() //bunun object oldugunu belirttik
```
****Object Prototype****
Javascript’te hemen her objenin bağlantılı olduğu ikinci bir obje vardır ve bu ikinci objelere prototype denir. Mevcut obje, ikinci objeden yani prototype’ından kalıtım(inheritence) alır. Object literal yöntemiyle oluşturulan her objenin prototipi aynıdır: `object.prototype`
New keyword'ü kullanılarak oluşturulan objelerin ise nereden kalıtım alacakları, function invocation’larına göre değişiklik gösterebilir.
1. **Object.create**
Obje oluşturmadaki son yöntem olan object.create() yöntemi, yeni bir obje oluştururken nereden kalıtım alacağına karar vermemizi sağlayan bir yöntemdir.
- Herhangi bir yerden kalıtım almasını istemediğimiz bir obje oluşturmak istediğimizde null parametresini atamak yeterli olacaktır.
```jsx
let noInheritence = Object.create(null); //herhangi bir kalıtım(inheritence) almaz
```
- standartObject isimli obje örneği, object literal ve new object keyword ile oluşturulan objelerin prototiplerini parametre olarak aldığı için, onlar gibi çalışır.
```jsx
let standartObject = Object.create(Object.prototype) //standart obje kalıtımı alır.
```
- *argentina* isimli obje örneği ise daha önce oluşturduğumuz countriesTalkSpanish isimli object literal’dan kalıtım alacağı için onunla aynı property'lere sahip olur.
```jsx
let argentina = Object.create(countriesTalkSpanish)
```
- objeye, ülkenin başkentini belirten yeni bir property atadık. Artık elimizde başkentini, konuşulan dili ve hangi kıtada yer aldığını bildiğimiz bir ülke var.
```jsx
argentina.capital = “buenos aires”;
```
### **Object Anahtar (Key) ve Değer (Value) Yapısının Kullanımı/Erişimi**
Bir obje(object), {…} süslü parantezleri ile, isteğe bağlı olarak bir özellikler(property) listesiyle oluşturulabilir. Property bir "anahtar(key): değer(value)" çiftidir ve burada key("property name" de denir) bir string(yazı tipinde), value herhangi bir veri tipi olabilir.
- doğru anahtar bilgisi oluşturmak
```jsx
//[key1:1, key2=2,...]
let laptop1={
brand: "Apple",
model: "MackBook Pro", //bir key baslarken mutlaka karakter ile baslar
"1kg": 2 //illa sayi ile baslamak istiyorsak tirnak icine almamız lazım
//keyler bosluksuz yazilmali camelCase ya da _ ile yazabiliriz. _ genelde kullanilmaz
}
//key lere ulasma
console.log(laptop1.brand)
console.log(laptop1["brand"]) //ustteki ile ayni kullanim. Ikisini de kullanabiliriz
console.log(laptop1.model)
console.log(laptop1["1kg"])
```
- anahtar bilgisine yeni değer eklemek
```jsx
laptop1.brand="Mac"
console.log(laptop1)
laptop1["brand"]="Mac1"
console.log(laptop1)
```
- yeni bilgi eklemek istiyorsak
```jsx
laptop1.version="10.15.7"
console.log(laptop1)
```
- icerisindeki anahtarlara bakmak, bilgilerine bakmak
```jsx
keys=Object.keys(laptop1)
console.log(keys) // yontem 1
console.log(Object.keys(laptop1)) //yontem 2
keys.forEach(key => { //yontem 3
console.log(key)
console.log(laptop1[key])
});
```
- deger bilgilerine ulasmak (values) => Object.values(item)
```jsx
console.log(Object.values(laptop1))
let values=Object.values(laptop1)
values.forEach(values => {
console.log(values)
});
```
- Bir propertyy’i kaldırmak için silme(delete) operatörünü kullanabiliriz:
```jsx
delete laptop1.brand;
```
Özetle
```
Objeler, birkaç özel niteliğe sahip ilişkilendirilebilir array(dizi)'lerdir.
* Key / value şeklinde property'leri saklar.
* Key ifadesi string veya sembol olmalıdır.
* Value ifadesi herhangi bir değer alabilir.
* Belli bir property'e erişmek için kullanabileceklerimiz:
* Dot notation: obj.property
* Square brackets notation obj[“property”]. Bu özellik key'in obj[varWithKey] gibi bir değişkenden alınmasına izin verir.
Bu zamana kadar bahsettiğimiz objeler “plain object” olarak isimlendirilir.
```
- Obje Metotları
```
Object.keys(obj) – Key’lerden oluşan bir array döner(return).
Object.values(obj) – Value’lardan oluşan bir array döner.
Object.entries(obj) – [key, value] çiftlerinden oluşan bir array döner.
```
### **Nesnelere Nasıl Metot Ekleriz?**
- **Metotu Özellik Olarak Eklemek**
Metot, bir nesnenin oluşturulduğu sırada özellik olarak eklenip tanımlanabileceği gibi, önceden tanımlanmış bir nesneye sonradan da eklenebilir.
```jsx
let user1={
firstName:"Bilgin",
lastName:"Uzman",
score:[1, 2, 3, 4],
isActive:true,
shortName: function(){
return `${this.firstName} ${this.lastName}`
}
};
console.log(user1)
console.log(user1.shortName()) //metoda erisim
```
## **Object ve Array Destructuring Kullanımı**
### **Destructuring Nedir?**
Destructuring bir obje veya bir array içinden her bir elemanın alınıp bir değişken içine kaydedilmesi.
```jsx
let settings = {
userName: "zehraCakir",
password: "sduBilgisayar",
isActive: false,
ip: "127.0.0.1",
serverName: "javascript.com"
}
```
- settings içinden herhangi birine şöyle ulaşabiliriz :
```jsx
let userName= settings.userName
console.log(userName)
```
- rename işlemi yapabiliriz :
```
let {userName: user,password,isActive,ip,serverName}=settings
console.log(userName,password,isActive,ip,serverName)
console.log(settings)
console.log(user) //ilk satirda userName:user diyerek userName i cagirmak istedigimizde user diyerek cagiracagimizi belirttik.
```
- object içindeki bazı bilgilerin çıkarılması
```jsx
let {userName:userName2,password:pasword2,isActive:isActive2,...newSettings}=settings //{} --> object oldugundan dolayi
console.log(userName2, pasword2, isActive2, newSettings) //newSettings i ekrana basarken farkli bir object e alarak basar.
```
- object’in destructuring ile kopyalanması
```jsx
//HATALI
// let settings2=settings
// settings2.userName="yeni bilgi" //burada kopyalama degil de icerik degistirme var
// console.log("settings ",settings)
// console.log("settings2",settings2)
//destructuring yapisi
let settings2={...settings} //cikar kopyala diyoruz aslinda bu yapida
settings2.userName="yeni bilgi"
console.log("settings ",settings)
console.log("settings2",settings2)
//destructuring yapisi ile kopyalanan object te degisiklik yapmiyoruz, sadece kopya uzerinde degisiklik yapmis oluyoruz.
let score= [100, 200, 300, 400]
let[score1, score2, ...otherScore]=score //[] --> array oldugundan dolayi
console.log(score1, score2, otherScore)
//object kopyalama ile ayni
let copyOfScore = [...score]
console.log(copyOfScore)
```
## **Try Ve Catch Kullanımı**
**try...catch** ifadesini basitçe ifade edersek; Herhangi bir iş yaparken bir hatayla karşılaşılma durumunun ele alınması anlamına gelmektedir.
**try** anahtar kelimesi kodları çalışma zamanında test etmek için kullanılırken, **catch** anahtar kelimesi ise çalışma zamanında hata çıkması durumunda bu hataları yakalamak için kullanılır.
- Örnek kullanım :
```jsx
// UNUTMA!! Eger bir blokta hata varsa ve bu bloktaki hatayi yonetmediysen; artik daha asagiya inemezsin, islemleri goremezsin..
//try-catch
let products;
try{
products.forEach(item=>console.log(item))
}catch(error){
console.log("error : ",error)
}
console.log("hata yonetimi duzgun calisiyor")
let info="zehracakir"
console.log(info)
```
**Throw İle İstisnalar Oluşturma**
**throw** ifadesi bize özel hatalarımızı oluşturmanıza olanak tanır. Teknik olarak **throw**
ile bir istisna (hata) atılabilir.
- Örnek kullanım :
```jsx
<input type="text" id="dogumTarihi" />
<button onclick="valid()">Gönder</button>
```
```jsx
function valid(){
try {
if (document.querySelector("#dogumTarihi").value == "") {
throw 'Doğum tarihini boş geçemezsiniz';
};
}catch(error) {
console.log(error);
}
}
```
## **Fetch API İle Çalışmak**
`Fetch API`, kaynakları (ağ genelinde dahil) getirilmesine yönelik basit bir arayüzdür.
### Fetch Interfaces
- `fetch()`, bu yöntem bir kaynak almak için kullanılır.
- `Headers`, response/request başlıklarını temsil ederek bunları sorgulamanıza ve sonuçlara bağlı olarak farklı eylemler gerçekleştirmenize olanak tanır.
- `Request` , bir kaynak talebini temsil eder.
- `Response`, bir isteğe verilen yanıtı temsil eder.
### Temel Fetch Kullanımı
Fetch API’ yi kullanmak için fetch metoduna istek yapacağımız url’ i parametre olarak vermek gerekiyor.
```jsx
fetch(url);
```
fetch() metodundan sonra, metodun sonuna then() promise metodunu ekleriz:
```jsx
.then(function() {
})
```
Örneğin “**[https://jsonplaceholder.typicode.com/todos”](https://jsonplaceholder.typicode.com/todos%E2%80%9D)** adresine get isteğinde bulunalım.
```jsx
// GET İsteği
fetch("https://jsonplaceholder.typicode.com/todos")
.then((response) => response.json()) //parse json data
.then(function (todos) {
todos.forEach((todo) => {
console.log(todo.title); //Başlıkları console' a yazdırma
});
});
```
![Untitled](images/Untitled%209.png)
```jsx
.catch((err) => console.log(err))
```
Ve en sonunda catch() metoduyla herhangi bir aşamada hata oluşursa, bu hatayı parametre olarak alıp console’a yazdırıyoruz. | null | es6,javascript,dom,fetch-api,json,localstorage,nodejs | 2023-01-23T14:15:54Z | 2023-02-06T10:16:35Z | null | 1 | 0 | 6 | 0 | 0 | 12 | null | null | JavaScript |
Shekhar-Joshi07/Shopease | main | <h1 align="center" id="title">Shopease</h1>
<p align="center"><img src="https://iili.io/HcHUepe.png" alt="project-image" width="220" height="200/"></p>
<p id="description">Shopease is an e-commerce online website for the best products of all categories for the consumer. User can buy products at best deals and offers.<br><br><b>This is a collaborative project of 4 members</b><br><br>- Chandra Shekhar Joshi (Team Lead)<br>- Vikram Navik<br>- Kirpa Shankar Pandey<br>- Harsha Vardhan</p>
<h2>🌐See Live</h2>
[https://shopease-net.netlify.app/](https://shopease-net.netlify.app/)
<h2>Project Screenshots:</h2>
<img src="https://i.postimg.cc/mrW2zzZM/Screenshot-20230122-091721.png" alt="project-screenshot" width="500" height="250/">
<img src="https://i.postimg.cc/Y2v9PwPv/Screenshot-20230122-091758.png" alt="project-screenshot" width="500" height="250/">
<img src="https://i.postimg.cc/nLwxKXp0/Screenshot-20230122-091822.png" alt="project-screenshot" width="500" height="250/">
<img src="https://i.postimg.cc/nc8Hw97W/Screenshot-20230122-091901.png" alt="project-screenshot" width="500" height="250/">
<img src="https://i.postimg.cc/bv6y66H0/Screenshot-20230122-091919.png" alt="project-screenshot" width="500" height="250/">
<img src="https://i.postimg.cc/BvZZBWDQ/Screenshot-20230122-091951.png" alt="project-screenshot" width="500" height="250/">
<h2>🛠️ Installation Steps:</h2>
<p>1. Clone the repo</p>
```
git clone https://github.com/Shekhar-Joshi07/abounding-development-2683.git
```
<p>2. Install NPM packages</p>
```
npm install
```
<p>3. View on browser at localhost:3000</p>
```
npm start
```
<h2>💻 Tech Stack</h2>
Technologies used in the project:
* React Js
* Redux
* Chakra Ui
* JavaScript
<h2>Special Thanks 😊</h2>
<p>Thanks Masai School for giving us this opportunity to show and deploy our skills to explore ideas and learn new things about project-making </p>
| Shopease is an ecommerce online website for the best products of all categories for the consumer. User can buy products at best deals and offers. | react,chakra-ui,javascript,redux | 2023-01-17T04:32:52Z | 2023-01-22T16:35:01Z | null | 6 | 7 | 48 | 1 | 4 | 12 | null | null | JavaScript |
Apuntes-De-Un-Ingeniero-Youtube/text-encriptor | main | null | Pequeño encritador de texto realizado para Alura Latam, puedes ver el paso a paso del desarrollo en mi canal de YouTube | css3,html5,javascript | 2023-01-24T17:08:03Z | 2023-01-24T17:20:40Z | null | 2 | 0 | 2 | 0 | 5 | 11 | null | null | CSS |
Andrew-Tsegaye/beatmaker-app | start-engine | # Elegant and fancy beatmaker app
![beatmaker_App](https://i.imgur.com/cZGiKOb.png)
> With its sleek and sophisticated user interface resembling a real drum kit, the app immerses users in a captivating and entertaining experience that truly takes their breath away. The intricate design and attention to detail are nothing short of mind-blowing, elevating the drumming experience to a whole new level of professionalism.
## Table of Contents
- Installation
- Usage
- Contributing
- License
## Installation
To run this website locally, you need to have Git and a web browser installed on your machine. You can then clone this repository by running the following command in your terminal:
```bash
git clone https://github.com/Andrew-Tsegaye/beatmaker-app.git
```
After cloning the repository, you can open the `index.html` file in your web browser to view the website.
## Contributing
Contributions are always welcome!
If you would like to contribute to this project, you can fork this repository and make your changes on your own fork. Once you have made your changes, you can create a pull request to merge your changes into the main repository.
Please make sure to follow the [Contributing Guidlines](https://github.blog/2012-09-17-contributing-guidelines/) when making your changes.
## Acknowledgments
You are free to use, modify, and distribute this code as long as you give credit to the original author [Andrew Tsegaye](https://www.linkedin.com/in/andrew-tsegaye-542921221/).
## License
This project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).
| The intricate design and attention to detail are nothing short of mind-blowing, elevating the drumming experience to a whole new level of professionalism. | animations,css3,drumkit,javascript,sounds | 2023-01-18T20:00:59Z | 2023-03-27T09:26:59Z | null | 1 | 0 | 5 | 0 | 1 | 11 | null | null | HTML |
limingcan562/learn-babel-7 | main |
## 介绍
### 目录`know-babel-package`
> 此文件夹存放:**了解`Babel`主要几个包**所涉及的案例
- `no-preset` 不利用预设编译
- `use-preset` 利用预设编译
- `compile-stage-1` 如何编译小于`stge-4`的语法
- `know-babel-polyfill` 初识 `@babel/polyfill`组成
- `import-regenerator-runtime` 感受手动引入`regenerator-runtime`包
- `no-import-regenerator-runtime` 感受不需要手动引入`regenerator-runtime`包
- `helper-functions` 什么是辅助函数
- `no-use-tranform-runtime` 不使用`@babel/plugin-transform-runtime`
- `use-transform-runtime` 使用`@babel/plugin-transform-runtime`
该目录`Babel`版本:
- `@babel/core`最新版本是:`7.20.12`
- `@babel/preset-env`最新版本是:`7.20.2`
### 目录`know-babel-config`
> 此文件夹存放:**了解`Babel`如何配置** 所涉及的案例
- `preset-env-targets-config` 感受`@babel/preset-env`如何减少`ES6+`语法编译
- `preset-env-useBuiltIns-config` 体验`@babel/preset-env`配置`useBuiltIns`各值表现形式
- `preset-env-template-config` 配置`ES6+`在`IE 11`运行
- `use-third-party-library-problem` 使用第三方库时的问题
- `transform-runtime-config` 感受`@babel/plugin-transform-runtime`各配置项
该目录`Babel`版本:
- `@babel/core`最新版本是:`7.20.12`
- `@babel/preset-env`最新版本是:`7.20.2`
### 目录`new-babel-config`
> 此文件夹存放:用`babel-plugin-polyfill-corejs3`来代替`Babel`旧的配置方法,相当于是`Babel`新的配置方法
- `entry-global` 感受新的配置方法`entry-global`可以替代旧的配置方法`useBuiltIns: entry`
- `usage-global` 感受新的配置方法`usage-global`可以替代旧的配置方法`useBuiltIns: usage`
- `usage-pure` 感受新的配置方法`usage-pure`可以替代,开发第三方库时的旧的配置方法
- `target-configuration` 感受新配置方法`targets`配置项是如何解决以前开发第三方库体积大的问题
- `transform-runtime-targets-problem` 感受以前`@babel/transform-runtime`不能识别`targets`问题
- `usage-pure-problem` 感受以前新的配置方法`usage-pure`目前存在的问题
该目录`Babel`版本:
- `@babel/core`最新版本是:`7.21.8`
- `@babel/preset-env`最新版本是:`7.21.5`
## 相关文章
[去查看](https://juejin.cn/column/7185787287601905701)
| 了解Babel的主要几个包;并深入Babel应该如何配置 | babel,babel7,javascript | 2023-01-18T10:33:47Z | 2023-05-15T16:17:09Z | null | 1 | 3 | 35 | 0 | 0 | 11 | null | MIT | JavaScript |
itaypanda/SimpleToast | main | # :sparkles: SimpleToast
![LicenseMIT](https://img.shields.io/github/license/itaypanda/simpletoast?style=for-the-badge)
![CodeSize](https://img.shields.io/badge/code_size_gzipped_+_min-1%2e6KB-blue?style=for-the-badge)
Simple toast notification library with Tailwind CSS.
**This means TailwindCSS is required! for this to work "out of the box"**
## :arrow_heading_down: Installation
Simply include the [SimpleToast.js](./SimpleToast.js) or [SimpleToast.min.js](./SimpleToast.min.js) file.
Or, you can also link it via JsDelivr:
```html
<script src="https://cdn.jsdelivr.net/gh/itaypanda/simpletoast@master/SimpleToast.min.js"></script>
```
## :memo: Change Log
- **August 25th** - rewrote some of the code and made it easier to customize, also code is now smaller. - [#1](https://github.com/itaypanda/SimpleToast/issues/1)
- **November 2nd** - added a JsDelivr link, updated a usage instruction renamed some files to demo, updated and made README a little nicer.
- **November 5th** - added live demo github pages site.
## :gear: Config
No configuration is required unless you count the init and the toast itself.
## :fire: Usage
```javascript
// Init the library onto the page, can be skipped if you add:
// <div id="alertBox" class="fixed bottom-0 right-0 z-[9999]"></div>
// Anywhere in the page, recommended at the top or bottom
toastInit();
// Example info toast:
toast('Title', 'Message', toastStyles.info);
// Example warn toast:
toast('Title', 'Message', toastStyles.warn);
// Example error toast:
toast('Title', 'Message', toastStyles.error);
// Example success toast:
toast('Title', 'Message', toastStyles.success);
// Example toast with set fade time 10 seconds instead of the default (7.5 seconds):
toast('Title', 'Message', toastStyles.info, 10);
```
## :wrench: Adding custom styles
```javascript
// Defining the style
const toastStyles = {
// ...
customStyle: {
color: "blue", // Tailwind CSS color. Ex: [#ffffff].
icon: "<svg></svg>" // Doesn't have to be an svg.
},
}
// Using it
toast('Title', 'Message', toastStyles.customStyle);
```
Recommended svg/img size: 21x21
## :computer: Demo
**LIVE DEMO: [itaypanda.github.io](https://itaypanda.github.io/)**
You can open the [demo.html](./demo.html) file to view a demo page of the library:
![demonstration](demo.jpg)
## :wave: Contact/Contribute
Open an issue and I'll answer as soon as I'm available.
Feel free to contribute :D
Feel free to open an issue if you find any, or if you want to add a feature!
## :star: Star History
[![Star History Chart](https://api.star-history.com/svg?repos=itaypanda/simpletoast&type=Date)](https://star-history.com/#itaypanda/simpletoast&Date)
## :page_with_curl: License
This project is licensed under the [MIT license.](./LICENSE)
>Copyright (c) 2023 itaypanda
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## :blue_heart: Thanks
**Thanks to Tailwind CSS / Tailwind Labs, Inc.**
https://github.com/tailwindlabs/tailwindcss/blob/master/LICENSE
https://github.com/tailwindlabs/tailwindcs
https://tailwindcss.com/
**Thanks to system UIcons**
https://github.com/CoreyGinnivan/system-uicons/blob/main/LICENSE
https://github.com/CoreyGinnivan/system-uicons
https://www.systemuicons.com/
| :sparkles: Simple (simple as calling a function!) ultra lightweight (1.6kb!) toast notification library built with tailwind css (🥳). | javascript,javascript-library,tailwindcss,toast-notifications,simple,toast | 2023-01-18T13:19:50Z | 2023-11-05T09:22:34Z | null | 1 | 0 | 23 | 0 | 1 | 11 | null | MIT | JavaScript |
AlejandroAkbal/WhatsApp-Web-Mention-Everyone-Userscript | main | # WhatsApp Web Mention Everyone
This userscript automates the process of mentioning everyone in a group chat.
<!-- Image -->
![WhatsApp Web Mention Everyone](misc/example.jpg)
## Usage
1. Install [Tampermonkey](https://www.tampermonkey.net/).
2. Click [the userscript](https://raw.githubusercontent.com/AlejandroAkbal/WhatsApp-Web-Mention-Everyone-Userscript/main/src/main.user.js) and add it to Tampermonkey.
3. Go to [Whatsapp Web](https://web.whatsapp.com/).
4. Open a group chat.
5. Type `@@`.
6. Enjoy!
| Automatically tag everyone in a group chat on WhatsApp Web | javascript,userscript,whatsapp,whatsapp-web,automation | 2023-01-23T09:40:29Z | 2024-03-26T12:01:15Z | null | 1 | 1 | 23 | 1 | 5 | 11 | null | AGPL-3.0 | JavaScript |
home-assistant-tutorials/02.hello-world-card | main | # Hello World Card
A minimal card with manual setup
***
* @published: January 2023
* @author: Elmar Hinz
* @workspace: `conf/www/tutor`
The target of this tutorial is to show minimal steps to be done to get hello
world output from a card written all by yourself. The setup is still done
manually to understand the technical requirements. More advanced solutions will
be covered by future tutorials. Please understand minimal as a reasonable
minimum to get started, not as the absolute minimum.
## Prerequisites
* a development environment (see tutorial 1)
* the Prerequisites named there
* basic skills of JavaScript
* a workspace `conf/www/tutor`
## Cloning the Repository
You may clone this repository into your workspace and follow along.
Alternatively you may want to write the code yourself, to get a deeper effect of
learning. Just decide what works best for you.
Fork the repository on Github into your own instance. Open the workspace
directory in the command-line. Call `git clone <URL>`. Use the `URL` Github does
give you, when you click the button `Code`. If your setup is well done, you
should prefer `SSH` over `HTTPS`. This allows you to easily push to your
repository.
## The Cards Code
Find the code in the file named `card.js` alongside with this README.
### A custom element
The card has to be a [***custom
element***](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements).
The class inherits from `HTMLElement` or any equivalent parent class. Often you
will find cards, that inherit from [`LitElement`](https://lit.dev).
```js
class HelloWorldCard extends HTMLElement {
```
### Configuration
While setting up your card in the dashboard, `setConfig()` gets triggered upon
edit with the configuration data. This method is required. You use it here to
update the internal config property. In the second tutorial, you will go a step
ahead.
```js
setConfig(config) {
this.config = config;
}
```
### View
```js
set hass(hass) {
const entityId = this.config.entity;
const state = hass.states[entityId];
const stateStr = state ? state.state : 'unavailable';
```
The `hass()` setter gets triggered, when the state of the hass object is
changing. First we extract the information of our interest into constants,
to prepare them for the output.
```js
if (!this.content) {
this.innerHTML = `
<ha-card header="Hello ${hass.user.name}!">
<div class="card-content"></div>
</ha-card>
`;
this.content = this.querySelector('div');
}
```
The HTML enclosure of the card (including the header) gets setup once. It does
not change. Nonetheless we can use the user name here. There is a new instance
per login. The inner `<div>` as a placeholder gets assigned to the content
variable.
```js
this.content.innerHTML = `
<p>The ${entityId} is ${stateStr}.</p>
`;
```
Only the dynamic node is updated upon each call to minimize changes of the DOM
tree.
### Visit the Official Documentation
You should know [the official
documentation](https://developers.home-assistant.io/docs/frontend/custom-ui/custom-card),
too. This tutorial is based upon it. It defines a method `getCardSize()` in
addition, you should know about. This is not required for a hello world example
and I avoid the discussion if pixels are a suitable unity for HTML at all.
## Running the Code
### Adding the Resource
Open your admin account of the development environment in the web browser. Did
you already unlock **Advanced Mode**?
![unlock advanced mode](img/advanced-mode.png)
Go to ***Settings*** > ***Dashboard***. Click the three dots in the upper right
hand corner to open ***Resources***. Click ***ADD RESOURCE*** in the lower right
hand corner.
As the URL enter `/local/tutor/<YourRepoName>/card.js`. Replace `<YourRepoName>`
with the repo name you use. Choose ***JavaScript Module*** and submit.
![adding as resource](img/adding-as-resource.png)
### Using the Card
Go to a dashboard. Use the three dots in the upper right hand corner to edit the
dashboard. Take control if required. Click ***+ ADD CARD***. At the bottom
select ***Manual*** to add a custom card.
![card configuration](img/card-config.png)
In the card configuration enter:
```yaml
type: 'custom:hello-world-card'
entity: sun.sun
```
Don't forget the `custom` prefix, as you add a custom card. The type of the card
is the type you did register in the last line of the `card.js` file:
```js
customElements.define('hello-world-card', HelloWorldCard);
```
If everything went well so far, congratulations! You should now see the output of the first card you created yourself. Try different entities.
![success](img/success.png)
| Writing your first card for Home Assistant | hello-world,home-assistant,javascript,smarthome,dashboard-card | 2023-01-25T16:25:54Z | 2023-05-24T13:43:09Z | null | 1 | 0 | 6 | 1 | 9 | 11 | null | null | JavaScript |
rivasbolinga/To-Do-App | main |
<div align="center">
<img width="320" alt="Screenshot 2023-01-28 at 09 59 42" src="https://user-images.githubusercontent.com/103900838/215257205-f6a6f12c-bfbe-4f18-880c-c58358554001.png">
<img width="1440" alt="Screenshot 2023-01-28 at 09 59 27" src="https://user-images.githubusercontent.com/103900838/215257208-bc05acba-2341-46fa-8d07-2436143e9e2c.png">
<br/>
# 📖 To Do - APP <a name="about-project"></a>
</div>
**To Do - App** is a small app where you can record all your tasks and projects you have to do. You can organize your week, and mark important and completed tasks.
## Requierements ##
1. Your todo list should have projects or separate lists of todos.
2. You should separate your application logic (i.e. creating new todos, setting todos as complete, changing todo priority etc.) from the DOM-related stuff, so keep all of those things in separate modules.
3.View all projects
4.View all todos in each project (probably just the title and duedate… perhaps changing color for different priorities)
5. Expand a single todo to see/edit its details
6. Delete a todo
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
<a href="https://www.w3.org/html/" target="_blank"><img align="center" src="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original-wordmark.svg" alt="html5" width="55" height="55"/></a><a href="https://www.w3schools.com/css/" target="_blank"><img align="center" src="https://raw.githubusercontent.com/devicons/devicon/master/icons/css3/css3-original-wordmark.svg" alt="css3" width="55" height="55"/></a><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank" rel="noreferrer"><img align="center" src="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg" alt="javascript" width="55" height="55"/></a>
<a href="https://webpack.js.org/" target="_blank"><img align="center" src="https://github.com/webpack/media/blob/master/logo/icon.svg" alt="webpack" width="55" height="55"/></a>
### Key Features <a name="key-features"></a>
- **Totally responsive for mobiles, tablets and desktops**
- **Modal to add to do in the mobile version**
- **Add remove, edit, mark complete and see information of a to do.**
- **Data saved in local Storage**
## 🚀 Live Demo <a name="live-demo"></a>
- Live Demo Link 📍 [here](https://rivasbolinga.github.io/To-Do-App/)
## 👤 Authors <a name="live-demo"></a>
👤 **Andrea Rivas Palacios**
- GitHub: [@rivasbolinga](https://github.com/rivasbolinga)
- Twitter: [@AndreaRivasPal](https://twitter.com/AndreaRivasPal)
## 🔭 Future Features <a name="future-features"></a>
- [ ] **Store the tasks in projects**
- [ ] **Next pages to save lots of to do**
<!-- SUPPORT -->
## ⭐️ Show your support <a name="support"></a>
Thank you for visiting my profile, if you like this project, you can show your support by giving me a nice :star:️
<p align="right">(<a href="#readme-top">back to top</a>)</p>
| Its is a small app that keeps track of tasks and projects, divide in folders and notes. | html,html5,javascript,todo | 2023-01-21T17:42:44Z | 2023-04-11T19:13:40Z | null | 1 | 5 | 48 | 1 | 0 | 10 | null | null | JavaScript |
Shaheryar0054/To-Do-List-app-project | main | <a name="readme-top"></a>
# 📗 Table of Contents
- [📖 About the Project](#In this project we build simple Book list application that can add and remove the Books)
- [🛠 Built With](#build-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ (OPTIONAL)](#faq)
- [📝 License](#license)
<!-- PROJECT DESCRIPTION -->
# 📖 [To-do-list-app-interactive] <a name="about-project"></a>
> Describe your project in 1 or 2 sentences.
**[To-do-list-app-interactive]** In this project we build simple application that have ability to add and remove books
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
> Describe the tech stack and include only the relevant sections that apply to your project.
<details>
<summary>Client</summary>
<ul>
<li><a href="https://www.w3schools.com/html/">HTML</a></li>
</ul>
<ul>
<li><a href="https://reactjs.org/">Javascript</a></li>
</ul>
<ul>
<li><a href="https://reactjs.org/">CSS</a></li>
</ul>
</details>
### Key Features <a name="key-features"></a>
> Describe between 1-3 key features of the application.
- **[Used webpack]**
- **[setup the basic structure of to-do-list-app]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🚀 Live Demo <a name="live-demo"></a>
> Add a link to your deployed project.
- [Live Demo Link]()
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 💻 Getting Started <a name="getting-started"></a>
> Describe how a new developer could make use of your project.
To get a local copy up and running, follow these steps.
### Prerequisites
In order to run this project you need:
- Browser
- git
- code editor
### Setup
To get a local copy up and running follow these simple example steps.
- Clone the repository using:
```
https://github.com/Shaheryar0054/To-Do-List-app-project.git
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 👥 Authors <a name="authors"></a>
> Mention all of the collaborators of this project.
👤 **Authors**
👤 **Shaheryar Abid**
- GitHub: [@shaheryar0054](https://github.com/Shaheryar0054)
- Twitter: [@sharya0310](https://twitter.com/home)
- LinkedIn: [@shaheryar](https://www.linkedin.com/in/shaheryar-abid-8758121b3/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🔭 Future Features <a name="future-features"></a>
> Describe 1 - 3 features you will add to the project.
- [Used webpack] **[new_feature_1]**
- [Created array of objects] **[new_feature_2]**
- [CSS is loaded by Webpack Style/CSS Loader] **[new_feature_3]**
<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](https://github.com/Shaheryar0054/To-Do-List-app-project/issues).
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## ⭐️ Show your support <a name="support"></a>
> Write a message to encourage readers to support your project
If you like this project please give me stars rating
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🙏 Acknowledgments <a name="acknowledgements"></a>
> Give credit to everyone who inspired your codebase.
- Thanks to the Microverse team for the great curriculum.
- Thanks to the Code Reviewer(s) for the insightful feedback.
- A great thanks to My coding partner(s), morning session team, and standup team for their contributions.
- Hat tip to anyone whose code was used.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 📝 License <a name="license"></a>
This project is [MIT](./LICENSE) licensed.
_NOTE: we recommend using the [MIT license](https://choosealicense.com/licenses/mit/) - you can set it up quickly by [using templates available on GitHub](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository). You can also use [any other license](https://choosealicense.com/licenses/) if you wish._
<p align="right">(<a href="#readme-top">back to top</a>)</p> | This is a simple single page to-do-list application, that allows you to add, edit and remove or complete a task, featuring a checklist styled list with a add new task button as well as a clear all … | css,html,javascript,react | 2023-01-18T11:50:59Z | 2023-01-19T12:49:54Z | null | 1 | 3 | 19 | 5 | 1 | 10 | null | MIT | JavaScript |
darrowv/JsLogs | main | # Online JS Code Console
### [Try it out](https://darrowv.github.io/JsLogs/)
## Features
- Syntax highlighting
- Dark and light themes
- Some "CodeMirror" features as brackets closing, match highlighting etc.
- Code formatting with Prettier
- Minimalistic design, just your js code input and console output
- The code is saved in localstorage when the run button is pressed and is overwritten with each subsequent press.
## Tips
- You can also use the keyboard shortcuts to run the code (Ctrl + Enter) and to clear console output (Ctrl + \\)
- Use prettier to format your code (Alt + Shift + F).
- You can change the theme of the editor by clicking on (initially) the moon.
## Code Snippets
There are some code snippets added in code editor for convenience. If you want some more, let me know about it. Here is the list of current snippets:
```javascript
var customSnippets = {
cl: "console.log();",
cc: "console.clear();",
fd: "function name() {\n\n};",
af: "let foo = () => {};",
lorem: `"Lorem ipsum dolor sit amet consectetur adipisicing elit. Nobis ab eveniet ipsa hic quod, ipsam quia quo? Nam consequatur, nostrum ullam consequuntur mollitia ipsa deserunt eaque, ipsam quo sit animi!"`,
};
```
You can find all snippets in ./src/utils/snippetsAndEditor.js
To activate code snippet just type it and press Tab.
## Contribution
We welcome contributions from the community to improve the editor. You can fork the repository and create a pull request with your changes.
## Credits
- The code editor is made using the [CodeMirror library](https://codemirror.net/). Guided by [this manual](https://www.math.ucla.edu/sites/all/libraries/codemirror/doc/manual.html).
- Favicon generated with [this tool](https://favicon.io/favicon-generator).
- The idea of theme switching mechanism is taken from [here](https://dev.to/vaishnavs/simple-dark-light-toggle-with-vanillajs-2cbj).
- The script for resizing divs by dragging was taken from [here](https://htmldom.dev/).
- [Prettier in browser.](https://prettier.io/docs/en/browser.html)
- The lamp icons are taken from [svgrepo](https://www.svgrepo.com/).
| Online JS Code Console | codemirror,javascript,prettier | 2023-01-18T19:08:08Z | 2023-10-24T18:19:40Z | null | 1 | 1 | 53 | 0 | 1 | 10 | null | null | JavaScript |
phetsims/paper-land | main | # Paper Playground
[![Documentation](https://img.shields.io/badge/documentation-website-yellow?logo=markdown&logoColor=yellow)](https://phetsims.github.io/paper-land/)
[![Matrix Server](https://img.shields.io/badge/matrix-chat-green?logo=matrix&logoColor=green)](https://matrix.to/#/#interactive-paper-programming:matrix.org)
[![Youtube Channel](https://img.shields.io/badge/youtube-channel-red?logo=youtube&logoColor=red)](https://www.youtube.com/@PaperPlaygroundCommunity/)
[![License](https://img.shields.io/github/license/phetsims/paper-land?color=blue)](./LICENSE)
![logo](docs/assets/hand-with-dots.png)
## Interactive Play Meets Multimodal Web Experience
Paper Playground is an open-source project for collaboratively creating multimodal web experiences by means of mapping JavaScript* code to real pieces of paper and manipulating the code in your **physical space**.
(*written directly or using a no/low-code component-style interface!)
**We aim to support a community interested in bringing physical interaction as a means to collaboratively solve problems in codesigning virtual technology**.
Paper Playground is based on the [Paper Programs](https://paperprograms.org) open-source project and has been extended to incorporate the library stack used by [PhET Interactive Simulations](https://www.github.com/phetsims/community) as a convenient 2D scene creator and manager. The project focuses on enabling quick prototyping of web projects, with a particular emphasis on easy addition of audio features (like sounds and sonifications), speech description (both TTS engines and screen reader-like descriptions), and other non-visual features that are often difficult to design and develop alongside visual elements in these projects.
The ideas behind Paper Playground are simple, but the possibilities are infinite.
1. Create programs, as many as you would like, to represent your project.
2. Map data variables, parameters, and functions to paper position, size, shape, rotation, proximity, and use optional marker positions for more functionality.
3. Print out the dot-covered papers that belong to those programs.
4. Put those *paper programs* in front of a webcam.
5. Watch and interact with the output of that code in your browser.
6. Move programs around and trigger the mappings between your papers position in space and your code!
7. Change your program code, make new papers, and keep the creativity going!
![Paper Playground setup detecting paper programs that create a moon lander and control vertical thrust](/docs/assets/full-interface.png)
## Installation
See the [Paper Playground Docs website](https://phetsims.github.io/paper-land/setup/install/) for the most up to date installation instructions.
![Paper Playground setup detecting paper programs that create a moon lander and control vertical position](/www/web-assets/lunar-lander-craft.gif)
## What is coming?
Our team is focused on a few large initiatives for integrating other projects into Paper Playground and for making it more friendly for non-technical, non-JavaScript users and designers.
⭐ If these projects interest you, please [join our community](https://phetsims.github.io/paper-land/community/) and take part in the development and discussion!
1. :unlock: Creator Interface: Abstracting the JavaScript code through means of a no/low-code component style interface that assembles the data components of your programs and highlights the relationships between your programs (e.g., At a quick glance, what information is needed and passed between programs?). **Check out our progress by opening the Creator page in the tool!**
2. :robot: AI Support: Using LLMs to support a user answer the question: "How do I turn my idea for a multimodal interactive into data variables, functions, and entire programs?". **We are working toward this goal by adding an optional AI assistant inside the Creator page to help generate custom JavaScript code for more complex functions!**
3. :outbox_tray: Easier API integration for paper programs to control or output to other browser displays (besides our [scenery](https://github.com/phetsims/scenery)-focused Board and the legacy canvas-focused Projector), as well as new inputs such as microcontroller integration via Bluetooth and WebSockets. See our [example with the Weavly educational coding project](https://youtu.be/eZo0asFXJz4?si=xiexw7O04gPZW_Sc)!
However, there are **many other areas** that the project can be expanded (see Community below for Contributing guidelines and suggestions)!
## :earth_asia::earth_americas::earth_africa: [Join our Community!](https://phetsims.github.io/paper-land/community/) :earth_asia::earth_americas::earth_africa:
## :clipboard: Roadmap
### Docs
:books: Updated setup and tutorial!
### Tool
:page_with_curl: More examples in the hosted database highlighting the power of multimodal design!
:computer: A UI for creating basic Papers without deep JavaScript knowledge!
:robot: Investigating use of LLMs to help users go from ideas to your suite of paper programs!
## License
This software is licensed under the MIT license. For more information, see the [LICENSE](https://github.com/phetsims/paper-land/blob/main/LICENSE) file.
## Acknowledgments
This tool was adapted from [Paper Programs](https://paperprograms.org/) by JP Posma, which was inspired by the work at [Dynamicland](https://dynamicland.org).
| Build and explore multimodal web interactives with pieces of paper! | codesign,community,javascript,multimodal,open-source,paper,ar,augmented | 2023-01-19T21:08:44Z | 2024-05-17T22:47:44Z | null | 16 | 4 | 1,162 | 39 | 1 | 10 | null | MIT | JavaScript |
Samir1009ms/car-product | master | null | Html Css Javascript Scss | css,html,javascript,responsive,scss | 2023-01-17T21:00:53Z | 2023-01-26T06:52:30Z | null | 1 | 0 | 15 | 0 | 1 | 10 | null | null | HTML |
Claquettes/casse-briques | master | # casse-briques
Minimalist Web-based breakout game by Mathieu Ponton (@Claquettes)
A Recreation of the classic Breakout game, created in Html, CSS and Javascript.
The goal is to destroy all the bricks by bouncing the ball on the paddle.
The player can choose to play differents levels, currently there are 6 levels, but I plan to make at least a dozen.
It is hosted on my website to make it playable by everyone at claq.fr/casse-briques.
| Minimalist Web-based breakout game by @Claquettes | game,game-development,javascript,javascript-game,js,web-games | 2023-01-21T19:44:17Z | 2023-04-23T07:48:32Z | null | 1 | 0 | 46 | 0 | 0 | 10 | null | null | JavaScript |
Rachelwebdev/Interactive-to-do-list-with-webpack-bundle | main | # Interactive-to-do-list-with-webpack-bundle
<a name="readme-top"></a>
# 📗Table of Contents
- [Interactive-to-do-list-with-webpack-bundle](#interactive-to-do-list-with-webpack-bundle)
- [📗Table of Contents](#table-of-contents)
- [📖 \[Interactive-to-do-list\] ](#-interactive-to-do-list-)
- [🛠 Built With ](#-built-with-)
- [Tech Stack ](#tech-stack-)
- [Key Features ](#key-features-)
- [🚀 Live Demo ](#-live-demo-)
- [💻 Getting Started ](#-getting-started-)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [Usage](#usage)
- [👥 Author ](#-author-)
- [Future Features ](#future-features-)
- [🙏 Acknowledgments ](#-acknowledgments-)
- [📝 License ](#-license-)
<!-- PROJECT DESCRIPTION -->
# 📖 [Interactive-to-do-list] <a name="about-project"></a>
**[Interactive-to-do-list]** is a project that keeps a list of the tasks that the user needs to complete in a day. You can add tasks, delete tasks, mark tasks as complete, save tasks for future reference
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
<details>
<summary>Client</summary>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</details>
### Key Features <a name="key-features"></a>
- An HTML File
- A CSS File
- A Javascript file
- An md file
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LIVE DEMO -->
## 🚀 Live Demo <a name="live-demo"></a>
>
- [Live Demo Link](https://rachelwebdev.github.io/Interactive-to-do-list-with-webpack-bundle/dist/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 💻 Getting Started <a name="getting-started"></a>
### Prerequisites
In order to run this project you need:
A Browser
### Setup
Clone this repository to your desired folder:
`git@github.com:Rachelwebdev/Interactive-to-do-list-with-webpack-bundle.git`
### Install
Install this project with:
A commandline interface e.g Gitbash
### Usage
To run the project, execute the following command:
To run the project, execute the following command:
Click on the live server button on your IDE
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 👥 Author <a name="authors"></a>
👤 **Rachel Isaac**
- GitHub: [@rachelwebdev](https://github.com/Rachelwebdev)
- Twitter:[@rachelisaac13](https://twitter.com/Rachelisaac13)
- LinkedIn: [Rachel Isaac](https://www.linkedin.com/in/rachelisaac13/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
### Future Features <a name="future-features"></a>
- Activate the delete task button
- Activate the "mark completed" task button
- Include a page that shows all tasks that have been completed per day
- Instead of just an input field, include a detailed form /timetable for more inputs
<p align="right">(<a href="#readme-top">back to top</a>)</p>
🤝 Contributing
Contributions, issues, and feature requests are welcome!
<p align="right"><p align="right">(<a href="#readme-top"><a href="#readme-top">back to top</a></a>)</p></p>
## 🙏 Acknowledgments <a name="acknowledgements"></a>
🙏 Acknowledgments
Give credit to everyone who inspired your codebase.
I would like to thank Microverse for the learning materials and technical support provided to work on this project
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 📝 License <a name="license"></a>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
📝 License
This project is [MIT](https://github.com/Rachelwebdev/Interactive-to-do-list-with-webpack-bundle/blob/main/LICENSE) licensed.
| 'A to do list that allows the user to input tasks in a list format. The user can also mark a task that is completed and delete all completed tasks or individual tasks. This project was built with HTML, CSS, and JavaScript. ' | css,html,html5,javascript | 2023-01-17T13:09:09Z | 2023-01-26T16:33:02Z | null | 2 | 5 | 71 | 3 | 1 | 10 | null | MIT | JavaScript |
Bikash-nath/BookHive | main | # BookHive
**_Bookhive is an evolving reading library with thousands of free audiobooks, eBooks and magazines.
<br />
Now a comprehensive, seamless and personalized reading experience is at your fingertips, making reading more accessible than ever.
<br />
Our Aim is to help people explore, discuss and share books they love and improve the process of learning and reading via the efforts of a fantastic community of readers._**
### ![App](https://user-images.githubusercontent.com/5663078/161288344-33fa8e03-92ee-46ff-b490-38bf4dd8f379.png#gh-dark-mode-only) Visit app: [bookhive.vercel.app](https://bookhive.vercel.app//)
<br>
> ## Getting Started - Frontend
First, run the development server:
```bash
npm run dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
<br>
> ### Packages & dependencies
- [<em>BookHive backend<em>](https://github.com/Bikash-nath/BookHive-backend)
<br>
## Feedback
Comments and questions can be posted in the discussions section here on GitHub:
[![Discussions](https://img.shields.io/badge/discussions-on%20GitHub-green)](https://github.com/Bikash-nath/BookHive/discussions/)
In case of more serious matters, like bug reports and other unexpected behavior, visit the issue section here on GitHub:
[![GitHub issues](https://img.shields.io/github/issues/audiamus/AaxAudioConverter)](https://github.com/Bikash-nath/BookHive/issues)
<br>
<h3 align="center">
Liked this project?? If yes, don't forget to show your support by putting a ⭐ on this project
</h3>
| Bookhive is an evolving reading library where you can access thousands of free audiobooks, eBooks and magazines. | audiobooks,epub-reader,nextjs,react,tailwindcss,axios,javascript | 2023-01-23T06:42:23Z | 2023-05-15T19:55:10Z | null | 1 | 2 | 137 | 0 | 6 | 9 | null | null | JavaScript |
LenofagIndustries/LRelaySockets | main | ![License](https://img.shields.io/github/license/gerrustalker/LRelaySockets?style=flat-square)
![Open issues](https://img.shields.io/github/issues/gerrustalker/LRelaySockets?style=flat-square)
![Release Downloads](https://img.shields.io/github/downloads/gerrustalker/LRelaySockets/total?style=flat-square)
[![Join my Discord server!](https://img.shields.io/badge/discord-working%20example-5865F2?style=flat-square&logo=discord&logoColor=white)](https://gm.lenofag.ru/discord)
# LRelaySockets
Integrate your Garry's Mod server with Discord
### What this relay can do:
* [Connect](images/chatrelay.png) your Discord and game's chats
* Send [console](images/console.png) output to Discord and run console commands
* [Server status](images/statusapi.png) and player info Web API
* Lua API - make your own Discord commands
## Dependencies
### node.js
- axios@0.27.2
- steamid@2.0.0
- discord.js@13.6.0
- express@4.17.3
- express-ws@5.0.2
### Garry's Mod
- [GWSockets](https://github.com/FredyH/GWSockets) by FredyH ([downloads](https://github.com/FredyH/GWSockets/releases))
- [gm_spew](https://github.com/danielga/gm_spew) by danielga ([downloads](https://github.com/danielga/gm_spew/releases))
## Installation
1. [Clone](https://github.com/gerrustalker/LRelaySockets/archive/refs/heads/main.zip) this repository
2. Install npm dependencies using `npm i`
3. Install modules from [Dependencies](#garrys-mod) to server's `garrysmod/lua/bin`
4. Drop [`lrelaysockets`](garrysmod/addons/lrelaysockets) folder to your server's `garrysmod/addons` folder
5. [Configure](#configuration) your installation
6. Done!
## Configuration
1. Open [`config.js`](nodejs/config.js)
2. Here you will need to set channel IDs, Discord token and an **LRELAY key**, which serves as a password, you can set it to anything!
3. Open [`addons/lrelaysockets/lua/autorun/server/sv_config.lua`](garrysmod/addons/lrelaysockets/lua/autorun/server/sv_config.lua)
4. Change `socketPath`, which should look something like `ws://123.45.6.7:8556/relay`
5. Change `token` to your **LRELAY key**, which you set earlier at [`config.js`](nodejs/config.js) as `auth`
6. Change `consoleAccess` to your Discord user ID, you can add additional user IDs
7. (optional) Change `statusName` to whatever name you want for server status API
## Credits
* [Discordia](https://github.com/SinisterRectus/Discordia/) - Lua color convertation
* [Lenofag-2000](https://lenofag.ru) (lenofag.ru?uwu=1#9927)
* [Aksyned](https://izbushechka.su) - inspired from his relay
#
##### This relay is created specifically for **Sandbox** gamemode!
##### You will need to modify it yourself to make it work for DarkRP, TTT, etc
| Integrate your Garry's Mod server with Discord using LRelay | discord-relay,garrysmod,discord-integration,gmod,sandbox,websockets,discord,expressjs,garrysmod-addon,gmod-addon | 2023-01-24T15:22:40Z | 2024-04-09T12:31:52Z | 2023-03-22T19:10:38Z | 1 | 3 | 21 | 1 | 0 | 9 | null | Apache-2.0 | JavaScript |
felipevcc/holbertonschool-higher_level_programming | main | # Holberton School Higher-level Programming
Repository with several projects and programming exercises in Python, JavaScript-Node.js and SQL carried out during studies at [Holberton School](https://www.holbertonschool.com/).
## Projects
* [Python - Hello, World](./python-hello_world)
* [Python - if/else, loops, functions](./python-if_else_loops_functions)
* [Python - import & modules](./python-import_modules)
* [Python - Data Structures: Lists, Tuples](./python-data_structures)
* [Python - More Data Structures: Set, Dictionary](./python-more_data_structures)
* [Python - Exceptions](./python-exceptions)
* [Python - Classes and Objects](./python-classes)
* [Python - Test-driven development](./python-test_driven_development)
* [Python - More Classes and Objects](./python-more_classes)
* [Python - Everything is object](./python-everything_is_object)
* [Python - Inheritance](./python-inheritance)
* [Python - Input/Output](./python-input_output)
* [Python - Almost a circle](./python-almost_a_circle)
* [SQL - Introduction](./SQL_introduction)
* [SQL - More queries](./SQL_more_queries)
* [Python - Object-relational mapping](./python-object_relational_mapping)
* [JavaScript - Warm up](./javascript-warm_up)
* [JavaScript - Objects, Scopes and Closures](./javascript_objects_scopes_closures)
* [JavaScript - Web scraping](./javascript-web_scraping)
* [JavaScript - Web jQuery](./javascript-web_jquery)
## Author
* Felipe Villamizar - [GitHub](https://github.com/felipevcc)
| High-level programming studies at Holberton School | high-level-programming,holbertonschool,python,mysql,sql,database,javascript,nodejs,deploy,devops | 2023-01-23T13:26:38Z | 2023-05-06T22:01:34Z | null | 1 | 0 | 108 | 0 | 0 | 9 | null | null | Python |
math-pixel/Masarus-Adventure | main | null | Project of a 2d game in Javascript with the P5.JS lib | gobelins,javascript,javascriptgame,p5js,p5js-game,school-project,video-game | 2023-01-18T10:24:39Z | 2024-03-14T07:58:14Z | 2023-06-20T17:55:30Z | 3 | 34 | 209 | 4 | 0 | 9 | null | null | JavaScript |
LinWin-Cloud/linwin-DB-server | master |
# Linwin Data Server数据库软件
在广袤无垠的现代大数据海洋之中,计算机深度的和信息以及数据绑定,承载这亿万数据的就是数据库软件。
Linwin Data Server,基于Java开发的国产高性能数据库软件。支持国产和Linux操作系统,支持多用户操作。采用Nosql结构,自研mys数据库操作语言,更加简单方便高效。
用户数据的增删改查全部在内存内操作,与硬盘的交互写入读取交由专门的线程管理,无不妨碍.
#### 当前版本: 1.5-2023.2.20 <a href='./Update.md'>更新信息</a>
### 安装
方法1: <a href='https://gitee.com/LinwinSoft/Linwin-DB-Server/releases/'>下载deb包</a>
方法2:
在Linux终端中属于下列命令行
```
git clone https://gitee.com/LinwinSoft/linwin-DB-server/ # 把源代码克隆到本地
dpkg -b linwin-DB-server/ # 打包deb包
sudo dpkg -i linwin-DB-server.deb # 安装deb包
```
### Linwin Data Server数据库信息
最低运行要求:
1. 至少300MB的磁盘空间
2. 1024Mb(1GB)内存 (如果在云服务器上可以512MB最低最低)
3. 在没有损坏的Linux操作系统上运行
4. 联网的计算机
5. 处理器处理速度: **1.0 HZ** 或 **更快**
6. amd64架构处理器(64位处理器)
特性:
1. 支持分布式集群部署数据库
2. 支持本地储存数据库
3. 支持多用户操作数据库
4. 采用key-value模式的Nosql架构数据库
操作系统支持:Linux
文档支持: <a href='https://gitee.com/LinwinSoft/linwin-DB-server/wiki/home'>文档</a>
### 成熟的服务器架构
Linwin Data Server采用 openLinwin 高性能Web服务器软件成熟架构,每秒可承载***1.5万 - 2.5万*** 次请求
### 非常简单的数据库操作脚本
由Linwinsoft自己研究的mys面向数据库操作的脚本语言mys,
具有简单易懂的特点,支持最基础的增删改查,同时支持复制索引等功能.
基于mys编译器的mys脚本语言支持上传数据、变量注释
Login = {
"remote" : "127.0.0.1",
"port" : "8888",
"user" : "root",
"passwd" : "123456"
}
# 这是一条注释
// 这也是一条注释
/** 同样是注释,下面这段脚本用于列出用户根目录所有的数据库
list database
# 这条代码意思是索引出所有带有 'da' 字符的数据
find data da
### 性能
测试环境:
1. Ubuntu Linux操作系统实体机
2. intel i3 4GB内存
3. 无GPU
4. 120GB SSD X2
==============================
1. 100W数据加载需要4-5s
2. 100w数据查询91w条需要0.2-0.3秒(纯服务端)
3. 一次性最多能够加载200w数据,分多次加载效果更佳
| 在广袤无垠的现代大数据海洋之中,计算机深度的和信息以及数据绑定,承载这亿万数据的就是数据库软件。 Linwin Data Server,基于Java开发的国产高性能数据库软件。支持国产和Linux操作系统,支持多用户操作。采用Nosql结构,自研mys数据库操作语言,更加简单方便高效。 用户数据的增删改查全部在内存内操作,与硬盘的交互写入读取交由专门的线程管理,无不妨碍. | data-science,database,http,server,linux,programming-language,webserver,website,data,hashmap | 2023-01-22T07:33:04Z | 2023-02-20T11:15:34Z | null | 3 | 1 | 435 | 0 | 1 | 9 | null | GPL-3.0 | Java |
PamelaRondina/SuperMarioBros_DevEmDobro | main | # Página: Super Mário Bros
Este projeto teve como objetivo realizar um site mencionando o Trailer do filme "Super Mario Bros".
Tecnologias de Front-End com Html, CSS e JavaScript
![image](https://user-images.githubusercontent.com/108991648/213933932-ff78b943-71d5-440c-bcc8-0f3a1ab599c0.png)
![image](https://user-images.githubusercontent.com/108991648/213934852-e8a121e8-8aa9-4920-b416-54a61118aa55.png)
<hr>
# Semana Dev Em Dobro - Criação de Site
Instrutores:
- [Dev em Dobro](https://www.youtube.com/c/devemdobro)
<hr>
* [Html: A Base do FrontEnd](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#html-a-base-do-frontend)
* [CSS: Estilizando o Projeto](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#css-estilizando-o-projeto)
- arquivo [`reset.css`](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#resetcss);
- arquivo [`style.css`](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#stylecss);
- [Criar uma modal](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#criar-modal-no-html)
- arquivo [`responsive.css`](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#criar-responsividade-em-telas)
* [JavaScript: Incluindo ação no projeto](https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro#javascript-incluindo-a%C3%A7%C3%A3o-no-projeto)
<hr>
## Html: A Base do FrontEnd
- [x] Criar pasta `src` e subpastas `css` e `images`
- [x] Na raiz do projeto criar `index.html`
![image](https://user-images.githubusercontent.com/108991648/213331544-7db5e33f-9b20-4acd-a0ec-6e408f474ceb.png)
- [x] No arquivo `index.html`
**video**
```html
<div class="video">
<video class="video" autoplay loop muted>
<source src="src/video/video-mario.mp4" type="video/mp4">
</video>
</div>
```
**video** Div criada para a inclusão de um vídeo
**Cabeçalho**
```html
<header class="cabecalho">
<a> <img class="logo" src="src/images/logo-chapeu-mario.png" alt="logo chapéu do Mário">
</a>
<nav>
<ul class="menu">
<li><a href="https://github.com/PamelaRondina/SuperMarioBros_DevEmDobro">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/pamelarondina/">LinkedIn</a></li>
</ul>
</nav>
</header>
```
- **src** para localizar o arquivo
- **alt** para escrever o texto alternativo
- **ul** lista não ordenada
- **li** lista ordenada
**Container**
```html
<main class="container">
<div class="informacoes">
<img src="src/images/titulo.png" alt="imagem do título do filme">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Fuga explicabo voluptas laudantium voluptatibus molestiae quam architecto provident ipsam ex temporibus minima vitae adipisci, omnis aperiam illo non fugiat ea consequatur.</p>
<button>Veja o Trailer
</button>
</div>
<img class="mario" src="src/images/super-mario-chars.png" alt="turminha do Mário">
</main>
```
- **p** parágrafo
- **button** botão
- [x] [Inserir Fonte](https://github.com/PamelaRondina/menu_digital#aula-03---fontes-e-textos)
- [x] [Inserir Favicon](https://github.com/PamelaRondina/step-by-step/tree/main/html#adicionar-favicon)
<hr>
## CSS: Estilizando o Projeto
### Reset.CSS
- [x] Dentro do diretório `css` incluir um novo arquivo `reset.css`
- [x] No arquivo `index.html` fazer a menção do css
```html
<link rel="stylesheet" href="src/css/style.css">
```
> **src** direcionar para onde o arquivo css está salvo
- [x] Em `style.css` iniciar o arquivo com:
```css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
```
- [x] Editar os itens de navegação: Home e Detalhes
```css
ul {
list-style: none;
}
```
- list-style: none; = lista sem marcações
- [x] Editar **a** imagem
```css
a {
text-decoration: none;
}
```
- text-decoration: none = eliminar decoração de link nos textos (cor azul)
### Style.CSS
- [x] Dentro do diretório `css` incluir um novo arquivo `style.css`
- [x] No arquivo `index.html` fazer a menção do css
** Incluir Fonte**
```css
body {
font-family: 'Poppins';
}
```
**Body > Header > Cabeçalho**
```css
.cabecalho {
display: flex;
justify-content: space-between;
padding: 30px;
max-width: 1440px;
margin: auto;
}
```
- display-flex = faz com que os elementos fiquem um ao lado do outro
- justify-content: space-between = espaço igual entre os elementos
- padding: 30px = tamanho da altura
- max-width: 1440px = largura máxima
- margin: 0 auto = imagem permanecer centralizada
```css
.cabecalho .logo {
width: 65px;
}
```
- widht = alterar o tamanho da imagem do logo
```css
.cabecalho .menu {
display: flex;
height: 100%;
align-items: center;
```
- display-flex = faz com que os elementos fiquem um ao lado do outro
- height = altura / espaçamento
- align-items: center = alinhar no centro
```css
.cabecalho nav li a {
font-weight: bold;
color: #ffffff;
font-size: 25px;
padding: 10px 20px;
border-radius: 50px;
transition: 0.2s;
}
```
- font-weight: bold = negrito
- color: #ffffff = cor "branca"
- font-size: 25px = tamanho da fonte
- padding: 10px 20px = tamanho da altura e largura
- border-radius: 50px = arredondamento da borda
- transition: 0.2s = tempo de transição nos botões de navegação
```css
.cabecalho nav li a:hover {
background-color: #d5011d;
}
```
- Ao clicar nos botões de navegação, sua cor será alterada
**Body > Main > Container**
```css
.container {
max-width: 1440px;
margin: 0 auto;
display: flex;
height: calc(100vh - 132px);
align-items: center;
padding: 0 30px 30 px;
}
```
- max-width: 1440px = largura máxima
- margin: 0 auto = imagem permanecer centralizada
- display-flex = faz com que os elementos fiquem um ao lado do outro
- height = cálculo da altura do container - a altura do cabeçalho
- padding: 0 30px = ecima (0) laterais (30) baixo (30)
![image](https://user-images.githubusercontent.com/108991648/213796484-2e3cc794-b050-4f10-a681-1fde1cc0ee14.png)
```css
.container .imagem-titulo {
max-width: 500px;
}
```
- tamanho da imagem
```css
.container .descricao {
color: #a8adb7;
width: 85%;
font-size: 18px;
margin: 30px 0;
}
```
- color: #a8adb7 = cor da letra da descrição
- width: 85% = largura
- font-size: 18px = tamanaho da fonte
- margin: 30px 0 = altura e largura
```css
.container .botao-trailer {
background-color: #ff0021;
color: #ffffff;
padding: 15px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
border: none;
text-transform: uppercase;
transition: 0.5s all ease-in-out;
border-radius: 50px;
}
```
- background-color: #ff0021 = cor do fundo
- color: #ffffff = cor do texto
- padding: 15px = espaçamento do conteúdo com a borda
- font-size: 18px = tamanho da fonte
- font-weight: bold = negrito
- cursor: pointer = mãozinha
- border: none = elimina a borda
- text-transform: uppercase = toso em Maiúsculo
- transition: 0.5s all ease-in-out = transação em 5s com pulsação
- border-radius: 50px = borda arredondada
```css
.container .botao-trailer:hover {
transform: scale(1.2);
}
```
- transform: scale(1.2) = ativa a pulsação
**Vídeo de Fundo**
```css
.fundo-video {
background-color: red;
position: absolute;
z-index: -1;
width: 100vw;
height: 100vh;
overflow: hidden
display: flex;
justify-content: center;;
}
```
- background-color: red = visualização para mobile;
- position: absolute = video em posição absoluta
- z-index: -1 = faz com que o vídeo vá para trás do texto
- width: 100vw = ocupar 100% da largura
- height: 100vh = ocupar 100% da altura
- overflow: hidden = imagem transbordar para as laterais
```css
.fundo-video .video {
height: 100vh;
}
```
- height: 100vh = aumentar altura da tag video
```css
.fundo-video::after {
content: "";
height: 100vh;
width: 100vw;
position: absolute;
top: 0;
left: 0;
background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 50%, rgba(0,0,0,1) 100%);
}
```
- .fundo-video::after = criar elemento novo
- content: ""; = elemento aparacerá na inspeção do site
- height: 100vh = altura
- width: 100vw = largura
- position: absolute = elemento em posição absoluta
- top: 0 e left: 0;
- background: linear-gradient (site cssgradient.io)
laterais escuras e miolo colorido
### Criar Modal no Html
- [x] Em `index.html` no final da main criar uma nova div:
```html
<div clas="modal">
<div class="conteudo-modal">
<span class="fechar-modal">X</span>
<iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/Cb4WV4aXBpk" title="Trailer oficial" frameborder="1" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
```
- [x] No `style.css` incluir:
```css
.modal {
position: fixed;
height: 100vh;
width: 100vw;
top: 0;
left: 0;
background-color: rgba(52, 52, 50, 0.749);
visibility: hidden;
}
```
- visibility: hidden = esconder a modal
```css
.conteudo-modal {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
border-radius: 5px;
gap: 15px;
}
```
- flex-direction: column = X acima - video abaixo
- gap 15px = espaçamento entre o X e o vídeo
```css
.fechar-modal {
background-color: #ffffff;
color: #f03a17;
font-weight: bold;
font-size: 20px;
width: 40px;
text-align: center;
cursor: pointer;
border-radius: 10px;
}
.modal iframe {
border-width: 0;
width: 640px;
height: 360;;
}
```
### Criar Responsividade em telas
- [x] Criar `resposive.css` e mencionar no html
- flex-wrap: wrap = se não tem espaço, joga a imagem pra baixo
- max-width: 50%; = reduzir a imagem
<hr>
## JavaScript: Incluindo ação no projeto
- [x] Em `src` criar diretório `js` e criar arquivo `index.js`
- No arquivo `index.html` fazer a menção do js:
- após a ultima `main`e `body`
```html
<script src="src/js/index.js"></script>
```
Itens importantes:
- [x] 1: Clicar no botão "Veja o Trailer", abrir a modal com o vídeo do trailer
- passo 1: pegar o elemento que representa o botão na tela usando o js
- passo 2: identificar quando o usuário clicar no botão
- passo 3: pegar o elemento da modal no js
- passo 4: abrir a modal na tela
- [x] 2: Clicar no X, fechar a modal
- passo 1: pegar o elemento e fechar a modal usando o js
- passo 2: identificar quando o usuário clicar no "X"
- passo 3: fechar a modal
- passo 4: remover audio do trailer
```js
//1.1 - Buscando a representação do documento na Tela:
const botaoTrailer = document.querySelector(".botao-trailer");
//1.3: pegar o elemento da modal no js
const modal = document.querySelector(".modal");
//2.1: pegar o elemento e fechar a modal usando o js
const botaoFecharModal = document.querySelector(".fechar-modal");
//2.4: remover audio do trailer
//pegue o elemento por um ID = getElementById
const video = document.getElementById("video");
// link do video do Trailer
const linkDoVideo = video.src;
function alternarModal(){
//classlist = propriedade
modal.classList.toggle("aberto");
}
// 1.2. - identificar quando o usuário clicar no botão
// quando clicar no botão Trailer vai executar
botaoTrailer.addEventListener("click", () => {
//1.4: abrir a modal na tela - chamar a função
alternarModal();
video.setAttribute("src", linkDoVideo);
});
//2.2: identificar quando o usuário clicar no "X"
botaoFecharModal.addEventListener("click", () => {
//2.3: fechar a modal
alternarModal();
//2.4: remover audio do trailer
//setAtribute = separar um atributo (no caso o src do video | link do Trailer)
video.setAttribute("src", "");
});
```
| null | css,devemdobro,frontend,html,javascript,guildadevemdobro | 2023-01-18T23:25:05Z | 2023-01-23T01:19:21Z | null | 1 | 2 | 13 | 0 | 1 | 9 | null | MIT | CSS |
gsmalik030/todo-list-project | main |
<h3><b>
Todo list with webpack</b></h3>
</div>
# 📗 Table of Contents
- [📖 About the Project](#awesom-books)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Usage](#usage)
- [Run tests](#run-tests)
- [Deployment](#triangular_flag_on_post-deployment)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ (OPTIONAL)](#faq)
- [📝 License](#license)
# 🛠 Built With
- HTML 5
- CSS 3
- Javascript ES6
- Webpack
# Key Features
> This is a Todo list app.
# 🔭 Future Features
> I will be adding More functions.
## Learning Objectives
- Flexbox to place elements in the page.
- Use javascript objects to save data.
- Practice of all the knowledge i learned in this module.
- Learned how to use webpack.
# 📖 Todo List app
<a name="about-project"></a>
> This is a website for a todo list app.
<!-- Features -->
### Key Features <a name="key-features"></a>
> Describe between 1-3 key features of the application.
- **[It's a website according to the design provided]**
- **[It allows user to add or delete Tasks in todo list]**
<!-- LIVE DEMO -->
## 🚀 Live Demo <a name="live-demo"></a>
> Add a link to your deployed project.
- [Live Demo Link](https://gsmalik030.github.io/todo-list-project/dist/index.html)
### Prerequisites
In order to run this project you need:
I completed all the previous blocks.
### Setup
Clone this repository to your desired folder:
**Just clone the project by runing the `git clone git@github.com:gsmalik030-todo-list/gsmalik030-todo-list.github.io.git` command in your command line, and you are done.**
<!-- AUTHORS -->
👤 **Ghulam Subbhani(Malik)**
- GitHub: [@githubhandle](https://github.com/gsmalik030)
- Twitter: [@twitterhandle](https://twitter.com/gsmalik030)
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/ghulam-subbhani-4b1281252/)
<!-- CONTRIBUTING -->
## 🤝 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>
<!-- SUPPORT -->
## ⭐️ Show your support <a name="support"></a>
If you like this project...
Give a ⭐️ if you like my effort!
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- ACKNOWLEDGEMENTS -->
## 🙏 Acknowledgments <a name="acknowledgements"></a>
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
## 📝 License <a name="license"></a>
This project is [MIT](./LICENSE) licensed.
(https://github.com/gsmalik030-todo-list/gsmalik030-todo-list.github.io/blob/main/LICENSE)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
| This is an app to keep record of your daily tasks. In this you can add tasks and mark them completed and delete them if you want. | css,html,javascript | 2023-01-18T17:13:24Z | 2023-01-20T13:18:22Z | null | 1 | 3 | 24 | 3 | 0 | 9 | null | null | JavaScript |
lenkon/awesome-books-es6 | master | <a name="readme-top"></a>
<div align="center">
<h3><b>Awesome books: with ES6</b></h3>
</div>
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Usage](#usage)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ](#faq)
- [📝 License](#license)
# 📖 [Awesome books: with ES6] <a name="about-project"></a>
> "Awesome books" is a simple website that displays a list of books and allows to add and remove books from that list. Here, the Awesome books app code will be restructured using ES6, and ES6 syntax that is learned will also be implemented. The goal is to make it more organized by using modules.
**[Awesome books: with ES6]** is...
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
> Built with html, css and javascript with linter configuration setup.
<details>
<summary>Client</summary>
<ul>
<li><a href="https://github.com/lenkon/awesome-books-es6/blob/restructure-with-es6/.github/workflows/linters.yml">linter</a></li>
<li><a href="https://www.w3schools.com/html/">html</a></li>
<li><a href="https://www.w3schools.com/w3css/defaulT.asp">css</a></li>
<li><a href="https://www.w3schools.com/js/default.asp">javascript</a></li>
</ul>
</details>
### Key Features <a name="key-features"></a>
> Key features of the application.
- **[Preserve book collection data in the browser]**
- **[Add book to the book collection]**
- **[Remove book from the book collection]**
- **[Use ES6 syntax and modules]**
- **[Refactor methods and functions to arrow functions]**
- **[Use Luxon library to display current date]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🚀 Live Demo <a name="live-demo"></a>
- [Source Link](https://github.com/lenkon/awesome-books-es6)
<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:
- Web Browser (e.g. Firefox, Chrome, Edge)
- NPM (Node Package Manager)
### Setup
Clone this repository to your desired folder:
```
$ git clone https://github.com/lenkon/awesome-books-es6
$ cd awesome-books-es6
```
### Install
Install all project dependencies by running the command below:
```
$ npm install
```
### Usage
Open the index.html file in your Web Browser.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 👥 Authors <a name="authors"></a>
👤 **lenkon**
- GitHub: [@lenkon](https://github.com/lenkon)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🔭 Future Features <a name="future-features"></a>
> Features to be added.
- [ ] **[Add more projects]**
- [ ] **[Add milestones and achievements]**
<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 please rate and give a star.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thank Microverse for sharing the tools and requirements.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## ❓ FAQ <a name="faq"></a>
<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>
| This is a simple online library application, which is an upgraded version of the Awesome Books app, that has features to keep a record of books in the library. It can add, remove and show books from the library. Built with JavaScript, HTML, CSS, and ES6 | es6,html5,css,javascript | 2023-01-23T10:21:56Z | 2023-01-24T16:25:06Z | null | 1 | 1 | 7 | 0 | 0 | 8 | null | null | JavaScript |
LivioAlvarenga/Nlw-Setup | master | <h1 align="center">
<img src="./files/logo.svg" height=20 alt="logo ignite lab">
- Gestão de Hábitos completa com NodeJs (Back-end), ReactJs (Front-end) e React-Native (Mobile)
</h1>
<p align="center">
<a href="#-sobre-o-projeto">Sobre</a> •
<a href="#-vitrine-dev">Vitrine Dev</a> •
<a href="#-tecnologias">Tecnologias</a> •
<a href="#-instalação">Instalações</a> •
<a href="#-funcionalidades">Funcionalidades</a> •
<a href="#-autor">Autor</a> •
<a href="#-licença">Licença</a>
</p>
![Capa](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/Monitor_laptop_Tablet_Celular-Fundos_limpos.png?raw=true#vitrinedev)
![Capa](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/cover.png?raw=true)
<a id="-sobre-o-projeto"></a>
## 💻 Sobre o projeto
🚀 Projeto fullstack de app de monitoramento de hábitos com calendário mostrando hábitos por dia com tonalidades de cores diferentes para identificar a conclusão de hábitos a cada dia. Possibilidade de criação e edição de conclusão de hábitos diariamente.
BACKEND:
- TypeScript
- TSX
- Fastify
- Prisma
- Zod
FRONTEND:
- ViteJs
- ReactJs
- TypeScript
- Tailwindcss
- Radix
- Axios
MOBILE:
- React-Native
- Expo
- TypeScript
- NativeWind
- Axios
Possui as funcionalidades de:
- Calendário interativo com identificação de dia atual;
- Identificação de conclusão de hábitos nos dias, quanto mais azul menos hábitos concluídos no dia;
- Possibilidade de criação de novos hábitos marcando os dias que o mesmo será monitorado;
- Edição (toggle) de hábitos por dia entre concluído e a concluir.
- Barra de progresso de hábitos por dia. Concluídos Vs a concluir.
![Imagens-Web](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/Imagens-Web.png?raw=true)
![Imagens-Mobile](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/Imagens-Mobile.png?raw=true)
Projeto foi realizado no NLW-Setup da Rocketseat.
<p align="center">
<a href="#license"><img src="https://img.shields.io/github/license/LivioAlvarenga/Nlw-Setup?color=ff0000"></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup/issues"><img src="https://img.shields.io/github/issues/LivioAlvarenga/Nlw-Setup" alt="issue app" /></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup"><img src="https://img.shields.io/github/languages/count/LivioAlvarenga/Nlw-Setup" alt="total amount of programming languages used in the project" /></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup"><img src="https://img.shields.io/github/languages/top/LivioAlvarenga/Nlw-Setup" alt="most used language in the projects" /></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup"><img src="https://img.shields.io/github/repo-size/LivioAlvarenga/Nlw-Setup" alt="repository size" /></a>
<p>
---
<a id="-vitrine-dev"></a>
## 📺 Vitrine Dev
| :placard: Vitrine.Dev | |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| :sparkles: Nome | **Gestão de Hábitos completa com NodeJs (Back-end), ReactJs (Front-end) e React-Native (Mobile)** |
| :label: Tecnologias | React-native, ReactJs, Expo, Prisma, Tailwindcss, NativeWind, NodeJs, JavaScript, TypeScript, HTML5, CSS3, Axios, SQLite3, Figma, Eslint, Prettier |
---
<a id="-tecnologias"></a>
## 🛠 Tecnologias
As seguintes ferramentas foram usadas na construção do projeto
<p align="center">
<a href= "https://html5.org/"><img alt="html 5 badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=E34F26&logo=HTML5&label=Markup Language&message=HTML5&color=E34F26"></a>
<a href= "https://developer.mozilla.org/pt-BR/docs/Web/CSS"><img alt="CSS 3 badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=1572B6&logo=CSS3&label=Style&message=CSS3&color=1572B6"></a>
<a href= "https://tailwindcss.com/"><img alt="Tailwind CSS badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=06b6d4&logo=Tailwind CSS&label=Style&message=Tailwind CSS&color=06b6d4"></a>
<a href= "https://www.javascript.com/"><img alt="JavaScript badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=F7DF1E&logo=JavaScript&label=Language&message=JavaScript&color=F7DF1E"></a>
<a href= "https://www.typescriptlang.org/"><img alt="TypeScript badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=3178c6&logo=TypeScript&label=Language&message=TypeScript&color=3178c6"></a>
<a href= "https://nodejs.org/en/"><img alt="Node.js badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=339933&logo=Node.js&label=Runtime Environment&message=Node.js&color=3139933"></a>
<a href= "https://reactjs.org/"><img alt="React badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=61dafb&logo=React&label=Framework&message=React&color=61dafb"></a>
<a href= "https://reactnative.dev/"><img alt="React Native badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=61dafb&logo=React&label=Framework&message=React Native&color=61dafb"></a>
<a href= "https://expo.dev/"><img alt="Expo badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=000020&logo=Expo&label=React tool&message=Expo&color=000020"></a>
<a href= "https://www.fastify.io/"><img alt="Fastify badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=000000&logo=Fastify&label=Framework&message=Fastify&color=000000"></a>
<a href= "https://axios-http.com/"><img alt="Axios badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=5a29e4&logo=Axios&label=HTTP Client&message=Axios&color=5a29e4"></a>
<a href= "https://www.prisma.io/"><img alt="Prisma badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=2d3748&logo=Prisma&label=ORM&message=Prisma&color=2d3748"></a>
<a href= "https://www.sqlite.org/index.html"><img alt="SQLite badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=003b57&logo=SQLite&label=Database&message=SQLite&color=003b57"></a>
<a href= "https://www.figma.com/file/QQXvJRUjgkMA1gHHh63rFw/Habits-(i)-(Community)?t=ZIPBAGYzdRufIN0g-0"><img alt="link projeto no figma" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=F24E1E&logo=Figma&label=Designer&message=Figma&color=F24E1E"></a>
<a href= "https://code.visualstudio.com/download"><img alt="vscode download" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=007ACC&logo=Visual Studio Code&label=IDE&message=Visual Studio Code&color=007ACC"></a>
<a href= "https://github.com/prettier/prettier"><img alt="code formatter prettier" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=F7B93E&logo=Prettier&label=Code Formatter&message=Prettier&color=F7B93E"></a>
<a href= "https://eslint.org/"><img alt="code standardization eslint" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=4B32C3&logo=ESLint&label=Code Standardization&message=ESLint&color=4B32C3"></a>
</p>
---
<a id="-instalação"></a>
## ⚙️ Instalações
### BACK-END | TypeScript - TSX - Fastify - Prisma - Zod
Criar pasta server dentro do projeto
```bash
mkdir server
cd server
```
Inicia um projeto e cria package.json
```bash
npm init -y
```
Instalar typescript na dependência de desenvolvimento
```bash
npm i typescript -D
# Cria tsconfig.json
npx tsc --init
```
Instalar TSX na dependência de desenvolvimento
```bash
# dependência tsx para compilar .ts para .js (node agora consegue rodar arquivos .ts)
npm i tsx -D
```
Instalar Zod na dependência de produção
```bash
# biblioteca de validação e tipagem TypeScript (https://zod.dev)
npm install zod
```
Instalar Fastify na dependência de produção | Cria rotas HTTP
```bash
npm i fastify
# cors é a segurança do backend, basicamente é quem esta autorizado a consumir dados no meu backend
npm i @fastify/cors
```
Instalando Prisma (ORM)
```bash
npm i prisma -D
npm i @prisma/client
```
Instalando gerador de diagrama para DB Prisma
```bash
npm i -D prisma-erd-generator @mermaid-js/mermaid-cli
# adicionar o código abaixo em schema.prisma
generator erd {
provider = "prisma-erd-generator"
}
```
Instalar Dayjs na dependência de produção
```bash
# biblioteca de manipulação de datas
npm install dayjs
```
### FRONT-END | ViteJs - ReactJs - TypeScript - Tailwindcss - Radix - Axios
Cria um projeto com ViteJs
```bash
npm create vite@latest
# Project name: » web | Select a framework: » React | Select a variant: » TypeScript
npm install
```
Instalando arquitetura Tailwindcss
```bash
npm install -D tailwindcss postcss autoprefixer prettier prettier-plugin-tailwindcss
# Criar arquivo .prettierrc.json na raiz do projeto
```
Criando tailwind.config.cjs
```bash
npx tailwindcss init -p
```
Editando tailwind.config.cjs
```bash
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
```
Adicionando configuração Tailwindcss em src/styles/global.css
```bash
@tailwind base;
@tailwind components;
@tailwind utilities
```
Instalando biblioteca de ícones Phosphor
```bash
npm install phosphor-react
```
Instalando faker para gerar números aleatórios
```bash
npm install @faker-js/faker
```
Instalar Dayjs na dependência de produção
```bash
# biblioteca de manipulação de datas
npm install dayjs
```
Instalar componentes do Radix
```bash
npm install @radix-ui/react-dialog
npm install @radix-ui/react-popover
npm install @radix-ui/react-checkbox
```
Instalar CLSX para criar condicionais em className
```bash
npm install clsx
```
Instalando biblioteca de Axios para comunicação Http
```bash
npm install axios
```
### MOBILE | React-Native - Expo - TypeScript - NativeWind - Axios
Instalando expo-cli globalmente
```bash
npm install -g expo-cli
# verificando a versão instalada
expo --version
```
Criar projeto React Native | Blank | TypeScript
```bash
npx create-expo-app mobile --template
# Choose a template: » Blank (TypeScript)
```
Instalando expo-font e font Inter do Google
```bash
npx expo install expo-font @expo-google-fonts/inter
```
Instalando biblioteca de navegação entre telas react-navigation
```bash
npm install @react-navigation/native
npx expo install react-native-screens react-native-safe-area-context
npm install @react-navigation/native-stack
```
Instalando react-native-reanimated para animações
```bash
npx expo install react-native-reanimated
# vá em babel.config.js e atualize os plugins
plugins: ["nativewind/babel", "react-native-reanimated/plugin"],
```
Instalando NativeWind no ambiente de produção (Tailwindcss em React-native)
```bash
npm install nativewind
```
Instalando arquitetura Tailwindcss
```bash
npm install -D tailwindcss prettier prettier-plugin-tailwindcss
# Criar arquivo .prettierrc.json na raiz do projeto
```
Criando tailwind.config.cjs
```bash
npx tailwindcss init
```
Editando tailwind.config.cjs
```bash
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./App.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
```
Editando babel.config.js
```bash
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: ["nativewind/babel"], // <=====
};
};
```
Criando types para className
```ts
// crie um arquivo em uma pasta @types/app.d.ts em src
// adicione no app.d.ts o script abaixo
/// <reference types="nativewind/types" />
```
Instalando biblioteca para ler imagens SGV
```bash
npx expo install react-native-svg
npm install -D react-native-svg-transformer
# Obs. tem que criar arquivo na raiz do projeto (metro.config.js)
```
Criando arquivo na raiz do projeto (metro.config.js)
```javascript
const { getDefaultConfig } = require("expo/metro-config");
module.exports = (() => {
const config = getDefaultConfig(__dirname);
const { transformer, resolver } = config;
config.transformer = {
...transformer,
babelTransformerPath: require.resolve("react-native-svg-transformer"),
};
config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== "svg"),
sourceExts: [...resolver.sourceExts, "svg"],
};
return config;
})();
```
Criando types para svg
```ts
// crie um arquivo em uma pasta @types/svg.d.ts em src
// adicione no svg.d.ts o script abaixo
declare module "*.svg" {
import React from "react";
import { SvgProps } from "react-native-svg";
const content: React.FC<SvgProps>;
export default content;
}
```
Instalando faker para gerar números aleatórios
```bash
npm install @faker-js/faker
```
Instalar Dayjs na dependência de produção
```bash
# biblioteca de manipulação de datas
npm install dayjs
```
Instalando biblioteca de Axios para comunicação Http
```bash
npm install axios
```
Instalar CLSX para criar condicionais em className
```bash
npm install clsx
```
---
<a id="-funcionalidades"></a>
## ⚙️ Funcionalidades
### Running the server back-end
```bash
# development (http://localhost:3000/) | tsx watch src/server.ts
cd server
npm run dev
```
### ORM Prisma back-end
```bash
cd server
# Criando BD prisma SQLite
npx prisma init --datasource-provider SQLite
# criando/atualizando as tabelas do BD no prisma
npx prisma migrate dev
# Enter a name for the new migration: » created tab Habits
# prisma studio (Verificar tabelas e realizar CRUD manual)
npx prisma studio
# ou
npx prisma studio -b firefox -p 5173
# -b firefox p/ especificar navegador
# -p 5173 p/ especificar porta
# ou
npm run db
# Gerando diagrama de banco de dados Prisma
npx prisma generate
# ou
npm run diagrama
# Criando Seed, lançamentos de dados para testes
npx prisma db seed
```
![diagrama db](https://raw.githubusercontent.com/LivioAlvarenga/Nlw-Setup/d38430aa86f096acba43d797c529d7c9fe8f932b/server/prisma/ERD.svg)
### Running the app mobile
```bash
cd mobile
npx expo start
# Iniciando com a cash limpa
npx expo start --clear
```
### Running the app web
```bash
cd web
npm run dev
```
---
<a id="-autor"></a>
## 🦸 Autor
Olá, eu sou Livio Alvarenga, Engenheiro de Produção | Dev Back-end e Front-end. Sou aficcionado por tecnologia, programação, processos e planejamento. Uni todas essas paixões em uma só profissão. Dúvidas, sugestões e críticas são super bem vindas. Seguem meus contatos.
- [www.livioalvarenga.com](https://livioalvarenga.com)
- contato@livioalvarenga.com
<p align="center">
<a href= "https://www.livioalvarenga.com/"><img alt="portifólio livio alvarenga" src="https://raw.githubusercontent.com/LivioAlvarenga/LivioAlvarenga/3109a24e71f07dbad193ae0ddbc43b69b39c7adf/files/badgePortifolioLivio.svg"></a>
<a href= "https://www.linkedin.com/in/livio-alvarenga-planejamento-mrp-engenheiro-produ%C3%A7%C3%A3o-materiais-vba-powerbi/"><img alt="perfil linkedin livio alvarenga" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=0A66C2&logo=LinkedIn&label=LinkedIn&message=Livio Alvarenga&color=0A66C2"></a>
<a href= "https://twitter.com/AlvarengaLivio"><img alt="perfil twitter livio alvarenga" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=1DA1F2&logo=Twitter&label=Twitter&message=@AlvarengaLivio&color=1DA1F2"></a>
<a href= "https://www.instagram.com/livio_alvarenga/"><img alt="perfil instagram livio alvarenga" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=E4405F&logo=Instagram&label=Instagram&message=@livio_alvarenga&color=E4405F"></a>
<a href= "https://www.facebook.com/profile.php?id=100083957091312"><img alt="perfil facebook livio alvarenga" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=1877F2&logo=Facebook&label=Facebook&message=Livio Alvarenga&color=1877F2"></a>
<a href= "https://www.youtube.com/channel/UCrZgsh8IWyyNrRZ7cjrPbcg"><img alt="perfil youtube livio alvarenga" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=FF0000&logo=YouTube&label=Youtube&message=Livio Alvarenga&color=FF0000"></a>
</p>
<p align="center">
<a href= "https://cursos.alura.com.br/vitrinedev/livioalvarenga"><img alt="perfil vitrinedev livio alvarenga" align="center" height="30" src="https://raw.githubusercontent.com/LivioAlvarenga/LivioAlvarenga/e0f5b5a82976af114d957c20f0c78b4d304a68a0/files/vitrinedev.svg"></a>
</p>
---
<a id="-licença"></a>
## 📝 Licença
Este projeto é [MIT licensed](./LICENSE).
##### _#CompartilheConhecimento_
| Gestão de Hábitos completa com NodeJs (Back-end), ReactJs (Front-end) e React-Native (Mobile) | css3,eslint,expo,fastify,figma,html5,javascript,nodejs,prettier,prisma-orm | 2023-01-17T14:25:37Z | 2023-01-23T13:56:19Z | null | 1 | 0 | 104 | 0 | 0 | 8 | null | MIT | TypeScript |
alicemirigo92/Awesome-book-ES6 | main | # Awesome-book ES6
<a name="Alice"></a>
<!--
HOW TO USE:
This is an example of how you may give instructions on setting up your project locally.
Modify this file to match your project and remove sections that don't apply.
REQUIRED SECTIONS:
- Table of Contents
- About the Project
- Built With
- Live Demo
- Getting Started
- Authors
- Future Features
- Contributing
- Show your support
- Acknowledgements
- License
OPTIONAL SECTIONS:
- FAQ
After you're finished please remove all the comments and instructions!
-->
<div align="center">
<!-- You are encouraged to replace this logo with your own! Otherwise you can also remove it. -->
<img src="logo.jpg" alt="logo" width="140" height="auto" />
<br/>
<h3><b>Microverse README Template</b></h3>
</div>
<!-- TABLE OF CONTENTS -->
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Usage](#usage)
- [Run tests](#run-tests)
- [Deployment](#triangular_flag_on_post-deployment)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ (OPTIONAL)](#faq)
- [📝 License](#license)
<!-- PROJECT DESCRIPTION -->
# 📖 [Awesome Books!] <a name="In this project we are able to create book list and manupulate them.I Used the ES6 syntax"></a>
> In this project i created book list that i used javascript to manupulate it
**[Awesome books!]** is a...
## 🛠 Built With <a name="built-with"></a>
Use HTML/CSS
Use basic JavaScript syntax.
Use JavaScript to manipulate DOM elements.
Use JavaScript events.
### Tech Stack <a name="tech-stack"></a>
> Describe the tech stack and include only the relevant sections that apply to your project.
<details>
<summary>Client</summary>
<ul>
<li><a href="https://reactjs.org/">React.js</a></li>
</ul>
</details>
<details>
<summary>Server</summary>
<ul>
<li><a href="https://expressjs.com/">Express.js</a></li>
</ul>
</details>
<details>
<summary>Database</summary>
<ul>
<li><a href="https://www.postgresql.org/">PostgreSQL</a></li>
</ul>
</details>
<!-- Features -->
### Key Features <a name="key-features"></a>
> Describe between 1-3 key features of the application.
- **[key_feature_1]**
- **[key_feature_2]**
- **[key_feature_3]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LIVE DEMO -->
## 🚀 Live Demo <a name="live-demo"></a>
- [Live Demo Link](https://alicemirigo92.github.io/Awesome-book-ES6/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- GETTING STARTED -->
## 💻 Getting Started <a name="getting-started"></a>
Getting Started
Cloning the project
Git clone
To get a local copy up and running follow these simple example steps.
### Prerequisites
In order to run this project you need:
<!--
Example command:
```sh
gem install rails
```
-->
### Setup
Getting Started
Cloning the project
Git clone
To get a local copy up and running follow these simple example steps.
<!--
Example commands:
```sh
cd my-folder
git clone git@github.com:myaccount/my-project.git
```
--->
### Install
Install this project with:
<!--
Example command:
```sh
cd my-project
gem install
```
--->
### Usage
To run the project, execute the following command:
<!--
Example command:
```sh
rails server
```
--->
### Run tests
To run tests, run the following command:
<!--
Example command:
```sh
bin/rails test test/models/article_test.rb
```
--->
### Deployment
You can deploy this project using:
<!--
Example:
```sh
```
-->
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- AUTHORS -->
## 👥 Authors <a name="authors"></a>
> Mention all of the collaborators of this project.
👤 **Author1**
- GitHub: [@githubhandle](https://github.com/alicemirigo92)
- Twitter: [@twitterhandle](https://twitter.com/GathoniMirigo)
- LinkedIn: [LinkedIn](www.linkedin.com/in/alice-mirigo)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- FUTURE FEATURES -->
## 🔭 Future Features <a name="future-features"></a>
> Describe 1 - 3 features you will add to the project.
- [ ] **[new_feature_1]**
- [ ] **[new_feature_2]**
- [ ] **[new_feature_3]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- CONTRIBUTING -->
## 🤝 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>
<!-- SUPPORT -->
## ⭐️ Show your support <a name="support"></a>
> Write a message to encourage readers to support your project
If you like this project...
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- ACKNOWLEDGEMENTS -->
## 🙏 Acknowledgments <a name="acknowledgements"></a>
> According to the requirement, i acknowledge Cindy Shin the author of the original design, as required by the Creative Commons License.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- FAQ (optional) -->
## ❓ FAQ (OPTIONAL) <a name="faq"></a>
> Add at least 2 questions new developers would ask when they decide to use your project.
- **[Question_1]**
Does this help me solve my current problems?
- [Answer_1]
If you need to understand about conf pages you are in the right place.
- **[Question_2]**
- [Answer_2]
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
## 📝 License <a name="license"></a>
This project is [MIT](./LICENSE) licensed.
_NOTE: we recommend using the [MIT license](https://choosealicense.com/licenses/mit/) - you can set it up quickly by [using templates available on GitHub](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository). You can also use [any other license](https://choosealicense.com/licenses/) if you wish._
<p align="right">(<a href="#readme-top">back to top</a>)</p>
| Bookstore is a website that allows one to Display a list of books, Add a book and Remove a selected book. It's built using React and Redux, and connect to an API. | html,javascript | 2023-01-23T19:33:15Z | 2023-01-26T09:08:36Z | null | 1 | 1 | 9 | 0 | 0 | 8 | null | MIT | CSS |
ritikrana0169/Paytm-Mall | main | # congo-cart
A Frontend project created using HTML, CSS, JavaScript. E-commerce Website where you can get the cashback cards.
Sign in SignUp
![signin](https://user-images.githubusercontent.com/99540875/213917048-2fe6f8df-ea21-4734-b087-355b53cb4352.png)
Landing Page Of Website
![Screenshot 2023-01-21 220505](https://user-images.githubusercontent.com/99540875/213877193-9c72edd7-fd66-4119-bd95-39d1dcf8d857.png)
Product Page overview.
![git2](https://user-images.githubusercontent.com/99540875/213916814-f188fa83-8693-4b76-b278-b3e5ce0bf3bd.png)
cart page overview
![cartpage](https://user-images.githubusercontent.com/99540875/213916887-a60e6e39-c8a1-4d8f-905e-ff3e406fa5e5.png)
| A Frontend project created using HTML, CSS, JavaScript. E-commerce Website where you can get the cashback cards. | css,html,javascript,localstorage | 2023-01-17T14:05:08Z | 2023-12-31T18:34:14Z | null | 2 | 6 | 90 | 0 | 0 | 8 | null | null | HTML |
efraimnabil/Your-Links-extension | main | # Your-Links-extension
<p align = "center">
<img width = "350" src="images/Your-Links.png">
</p>
Your-Links is a Chrome extension that allows you to save your favorite links and taps in a simple and easy way.
## Installation
- First clone the repository
```bash
git clone https://github.com/efraimnabil/Your-Links-extension.git
```
- Then open the extension page in chrome by typing `chrome://extensions/` in the address bar.
- Enable the developer mode in the top right corner.
- Click on `Load unpacked` and select the folder of the project.
- Now you can use the extension.
## Usage
Click on the extension icon to open the extension
- Type a link and click `Save` to save it.
- Click on `Save Tap` to save the current tab.
- Click on `Delete All` to delete all the saved links.
- Click on `Delete` to delete a specific link.
- Click on `rename` to rename a specific link.
- Sort the links by the priority by drag and drop. | Chrome extension helps to save links | chrome-extension,javascript | 2023-01-19T19:03:23Z | 2023-06-06T10:33:51Z | null | 1 | 0 | 24 | 0 | 0 | 8 | null | null | JavaScript |
mwismann/mwismann.github.io | main | <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)
- [🚀 Live Demo](#live-demo)
- [Loom Walkthrough](#loom-walk)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Usage](#usage)
- [Run tests](#run-tests)
- [Deployment](#triangular_flag_on_post-deployment)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [📝 License](#license)
# 📖 [microverse-portfolio-project] <a name="about-project"></a>
**[microverse-portfolio-project]** is an exercise in which I set up a new Github repo, added files and configured code linters before ensuring that the git/github flows worked as expected. Then I proceeded to style the content focusing on a mobile-first approach, based on a Figma template.
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
<details>
<summary>Client</summary>
<ul>
<li>HTML</li>
<li>CSS</li>
</ul>
</details>
<details>
<summary>Server</summary>
<ul>
<li>No server was used in this project.</li>
</ul>
</details>
<details>
<summary>Database</summary>
<ul>
<li>No database was used in this project.</li>
</ul>
</details>
### Key Features <a name="key-features"></a>
- **[Correct set up of git / github flows.]**
- **[The creation and addition of HTML and CSS files.]**
- **[Mobile-first styling based on a Figma template.]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🚀 Live Demo <a name="live-demo"></a>
- https://mwismann.github.io/
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## Loom Walkthrough <a name="loom-walk"></a>
- https://www.loom.com/share/2fb47dae52184ce6abac625fbf1eab3a
<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
- You don't need any previous installation in order to run this project
### Setup
Clone this repository to your desired folder:
```sh
cd my-folder
git clone git@github.com:mwismann/microverse-portfolio-project.git
```
### Install
- This is not an installable project
### Usage
- There's no command required to run the project
### Run tests
- There's no test for this project
### Deployment
- This is not a deployable project
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 👥 Authors <a name="authors"></a>
👤 **Mathias Wismann**
- GitHub: [@mwismann](https://github.com/mwismann)
- Twitter: [@mathias_wismann](https://twitter.com/mathias_wismann)
- LinkedIn: [Mathias Wismann](https://linkedin.com/in/mathías-wismann-bertolucci-8812a4194/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🔭 Future Features <a name="future-features"></a>
- **[Enrichment of the project with content sections]**
- **[Project screenshots as references]**
- **[Desktop version]**
<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 you can share it and mention me.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thank to Microverse for providing me the opportunity and inspiration for this code.
<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>
| This is a responsive website emulating a portfolio. The works are dynamically displayed in a grid with JavaScript. Users can interact with each work to display a pop-up window with details about them. | css,html,javascript | 2023-01-23T19:49:56Z | 2023-02-08T22:48:45Z | null | 4 | 9 | 48 | 0 | 0 | 8 | null | MIT | CSS |
ashmalzahra/Awesome-books-with-ES6 | master | <a name="readme-top"></a>
<!-- TABLE OF CONTENTS -->
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Install](#install)
- [Usage](#usage)
- [Run tests](#run-tests)
- [👥 Authors](#authors)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ (OPTIONAL)](#faq)
- [📝 License](#license)
<!-- PROJECT DESCRIPTION -->
# 📖 [Awesome books ES6] <a name="about-project"></a>
In this project, Awesome books App code has been restructured. The goal is to make it more organized by using modules and practice ES6 syntax.
## Built With
- HTML, CSS, JavaScript
- VSCode
### Tech Stack <a name="tech-stack"></a>
<details>
<summary>Client</summary>
<ul>
<li><a href="https://www.javascript.com/">JavaScript</a></li>
</ul>
<ul>
<li><a href="https://html.com/">Html</a></li>
</ul>
<ul>
<li><a href="hhttps://www.w3schools.com/css/">CSS</a></li>
</ul>
</details>
<details>
<summary>Server</summary>
<ul>
<li><a href="#">N/A</a></li>
</ul>
</details>
<details>
<summary>Database</summary>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage">LocalStorage</a></li>
</ul>
</details>
<!-- Features -->
### Key Features <a name="key-features"></a>
- **[Git Flow]**
- **[Good HTML, CSS and JS practices]**
- **[ES6, modules]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## Live Demo
[Live Demo Link](https://ashmalzahra.github.io/Awesome-books-with-ES6/#books)
<!-- GETTING STARTED -->
## 💻 Getting Started <a name="getting-started"></a>
Clone this repository to get started with the project, make sure to configure linters by following the instructions in the [Linters README file](https://github.com/microverseinc/linters-config/blob/master/README.md)
### Setup
- Clone the folder to your local machine.
- Open the index.html file in your browser.
### Run tests
- After pushing the changes on github, merge your pull request and let github action process changes and fix errors, if any.
- For stylelint errors run:<code>sudo npx stylelint "**/*.{css,scss}" --fix</code> for automatic fix.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
### Usage
To run the project, execute the following command:
- Go to the file called index.html.
- Right click Open Live Server.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- AUTHORS -->
## 👥 Authors <a name="authors"></a>
👤 **Ashmal Zahra**
- GitHub: [ashmalzahra](https://github.com/ashmalzahra)
- Twitter: [AshmalZahraa](https://twitter.com/AshmalZahraa)
- LinkedIn: [ashmal-zahra](https://www.linkedin.com/in/ashmal-zahra-35bb09242/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- CONTRIBUTING -->
## 🤝 Contributing <a name="contributing"></a>
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](https://github.com/ashmalzahra/Awesome-books-with-ES6/issues).
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- SUPPORT -->
## ⭐️ Show your support <a name="support"></a>
Give a ⭐️ if you like this project!
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- ACKNOWLEDGEMENTS -->
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thank Microverse for the information provided to build this project.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- FAQ (optional) -->
## ❓ FAQ (OPTIONAL) <a name="faq"></a>
- **Can I use the project for any purpose?**
- Yes, you can.
- **Is the information saved in any database?**
- No, all data is saved in Local Storage.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
## 📝 License <a name="license"></a>
This project is [MIT](./LICENSE) licensed.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
| "Awesome books" is a simple website that displays a list of books and allows you to add and remove books from that list. The project has been restructured to make it more organized by using modules and practice the ES6 syntax. A medium-fidelity wireframe has been used to build the UI. Built with HTML, CSS, JavaScript ES6. | best-practices,es6-modules,html-css,javascript,npm-package | 2023-01-17T15:22:59Z | 2023-04-13T22:19:30Z | null | 1 | 1 | 26 | 0 | 0 | 8 | null | MIT | JavaScript |
Mahiuha/alx-frontend-javascript | master | # Web Stack Specialization - Front-end
![Holberton logo](https://www.alxafrica.com/wp-content/uploads/2022/01/header-logo.png)
> Web Stack - Front-end
## Description:bulb:
* Advanced HTML/CSS
* Developer Tools
* SCSS
* Flexbox
* Responsive Design
* Accesibility
* Working with Designers
* Design Implementation
* Bootstrap
* Advanced Javascript
* Advanced JQuery
* Cookies & Local Storage
* ES6
* TypeScript
* Webpack
* Building Portfolio Applications
## Technologies & Tools:computer:
![NPM](https://img.shields.io/badge/≡-NPM-CB3837?&style=flat-square&logo=npm&logoColor=CB3837&labelColor=282828)
![Git](https://img.shields.io/badge/≡-Git-F05032?logo=git&style=flat-square&labelColor=282828)
![Figma](https://img.shields.io/badge/≡-Figma-F24E1E?logo=Figma&style=flat-square&labelColor=282828)
![HTML5](https://img.shields.io/badge/≡-HTML5-E34F26?&style=flat-square&logo=html5&labelColor=282828)
![Ubuntu](https://img.shields.io/badge/≡-Ubuntu-E95420?&style=flat-square&logo=Ubuntu&labelColor=282828)
![JavaScript](https://img.shields.io/badge/≡-JavaScript-F7DF1E?logo=javascript&style=flat-square&labelColor=282828)
![GNU_Bash](https://img.shields.io/badge/≡-GNU_Bash-4EAA25?logo=GNU-Bash&style=flat-square&labelColor=282828)
![Node.js](https://img.shields.io/badge/≡-Node.js-339933?logo=Node.js&style=flat-square&labelColor=282828)
![Vim](https://img.shields.io/badge/≡-Vim-019733?logo=Vim&style=flat-square&logoColor=019733&labelColor=282828)
![Pop!_OS](https://img.shields.io/badge/≡-Pop!_OS-48B9C7?logo=Pop_OS&style=flat-square&labelColor=282828)
![VS_Code](https://img.shields.io/badge/≡-VS_Code-007ACC?logo=visual-studio-code&style=flat-square&logoColor=007ACC&labelColor=282828)
![CSS3](https://img.shields.io/badge/≡-CSS3-1572B6?logo=CSS3&style=flat-square&logoColor=1572B6&labelColor=282828)
![jQuery](https://img.shields.io/badge/≡-jQuery-0769AD?logo=jQuery&style=flat-square&logoColor=0769AD&labelColor=282828)
![Bootstrap](https://img.shields.io/badge/≡-Bootstrap-7952B3?logo=Bootstrap&style=flat-square&labelColor=282828)
![GitHub](https://img.shields.io/badge/≡-GitHub-181717?logo=GitHub&style=flat-square&labelColor=282828)
![JSON](https://img.shields.io/badge/≡-JSON-000000?logo=JSON&style=flat-square&labelColor=282828)
---
## Author
* **Joseph Mahiuha** (@Mahiuha) - [<img src="https://img.shields.io/badge/Portfolio-20d6fe.svg?&style=plastic"/>](https://mahiuha.github.io/josephmahiuha/)
[<img src="https://img.shields.io/badge/Twitter-1DA1F2.svg?&style=plastic&logo=twitter&logoColor=white"/>](https://twitter.com/Joseph_Mahiuha)
[<img src="https://img.shields.io/badge/Linkedin-0A66C2.svg?&style=plastic&logo=linkedin&logoColor=white"/>](https://www.linkedin.com/in/joseph-mahiuha-498a52162/)
[<img src="https://img.shields.io/badge/GitHub-181717.svg?&style=plastic&logo=github&logoColor=white"/>](https://github.com/Mahiuha)
| alx-frontend-javascript | babel,eslint,jest,nodejs,javascript | 2023-01-18T18:24:56Z | 2023-01-31T02:47:25Z | null | 1 | 54 | 170 | 3 | 9 | 8 | null | null | JavaScript |
IryDev/tinder-clone-template | main | # Astro Starter Kit: Basics
```sh
npm create astro@latest -- --template basics
```
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)
## 🚀 Project Structure
Inside of your Astro project, you'll see the following folders and files:
```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
Any static assets, like images, can be placed in the `public/` directory.
## 🧞 Commands
All commands are run from the root of the project, from a terminal:
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
## 👀 Want to learn more?
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
| ❤️❤️Tinder Clone Template using Astro Framework (frontend) | css,css3,dating-website,frontend,html,html5,javascript,navbar,tinder,tinder-clone | 2023-01-24T16:59:24Z | 2023-11-01T23:11:35Z | null | 1 | 0 | 7 | 0 | 1 | 8 | null | null | Astro |
0xCryptoAngel/CluckyChicks_NFT_App | master | # 🏗 CluckyChicks
> everything you need to build on Ethereum! 🚀
🧪 Quickly experiment with Solidity using a frontend that adapts to your smart contract:
# 🏄♂️ Quick Start
Prerequisites: [Node](https://nodejs.org/en/download/) plus [Yarn](https://classic.yarnpkg.com/en/docs/install/) and [Git](https://git-scm.com/downloads)
> clone/fork 🏗 scaffold-eth:
```bash
```
> install and start your 👷 Hardhat chain:
```bash
yarn install
```
> in a second terminal window, start your 📱 frontend:
```bash
yarn start
```
> in a third terminal window, 🛰 deploy your contract:
```bash
yarn deploy
yarn etherscan-verify --network rinkeby
```
🔏 Edit your smart contract `CluckyChicks.sol` in `./contracts`
💼 Edit your deployment scripts in `./deploy`
📱 Open http://localhost:3000 to see the app
# 🔭 Learning Solidity
📕 Read the docs: https://docs.soliditylang.org
📚 Go through each topic from [solidity by example](https://solidity-by-example.org) editing `YourContract.sol` in **🏗 scaffold-eth**
- [Primitive Data Types](https://solidity-by-example.org/primitives/)
- [Mappings](https://solidity-by-example.org/mapping/)
- [Structs](https://solidity-by-example.org/structs/)
- [Modifiers](https://solidity-by-example.org/function-modifier/)
- [Events](https://solidity-by-example.org/events/)
- [Inheritance](https://solidity-by-example.org/inheritance/)
- [Payable](https://solidity-by-example.org/payable/)
- [Fallback](https://solidity-by-example.org/fallback/)
📧 Learn the [Solidity globals and units](https://solidity.readthedocs.io/en/v0.6.6/units-and-global-variables.html)
# 🛠 Build
Check out all the [active branches](https://github.com/austintgriffith/scaffold-eth/branches/active), [open issues](https://github.com/austintgriffith/scaffold-eth/issues), and join/fund the 🏰 [BuidlGuidl](https://BuidlGuidl.com)!
- 🚤 [Follow the full Ethereum Speed Run](https://medium.com/@austin_48503/%EF%B8%8Fethereum-dev-speed-run-bd72bcba6a4c)
- 🎟 [Create your first NFT](https://github.com/austintgriffith/scaffold-eth/tree/simple-nft-example)
- 🥩 [Build a staking smart contract](https://github.com/austintgriffith/scaffold-eth/tree/challenge-1-decentralized-staking)
- 🏵 [Deploy a token and vendor](https://github.com/austintgriffith/scaffold-eth/tree/challenge-2-token-vendor)
- 🎫 [Extend the NFT example to make a "buyer mints" marketplace](https://github.com/austintgriffith/scaffold-eth/tree/buyer-mints-nft)
- 🎲 [Learn about commit/reveal](https://github.com/austintgriffith/scaffold-eth/tree/commit-reveal-with-frontend)
- ✍️ [Learn how ecrecover works](https://github.com/austintgriffith/scaffold-eth/tree/signature-recover)
- 👩👩👧👧 [Build a multi-sig that uses off-chain signatures](https://github.com/austintgriffith/scaffold-eth/tree/meta-multi-sig)
- ⏳ [Extend the multi-sig to stream ETH](https://github.com/austintgriffith/scaffold-eth/tree/streaming-meta-multi-sig)
- ⚖️ [Learn how a simple DEX works](https://medium.com/@austin_48503/%EF%B8%8F-minimum-viable-exchange-d84f30bd0c90)
- 🦍 [Ape into learning!](https://github.com/austintgriffith/scaffold-eth/tree/aave-ape)
# 💬 Support Chat
Join the telegram [support chat 💬](https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA) to ask questions and find others building with 🏗 scaffold-eth!
---
🙏 Please check out our [Gitcoin grant](https://gitcoin.co/grants/2851/scaffold-eth) too!
| NFT mint & Staking application based on Ethereum | ethereum,ethersjs,hardhat,javascript,react,smart-contract,solidity | 2023-01-21T13:53:58Z | 2022-06-11T13:36:00Z | null | 1 | 0 | 4 | 0 | 1 | 8 | null | MIT | JavaScript |
manuelbento19/port-scanner | main | <h1 align="center">
📑<br>Port Scanner - Manuel Bento
</h1>
![Resultado final do projeto](./public/preview.png)
---
## 💼 Tecnologias utilizadas
Para o desenvolvimento deste site utilizei as seguintes tecnologias:
- Node.js
- TypeScript
---
<h2>👨🚀 Autor</h2>
<table>
<tr>
<td>
<a href="https://github.com/manuelbento19">
<img src="https://avatars.githubusercontent.com/u/65732773" width="150px;" alt="Foto do Manuel Bento"/><br>
<sub>
<b>Manuel Bento</b>
</sub>
</a>
</td>
</tr>
</table> | Is a free and open-source network scanner. Is used to discover hosts and services on a computer network by sending packets and analyzing the responses. | cybersecurity,javascript,node,nodejs,typescript,network,scanner,scanning-tool,tcp,udp | 2023-01-18T14:40:40Z | 2023-01-19T12:05:19Z | null | 1 | 1 | 6 | 0 | 0 | 8 | null | null | TypeScript |
roniy68/to-do-list | master | <a name="readme-top"></a>
<div align="center">
<img src="readme-assets/murple_logo.png" alt="logo" width="140" height="auto" />
<br/>
<h3><b>Book List</b></h3>
</div>
<!-- TABLE OF CONTENTS -->
# 📗 Table of Contents
- [📗 Table of Contents](#-table-of-contents)
- [📖 to-do-list ](#-to-do-list--)
- [🛠 Built With ](#-built-with-)
- [Tech Stack ](#tech-stack-)
- [Key Features ](#key-features-)
- [🚀 Live Demo ](#-live-demo-)
- [💻 Getting Started ](#-getting-started-)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [Usage](#usage)
- [To check for css errors](#to-check-for-css-errors)
- [To check for html errors](#to-check-for-html-errors)
- [👥 Authors ](#-authors-)
- [🔭 Future Features ](#-future-features-)
- [🤝 Contributing ](#-contributing-)
- [⭐️ Show your support ](#️-show-your-support-)
- [🙏 Acknowledgments ](#-acknowledgments-)
- [Designed by :](#designed-by-)
- [Developed By:](#developed-by)
- [❓ FAQ ](#-faq-)
- [📝 License ](#-license-)
<!-- PROJECT DESCRIPTION -->
# 📖 to-do-list <a name="about-project"></a>
> This Project is to create to-do-list for our Resume
> <br><b> Module One day 2 Project [solo]</b>
**to-do-list** is a template to build your to-do-list website beautiful.
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
>HTML and CSS with JS
<details>
<summary>Client</summary>
<ul>
<li><a href="https://w3school.com/">HTML</a></li>
</ul>
</details>
<br>
### Key Features <a name="key-features"></a>
> THIS IS A SIMPLE TODO APP FOR NOW
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LIVE DEMO -->
## 🚀 Live Demo <a name="live-demo"></a>
> Deployed Link Below:
> soon will be available
- [Live Demo Link](https://roniy68.github.io/to-do-list/)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 💻 Getting Started <a name="getting-started"></a>
> An Book List website where Engineers from different fields collaborate together.
To get a local copy up and running, follow these steps.
### Prerequisites
In order to run this project you need:
- NODE
- ESlint set up
### Setup
- install node and eslint
```sh
npm install eslint
npx eslint --init
```
<br>
### Install
Install this project with:
Clone this repository to your desired folder:
commands:
```sh
git clone https://github.com/roniy68/to-do-list.git
cd to-do-list
npm install
npm start
```
<br><br>
### Usage
To run the project, execute the following command:
-install serve with : npm install -g serve
```sh
npm build && serve -s ./dist
```
# To check for css errors
```sh
npx stylelint "**/*.{css,scss}"
```
# To check for html errors
```sh
npx hint .
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- AUTHORS -->
## 👥 Authors <a name="authors"></a>
👤 **Ahmed Hasan Rony**
- GitHub: [@roniy68](https://github.com/roniy68)
- Twitter: [@ahroniy](https://twitter.com/ahroniy)
- LinkedIn: [LinkedIn](https://linkedin.com/in/ahroniy)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- FUTURE FEATURES -->
## 🔭 Future Features <a name="future-features"></a>
> 1 - 3 features I will add to the project.
- [ ] **javascript**
- [ ] **frontend**
- [ ] **backend**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- CONTRIBUTING -->
## 🤝 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>
<!-- SUPPORT -->
## ⭐️ Show your support <a name="support"></a>
> I need Support and Guidance to become a Developer.
If you like this project...
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- ACKNOWLEDGEMENTS -->
## 🙏 Acknowledgments <a name="acknowledgements"></a>
## Designed by :
>[Microverse](https://www.microverse.org) <br>
## Developed By:
> [`Ahmed Hasan Rony`](https://www.linkedin.com/in/ahroniy)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- FAQ (optional) -->
## ❓ FAQ <a name="faq"></a>
- **How you clone the repo?**
- git clone **\<repo name\>**
- **How you install node?**
- https://radixweb.com/blog/installing-npm-and-nodejs-on-windows-and-mac
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- LICENSE -->
## 📝 License <a name="license"></a>
This project is [MIT](./readme-assets/MIT.md) licensed.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
| Its A To-do-list App configured with webpack and created with es-6 module | css,es-6,html,javascript,webpack | 2023-01-20T15:31:17Z | 2024-01-09T18:18:04Z | null | 1 | 3 | 243 | 1 | 0 | 8 | null | NOASSERTION | JavaScript |
JoyceFatima/nlw-setup | main | <h1 align="center">
Gestão de Hábitos completa com NodeJs (Back-end), ReactJs (Front-end) e React-Native (Mobile)
</h1>
<p align="center">
<a href="#-sobre-o-projeto">Sobre</a> •
<a href="#-habits">Habits</a> •
<a href="#-tecnologias">Tecnologias</a> •
<a href="#-instalação">Instalações</a> •
<a href="#-funcionalidades">Funcionalidades</a> •
<a href="#-autor">Autor</a> •
<a href="#-licença">Licença</a>
</p>
![Capa](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/Monitor_laptop_Tablet_Celular-Fundos_limpos.png?raw=true#vitrinedev)
![Capa](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/cover.png?raw=true)
<a id="-sobre-o-projeto"></a>
## 💻 Sobre o projeto
🚀 Projeto fullstack de app de monitoramento de hábitos com calendário mostrando hábitos por dia com tonalidades de cores diferentes para identificar a conclusão de hábitos a cada dia. Possibilidade de criação e edição de conclusão de hábitos diariamente.
BACKEND:
- TypeScript
- TSX
- Fastify
- Prisma
- Zod
FRONTEND:
- ViteJs
- ReactJs
- TypeScript
- Tailwindcss
- Radix
- Axios
MOBILE:
- React-Native
- Expo
- TypeScript
- NativeWind
- Axios
Possui as funcionalidades de:
- Calendário interativo com identificação de dia atual;
- Identificação de conclusão de hábitos nos dias, quanto mais azul menos hábitos concluídos no dia;
- Possibilidade de criação de novos hábitos marcando os dias que o mesmo será monitorado;
- Edição (toggle) de hábitos por dia entre concluído e a concluir.
- Barra de progresso de hábitos por dia. Concluídos Vs a concluir.
![Imagens-Web](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/Imagens-Web.png?raw=true)
![Imagens-Mobile](https://github.com/LivioAlvarenga/Nlw-Setup/blob/master/files/Imagens-Mobile.png?raw=true)
Projeto foi realizado no NLW-Setup da Rocketseat.
<p align="center">
<a href="#license"><img src="https://img.shields.io/github/license/LivioAlvarenga/Nlw-Setup?color=ff0000"></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup/issues"><img src="https://img.shields.io/github/issues/LivioAlvarenga/Nlw-Setup" alt="issue app" /></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup"><img src="https://img.shields.io/github/languages/count/LivioAlvarenga/Nlw-Setup" alt="total amount of programming languages used in the project" /></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup"><img src="https://img.shields.io/github/languages/top/LivioAlvarenga/Nlw-Setup" alt="most used language in the projects" /></a>
<a href="https://github.com/LivioAlvarenga/Nlw-Setup"><img src="https://img.shields.io/github/repo-size/LivioAlvarenga/Nlw-Setup" alt="repository size" /></a>
<p>
---
<a id="-habits"></a>
| :sparkles: Habits | |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| :sparkles: Nome | **Gestão de Hábitos completa com NodeJs (Back-end), ReactJs (Front-end) e React-Native (Mobile)** |
| :label: Tecnologias | React-native, ReactJs, Expo, Prisma, Tailwindcss, NativeWind, NodeJs, JavaScript, TypeScript, HTML5, CSS3, Axios, SQLite3, Figma, Eslint, Prettier |
---
<a id="-tecnologias"></a>
## 🛠 Tecnologias
As seguintes ferramentas foram usadas na construção do projeto
<p align="center">
<a href= "https://html5.org/"><img alt="html 5 badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=E34F26&logo=HTML5&label=Markup Language&message=HTML5&color=E34F26"></a>
<a href= "https://developer.mozilla.org/pt-BR/docs/Web/CSS"><img alt="CSS 3 badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=1572B6&logo=CSS3&label=Style&message=CSS3&color=1572B6"></a>
<a href= "https://tailwindcss.com/"><img alt="Tailwind CSS badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=06b6d4&logo=Tailwind CSS&label=Style&message=Tailwind CSS&color=06b6d4"></a>
<a href= "https://www.javascript.com/"><img alt="JavaScript badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=F7DF1E&logo=JavaScript&label=Language&message=JavaScript&color=F7DF1E"></a>
<a href= "https://www.typescriptlang.org/"><img alt="TypeScript badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=3178c6&logo=TypeScript&label=Language&message=TypeScript&color=3178c6"></a>
<a href= "https://nodejs.org/en/"><img alt="Node.js badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=339933&logo=Node.js&label=Runtime Environment&message=Node.js&color=3139933"></a>
<a href= "https://reactjs.org/"><img alt="React badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=61dafb&logo=React&label=Framework&message=React&color=61dafb"></a>
<a href= "https://reactnative.dev/"><img alt="React Native badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=61dafb&logo=React&label=Framework&message=React Native&color=61dafb"></a>
<a href= "https://expo.dev/"><img alt="Expo badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=000020&logo=Expo&label=React tool&message=Expo&color=000020"></a>
<a href= "https://www.fastify.io/"><img alt="Fastify badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=000000&logo=Fastify&label=Framework&message=Fastify&color=000000"></a>
<a href= "https://axios-http.com/"><img alt="Axios badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=5a29e4&logo=Axios&label=HTTP Client&message=Axios&color=5a29e4"></a>
<a href= "https://www.prisma.io/"><img alt="Prisma badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=2d3748&logo=Prisma&label=ORM&message=Prisma&color=2d3748"></a>
<a href= "https://www.sqlite.org/index.html"><img alt="SQLite badge" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=003b57&logo=SQLite&label=Database&message=SQLite&color=003b57"></a>
<a href= "https://www.figma.com/file/QQXvJRUjgkMA1gHHh63rFw/Habits-(i)-(Community)?t=ZIPBAGYzdRufIN0g-0"><img alt="link projeto no figma" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=F24E1E&logo=Figma&label=Designer&message=Figma&color=F24E1E"></a>
<a href= "https://code.visualstudio.com/download"><img alt="vscode download" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=007ACC&logo=Visual Studio Code&label=IDE&message=Visual Studio Code&color=007ACC"></a>
<a href= "https://github.com/prettier/prettier"><img alt="code formatter prettier" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=F7B93E&logo=Prettier&label=Code Formatter&message=Prettier&color=F7B93E"></a>
<a href= "https://eslint.org/"><img alt="code standardization eslint" src="https://img.shields.io/static/v1?logoWidth=15&logoColor=4B32C3&logo=ESLint&label=Code Standardization&message=ESLint&color=4B32C3"></a>
</p>
---
<a id="-instalação"></a>
## ⚙️ Instalações
### BACK-END | TypeScript - TSX - Fastify - Prisma - Zod
Criar pasta server dentro do projeto
```bash
mkdir server
cd server
```
Inicia um projeto e cria package.json
```bash
npm init -y
```
Instalar typescript na dependência de desenvolvimento
```bash
npm i typescript -D
# Cria tsconfig.json
npx tsc --init
```
Instalar TSX na dependência de desenvolvimento
```bash
# dependência tsx para compilar .ts para .js (node agora consegue rodar arquivos .ts)
npm i tsx -D
```
Instalar Zod na dependência de produção
```bash
# biblioteca de validação e tipagem TypeScript (https://zod.dev)
npm install zod
```
Instalar Fastify na dependência de produção | Cria rotas HTTP
```bash
npm i fastify
# cors é a segurança do backend, basicamente é quem esta autorizado a consumir dados no meu backend
npm i @fastify/cors
```
Instalando Prisma (ORM)
```bash
npm i prisma -D
npm i @prisma/client
```
Instalando gerador de diagrama para DB Prisma
```bash
npm i -D prisma-erd-generator @mermaid-js/mermaid-cli
# adicionar o código abaixo em schema.prisma
generator erd {
provider = "prisma-erd-generator"
}
```
Instalar Dayjs na dependência de produção
```bash
# biblioteca de manipulação de datas
npm install dayjs
```
### FRONT-END | ViteJs - ReactJs - TypeScript - Tailwindcss - Radix - Axios
Cria um projeto com ViteJs
```bash
npm create vite@latest
# Project name: » web | Select a framework: » React | Select a variant: » TypeScript
npm install
```
Instalando arquitetura Tailwindcss
```bash
npm install -D tailwindcss postcss autoprefixer prettier prettier-plugin-tailwindcss
# Criar arquivo .prettierrc.json na raiz do projeto
```
Criando tailwind.config.cjs
```bash
npx tailwindcss init -p
```
Editando tailwind.config.cjs
```bash
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
```
Adicionando configuração Tailwindcss em src/styles/global.css
```bash
@tailwind base;
@tailwind components;
@tailwind utilities
```
Instalando biblioteca de ícones Phosphor
```bash
npm install phosphor-react
```
Instalando faker para gerar números aleatórios
```bash
npm install @faker-js/faker
```
Instalar Dayjs na dependência de produção
```bash
# biblioteca de manipulação de datas
npm install dayjs
```
Instalar componentes do Radix
```bash
npm install @radix-ui/react-dialog
npm install @radix-ui/react-popover
npm install @radix-ui/react-checkbox
```
Instalar CLSX para criar condicionais em className
```bash
npm install clsx
```
Instalando biblioteca de Axios para comunicação Http
```bash
npm install axios
```
### MOBILE | React-Native - Expo - TypeScript - NativeWind - Axios
Instalando expo-cli globalmente
```bash
npm install -g expo-cli
# verificando a versão instalada
expo --version
```
Criar projeto React Native | Blank | TypeScript
```bash
npx create-expo-app mobile --template
# Choose a template: » Blank (TypeScript)
```
Instalando expo-font e font Inter do Google
```bash
npx expo install expo-font @expo-google-fonts/inter
```
Instalando biblioteca de navegação entre telas react-navigation
```bash
npm install @react-navigation/native
npx expo install react-native-screens react-native-safe-area-context
npm install @react-navigation/native-stack
```
Instalando react-native-reanimated para animações
```bash
npx expo install react-native-reanimated
# vá em babel.config.js e atualize os plugins
plugins: ["nativewind/babel", "react-native-reanimated/plugin"],
```
Instalando NativeWind no ambiente de produção (Tailwindcss em React-native)
```bash
npm install nativewind
```
Instalando arquitetura Tailwindcss
```bash
npm install -D tailwindcss prettier prettier-plugin-tailwindcss
# Criar arquivo .prettierrc.json na raiz do projeto
```
Criando tailwind.config.cjs
```bash
npx tailwindcss init
```
Editando tailwind.config.cjs
```bash
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./App.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
```
Editando babel.config.js
```bash
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: ["nativewind/babel"], // <=====
};
};
```
Criando types para className
```ts
// crie um arquivo em uma pasta @types/app.d.ts em src
// adicione no app.d.ts o script abaixo
/// <reference types="nativewind/types" />
```
Instalando biblioteca para ler imagens SGV
```bash
npx expo install react-native-svg
npm install -D react-native-svg-transformer
# Obs. tem que criar arquivo na raiz do projeto (metro.config.js)
```
Criando arquivo na raiz do projeto (metro.config.js)
```javascript
const { getDefaultConfig } = require("expo/metro-config");
module.exports = (() => {
const config = getDefaultConfig(__dirname);
const { transformer, resolver } = config;
config.transformer = {
...transformer,
babelTransformerPath: require.resolve("react-native-svg-transformer"),
};
config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== "svg"),
sourceExts: [...resolver.sourceExts, "svg"],
};
return config;
})();
```
Criando types para svg
```ts
// crie um arquivo em uma pasta @types/svg.d.ts em src
// adicione no svg.d.ts o script abaixo
declare module "*.svg" {
import React from "react";
import { SvgProps } from "react-native-svg";
const content: React.FC<SvgProps>;
export default content;
}
```
Instalando faker para gerar números aleatórios
```bash
npm install @faker-js/faker
```
Instalar Dayjs na dependência de produção
```bash
# biblioteca de manipulação de datas
npm install dayjs
```
Instalando biblioteca de Axios para comunicação Http
```bash
npm install axios
```
Instalar CLSX para criar condicionais em className
```bash
npm install clsx
```
---
<a id="-funcionalidades"></a>
## ⚙️ Funcionalidades
### Executando o servidor back-end
```bash
# development (http://localhost:3000/) | tsx watch src/server.ts
cd server
npm run dev
```
### ORM Prisma back-end
```bash
cd server
# Criando BD prisma SQLite
npx prisma init --datasource-provider SQLite
# criando/atualizando as tabelas do BD no prisma
npx prisma migrate dev
# Enter a name for the new migration: » created tab Habits
# prisma studio (Verificar tabelas e realizar CRUD manual)
npx prisma studio
# ou
npx prisma studio -b firefox -p 5173
# -b firefox p/ especificar navegador
# -p 5173 p/ especificar porta
# ou
npm run db
# Gerando diagrama de banco de dados Prisma
npx prisma generate
# ou
npm run diagrama
# Criando Seed, lançamentos de dados para testes
npx prisma db seed
```
![diagrama db](https://raw.githubusercontent.com/LivioAlvarenga/Nlw-Setup/d38430aa86f096acba43d797c529d7c9fe8f932b/server/prisma/ERD.svg)
### Executando o aplicativo mobile
```bash
cd mobile
npx expo start
# Iniciando com a cash limpa
npx expo start --clear
```
### Executando o aplicativo web
```bash
cd web
npm run dev
```
---
<a id="-licença"></a>
## 📝 Licença
Este projeto é [MIT licensed](./LICENSE).
##### _#CompartilheConhecimento_
| Complete Habits Management with React (Front-end), React-Native (Mobile) and NodeJs (Back-end). | react,node,react-native,axios,css3,eslint,expo,fastify,figma,html5 | 2023-01-24T13:59:43Z | 2023-04-07T13:25:51Z | null | 1 | 2 | 11 | 0 | 1 | 8 | null | MIT | TypeScript |
P-Lrou/Eve | main | <div align="center">
![GitHub contributors](https://img.shields.io/github/contributors/P-Lrou/Projet-Jeu-2D)
![GitHub forks](https://img.shields.io/github/forks/p-Lrou/Projet-Jeu-2D)
![GitHub Repo stars](https://img.shields.io/github/stars/P-Lrou/Projet-Jeu-2D)
[![GitHub issues](https://img.shields.io/github/issues/P-Lrou/Projet-Jeu-2D)](https://github.com/P-Lrou/Projet-Jeu-2D/issues)
[![GitHub all releases](https://img.shields.io/github/downloads/P-Lrou/Projet-Jeu-2D/total?logo=github)](https://github.com/P-Lrou/Projet-Jeu-2D/archive/refs/heads/main.zip)
</div>
<!-- PROJECT LOGO -->
<br />
<div align="center">
<h3 align="center">Eve</h3>
<p align="center">
Eve is a web game made with p5.js who's currently in developpment.
<br />
<a href="https://github.com/P-Lrou/Projet-Jeu-2D"><strong>"Explore the docs"</strong></a>
<br />
<br />
<a href="https://github.com/P-Lrou/Projet-Jeu-2D/issues">Report Bug</a>
·
<a href="https://github.com/P-Lrou/Projet-Jeu-2D/issues">Request Feature</a>
</p>
</div>
<!-- ABOUT THE PROJECT -->
## About The Project
[![Product Name Screen Shot][product-screenshot]](https://example.com)
### Built With
- [![p5js](https://img.shields.io/badge/p5.js-ED225D?style=for-the-badge&logo=p5.js&logoColor=FFFFFF)](https://p5js.org/)
- [![Visual Studio Code](https://img.shields.io/badge/Visual%20Studio%20Code-0078d7.svg?style=for-the-badge&logo=visual-studio-code&logoColor=white)](https://code.visualstudio.com/)
<!-- GETTING STARTED -->
## Getting Started
This is an example of how you may give instructions on setting up your project locally.
To get a local copy up and running follow these simple example steps.
### Prerequisites
This is an example of how to list things you need to use the software and how to install them.
- Terminal or CMD
### Installation
1. Open Terminal
2. Clone the repo
```sh
git clone https://github.com/P-Lrou/Projet-Jeu-2D.git
```
<!-- CONTRIBUTING -->
## 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 a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
[contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
[forks-url]: https://github.com/github_username/repo_name/network/members
[stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
[stars-url]: https://github.com/github_username/repo_name/stargazers
[issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
[issues-url]: https://github.com/github_username/repo_name/issues
[license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
[license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/linkedin_username
[product-screenshot]: images/screenshot.png
[next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
[next-url]: https://nextjs.org/
[react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
[react-url]: https://reactjs.org/
[vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
[vue-url]: https://vuejs.org/
[angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
[angular-url]: https://angular.io/
[svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
[svelte-url]: https://svelte.dev/
[laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
[laravel-url]: https://laravel.com
[bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
[bootstrap-url]: https://getbootstrap.com
[jquery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
[jquery-url]: https://jquery.com
| Eve is a web game developed with the help of p5.js. | javascript,p5js | 2023-01-18T10:22:18Z | 2023-05-03T19:46:20Z | 2023-05-03T19:46:20Z | 3 | 3 | 41 | 0 | 0 | 8 | null | null | JavaScript |
Zid95/Greeny-eccomerce-django | main | # django-eccomerce
| Greeny-django-eccomerce online store using python programming language | api,css3,django,django-rest-framework,dummy-data,git,github,html5,javascript,jquery-ajax | 2023-01-20T22:34:57Z | 2023-06-10T21:39:09Z | null | 1 | 1 | 64 | 0 | 2 | 8 | null | null | Python |
kateFrontend/bs-english-course | main | # Study Me - landing page
![cover](.../../assets/demo.jpg)
View Demo <a href="https://study-me.netlify.app/" target="_blank">Study Me</a>
## 🦉 Main information
A one page site about an English language school Study Me in 2 languages - french and russian.\
This project was built with Bootstrap5.\
Official source https://getbootstrap.com/
## ⚡ Setup
Install Bootstrap in your html file
```
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
```
Install Bootstrap in Node.js
```
npm install bootstrap
```
| Landing page for an English language school built on Bootstrap5 | bootstrap,bootstrap5,bs5,javascript,landing,landing-page | 2023-01-23T18:31:03Z | 2023-01-24T20:37:40Z | null | 1 | 0 | 26 | 0 | 0 | 8 | null | null | HTML |
Miguel98R/project2Pug | main | <div align="center"><img src="public/img/logo.png" /></div>
<br>
<div align="center"><em>html template converter to templates with pug as view engine </em></div>
<br>
<br>
Set a folder where the files to be found will be to be the input directory, so set a folder for the output files
Example of directory paths to enter:
- Input directory : /home/mike98/Desktop/html_files
- Output Directory : /home/mike98/Desktop/pug_files
---
# Install
```
git clone https://github.com/Miguel98R/project2Pug.git
```
```
npm install
```
```
npm run dev
```
# Install by npm
can also install the converter by npm
command:
```
npm i -g project2_pug
```
start converter interface
command:
```
gui
```
example usage:
```
project2_pug gui
```
Then visit http://localhost:3008/*
*By default start on port 3008 , this can be modified in the index.js file
---
# Convert CLI mode
Also has the option to convert your html template to pug via CLI
command:
```
convert
```
options:
```
-i, --inDirectory <inDirectory...> location of the folder where the files to be converted are
-o, --OutDirectory <OutDirectory...> location of the folder where the converted files will be saved
```
example usage:
```
project2_pug convert -i "/home/mike98/Desktop/html_files" -o "/home/mike98/Desktop/pug_files"
```
install node modules and start the server in the output folder
command:
```
start_dev
```
example usage:
```
project2_pug start_dev
```
---
# Initializing template converted
Once you have converted the template, you will notice that a structure has been created for your project ,
an api-rest based on js express and a database connection in mongo db, this to help in the process of creating projects
Converted views to pug are located in the views folder and static/library files are located in the public folder
to initialize the project simply install the node modules and run the dev command
```
npm install
```
```
npm run dev
```
in the CLI section, the command to install the node modules and start the server in the output folder is shown
The project to be launched on port 3055 , this can be modified in the index.js of your output folder
Then visit http://localhost:3055 *
Note: if in your template static files are in an **assets** folder, this folder will be saved in the **public** folder just move the contents to the root of the **public** folder for your template to work properly
---
<h4 align="center">Mike Rosas © 2023 | project2Pug v1.0.9</h4>
<h4 align="center">Developed by: Jose Miguel Rosas Jimenez</h4>
| html template converter to templates with pug as view engine | html,nodejs,pug,bootstrap,expressjs,javascript,jquery,mongo,htmltopug | 2023-01-20T02:34:59Z | 2023-04-26T19:28:11Z | null | 3 | 0 | 58 | 0 | 1 | 8 | null | NOASSERTION | JavaScript |
IndySeh/40-javascript-essentials | main | <p align="center" >
<img width="200" height="200" src="https://user-images.githubusercontent.com/115108831/213843365-56fa4f2d-b9d5-4997-88bf-7eb59bb405bb.png">
</p>
# 40 JavaScript Essential Concepts (Updating the repo everyday)
If you're starting to learn Web Development, it's important to know the basics of JavaScript, but it can be hard to know where to start. That's where this collection of information comes in handy. This collection explains 40 of the most important concepts you need to know to become a good JavaScript programmer. It covers things like data types, variables, functions, and classes. If you understand these concepts, you'll be well on your way to mastering JavaScript.
Every concept covered in this repo has an Instagram Reel, please click on 🎬 in every heading.
## Table of Contents
* [Data types in JS](#types)
* [Call Stacks in JS](#stacks)
* [Primitive vs Reference types in JS](#ref-types)
* [== & === in JS](#equality)
* [Coercion in JS](#coercion)
* [Function and block scopes in JS](#scopes)
* [Nested Objects in JS](#nested)
* [function declaration vs function expression in JS](#function)
* [this, call, apply, bind in JS](#this)
* [JavaScript Engines](#engines)
* [Object.create( ) & Object.assign( ) in JS](#object-assign)
* [Object Deconstruction in JS](#deconstruction)
* [Default vs Named exports](#exports)
* [.map( ), reduce( ), filter( )](#maps)
* [the new operator](#new)
* [typeof, instanceof operator](#typeof)
* [Pure functions](#pure)
* [Higher-Order functions](#higher)
* [Side-Effects](#effects)
* [Spread Operator](#spread)
* [JavaScript Objects](#jsobjects)
* [Closures in JavaScript](#closures)
* [Memoizing in JavaScript](#memoization)
* [Objects vs Classes in JavaScript](#classesvsobjects)
* [Rest Parameters in JavaScript](#rest)
* [Rest Parameters in JavaScript](#rest)
* [JavaScript Classes](#classes)
* [Class Inheritance JavaScript Classes](#inheritance)
* [Encapsulation in JavaScript](#encapsulation)
* [Factory Functions in JavaScript](#factory)
<br/>
<br/>
## <a name='types'>Data types in JavaScript</a> <a href='https://www.instagram.com/reel/Cmf0v2FoCGU/?igshid=MDM4ZDc5MmU='>🎬</a>
#### Primitive Data Types
##### Number
Used to hold decimal value.
```js
x = 2
```
##### String
Used to hold sequence of characters.
```js
name = "Toronto Dev"
```
##### Undefined
Means value is not assigned.
```js
console.log(x) // Output to web console: undefined.
```
##### Boolean
A data type accepts true, false
```js
let isOn = true;
```
##### Null
A data type can only hold **null** value.
```js
let x = null;
console.log("Value of x" + x)
```
##### BigInt
Represents whole numbers larger than 2<sup>53</sup>-1.
```js
let number = BigInt(565656565656565656656565656565656565634)
```
##### Symbol
A built-in object whose constructor return a unique symbol.
```js
let symbol1 = Symbol()
let symbol1 = Symbol('baz')
let symbol1 = Symbol('baz')
```
Primitives types are **immutable** which means they cannot be modified after creation.
- These are stored by value
```js
let string = "who invented World Wide Web"
string = 'Sir Tim Berners-Lee' // We replaced the value of string variable
// However, We cannot ALTER only REPLACE, like the example below.
let string = 'Sir Tim Berners-Lee'
string[0] = 's' // Outpust -> 'Sir Tim Berners-Lee'
```
#### Non-Primitive Data types
These are the Data Types Derived from primitive Data.
##### Objects
A Javascript entity having properties and methods.
Everything in JS is an object.
```js
// Creating object with the name person
let person = {
firstName: "Toronto",
lastName: "Dev",
};
console.log(`${person.firstName} ${person.lastName}`)
```
##### Array
Collection of items stored at contiguous memory locations.
```js
// Empty array
var x = new array()
// Array with single numeric argument
var y = new array(10)
// Explicit values
var z = new Array(1, 3, "Toronto")
```
Non-primitive are **mutable**, these can be modified after creation.
- These are stored by the reference
```js
let arr = ['Toronto', 'Melbourne', 'New Delhi']
arr[1] = 'Sydney' // We are mutating the state of variable arr using index
```
#### The typeof operator
This operator returns a string that tells the type of js variable.
```js
typeof "G`day" // string
typeof 0 // number
typeof null // object
typeof 1n // BigInt
typeof true // boolean
typeof undefined // undfined
typeof Symbol("id") symbol
typeof {} // object
```
<br/>
<br/>
## <a name='stacks'>Call Stacks in JavaScript</a> <a href='https://www.instagram.com/reel/CmiKqgZI1br/?igshid=MDM4ZDc5MmU='>🎬</a>
A call stack is a mechanism for an interpreter (like the JS interpreter in a web browser) to keep **track** of its place in a script that calls *multiple functions* — what function is being currently run and what other functions are called within that function.
Every time you invoke a function, it gets added or *pushed* to the top of call stack. When the function returns, its removed or *popped* out of call stack. It is like a real stack in data structure where data is pushed and popped and follows the Last In First Out (LIFO) principle.
LIFO — When we say that the call stack follows the data structure principle of Last In, First Out (LIFO), it means that the last function that gets pushed into the stack is the first to be pop out, when the function returns.
#### Call Stacks example
```js
function greetings() {
sayHello();
}
function sayHello() {
return "Hello!";
}
// Call the function greetings()
greetings();
```
#### Step 1
![STEP1](https://user-images.githubusercontent.com/115108831/213942291-c819376d-713b-41d5-a097-9d7dd6a9f238.png)
###### Step 2
![2](https://user-images.githubusercontent.com/115108831/213942455-d708106b-71b6-42ed-988f-1bcb93cf75b4.png)
###### Step 3
![3](https://user-images.githubusercontent.com/115108831/213942468-f16fa931-b2e5-455d-ba8a-4aa95d7e0bc9.png)
###### Step 4
![4](https://user-images.githubusercontent.com/115108831/213942469-bf049a3f-2b70-485e-a171-3bebdb08ce35.png)
<br/>
<br/>
## <a name='ref-types'>Primitive vs Reference types in JavaScript</a> <a href='https://www.instagram.com/reel/CmlKFQ7q_Vd/?igshid=MDM4ZDc5MmU='>🎬</a>
#### Primitive types
- strings, numbers, booleans, undefined, BigInt, symbol and null.
- Stored by the value and hence also called Value Types
- Stored (in fixed amount of memory available) on a stack.
- With each primitive data type you create, data is added to the stack.
```js
let x = 5 // Assign `5` to `x`
let y = x // Copy the value of `x` to `y`
y = 55 // Assign `55`
console.log(x, y) // Value of => 5 and Value of y = 55
```
- When you set let y = x, it means new variable y with the value same value as x is created.
- updating one of them would not affect the other.
#### Reference Types
- arrays, functions, collections and other objects are dynamic in nature. It means they do not have a fixed size.
- Stored by the reference.
- When you create a variable and assign it a value that is a reference data type, the computer does not directly store that data type in that variable. Instead, a pointer is assigned that points to the location of that Data type in memory.
```js
// Assign the reference of a new object to `carOne`
let carOne = {
name: 'Tesla Model 3',
year: 2021,
color: 'White'
}
/* Copy the reference of the object
inside `carOne` to new variable `carTwo`*/
let carTwo = carOne
// Modify the contents of the object `carTwo`
CarTwo.name = 'Tesla Model S'
cosole.log(carOne) // This carOne.name ALSO changed.
// => {name: 'Tesla Model S',year: 2021, color: 'White'}
```
- In the Snipped above, we created another object carTwo and assigned it to carOne. Since the object already exists on the heap, carOne and carTwo will both point to the same object. And the moment, we modified carTwo.name, carOne.name had the same value since It is the same object.
<br/>
<br/>
## <a name='equality'>== & === in JavaScript</a> <a href='https://www.instagram.com/reel/CmnZoMvIrps/?igshid=MDM4ZDc5MmU='>🎬</a>
#### == double equals
- Double Equals (==) checks for value equality only.
- Before checking the values, it converts the types of the variables to match each other.
<br/>
<br/>
#### === triple-equals operator
- Also called "Strict equals" or identically equal.
- Verify whether the variables being compared have both the same value AND the same type.
<br/>
<br/>
```js
const foo = 'Polestar'
const baz = 'Polestar'
cosole.log(foo == baz) // => true
cosole.log(foo === baz) // => true
```
The value and the type of variable are both same. Hence, the result is `true` for both.
```js
const number = 1962
const stringNumber = '1962'
console.log(number == stringnumber) // => true
console.log(number === stringnumber) // => false
```
Even though values are same, the type is not the same. Hence, **==** return `true`, however **===** checked value and type both, returned `false`.
### When should you use == and when should you use === ?
- Always use 3 equals unless you have a good reason to use 2. This helps to maintain data type integrity throughout your code and save you multiple bugs in your code.
<br/>
<br/>
- Scenarios when an API accepts both "true" and true from the client, use ==. Otherwise === is the best approach.
<br/>
<br/>
## <a name='coercion'>Coercion in JS</a> <a href='https://www.instagram.com/reel/CmsrGwyoBoR/?igshid=MDM4ZDc5MmU='>🎬</a>
- Type coercion, type conversion, typecasting, and type juggling: all different names that refer to the process of converting one data type into another.
- Type coercion in JavaScript, coerces to the string, number, and Boolean primitive types.
- You can pass `number` where a `string` is expected and a `string` where a `boolean` is expected. JS will try to convert it to right type.
- It is best to **avoid** this JS feature
### JavaScript has two types of **coercions**
- Implicit Coercion
- Explicit Coercion
#### Implicit Coercion happens:
- When Javascript coerces the value type to expected behind the scenes, without developer noticing about it.
- When JavaScript operates in a wrong data type, it will try to convert the value to the right data type.
- Whenever we pass a different data type as an operand in a numeric expression using operators such as **`-, *, /, %`,** the conversion process is similar to calling the in-built Number function on the operand. If the conversion to number isn’t possible, NaN is returned.
- **Note**: The + operator works differently than the other numerical operators. It can work as both concatenation and numerical operator depending on the type of operand passed.
##### Example of Implicit Typecasting
```js
let x = 44
console.log(x + "")
//Output=> "44" as number 44 is converted into String
console.log("14" * 3)
//Output=> 42 , 14 string is converted into number.
cosole.log(99 + undefuined)
//Outout=> NaN, undefined could not be converted to num
console.log('16' + 5)
//Output=> 165,
console.log(null * 3)
//Output=>0, null is converted into 0.
console.log(5 * [6])
//Output=> [6] is converted into number
```
#### Explicit Coercion happens
When type conversion is explicitly done in the code by the developer using inbuilt methods for type conversion.
- String( ) method is used to convert any other data type value to string values.
```js
String(45) // => string "45"
String(true) // => string "true"
```
- Boolean( ) method used to convert any data type into Boolean
```js
Boolean(55) // => true
Boolean("") // => false
Boolean(" ")// => true
```
- Number ( ) method used to convert any data type to numeric value.
```js
Number("")// => 0, "" is converted into 0.
Number("122")//=> 122, string is converted into number
```
<br/>
<br/>
## <a name="scopes">Function and block scopes in JavaScript</a> <a href='https://www.instagram.com/reel/CmvXZ9jIg6K/?igshid=MDM4ZDc5MmU='>🎬</a>
There are 3 ways to declare variable in JS (ES6).
```js
var height = 10
let width = 300
const key = 'abc123
```
#### var -- function scope
Variable declared using `var` will ONLY exist within the scope of function it is declared in. **However**, var created outside a function is globally scoped.
```js
function ancientKing(){
var name = 'Porus'
console.log(name);
}
ancientKing() // Output=> Porus
// If we try console.log outide the function
console.log(name); //Output=> name is not defined
```
##### Please note:
Statements like if-statements, loops etc — will not be considered as a scope.
```js
if(true){
var name = 'Logan'
}
console.log(name)//Outout=> Logan
```
#### let and const -- block scope
Scope restricts the variable that is declared inside a specific block, from access by the outside of the block.
```js
{
let name = 'Logan'
const a = 59
}
console.log(name) //Uncaught ReferenceError: name is not defined
console.log(a) //Uncaught ReferenceError: a is not defined
if(true){
let color = 'blue'
}
console.log(color) //Uncaught ReferenceError: color is not defined
```
Above, we have used the let & const keyword to illustrate the block-level scope, in order to access the variable from outside of the block.
#### Using var can cause confusion
```js
var city = 'Toronto';
if (true) {
var city = 'Calgary';
console.log(city); // 'Calgary'
}
console.log(city); // 'Calgary'
```
In this scenario ‘Calgary’ will be printed in both places. This is because both variables are in the same scope, resulting in ‘Calgary’ overriding the first variable declaration.
##### Magic of let
```js
var city = 'Toronto';
if (true) {
let city = 'Calgary';
console.log(city); // 'Calgary'
}
console.log(city); // 'Toronto'
```
<br/>
<br/>
## <a name='nested'>Nested Objects</a> <a href='https://www.instagram.com/reel/CmxqJpjo_L5/?igshid=MDM4ZDc5MmU='>🎬</a>
- In application code, objects are often nested— an object might have another object as a property which in turn could have a property that’s an array of even more objects.
- These objects can be accessed through dot, bracket notations and object deconstruction.
- These nested objects are useful for storing the different properties and specifying the value based on user needs.
- If you are working with APIs, you would have to deal with nested objects. Hence, a developer must have a good understanding about the topic.
#### Example of a nested object
```js
const employeeInfo = {
employeeName: "Alan Turing",
employeeId: 45585,
salary: {
2021: "130000"
},
address: {
streetName: {
address1: "101 Queens Street
},
city: "Brisbane",
state: "Queensland",
country: "Australia"
}
}
```
##### We can access the data above using the following:
- Dot Notation
- Bracket Notation
- Object Destructuring
- Dot Notation: A property in an object is accessed by giving the object’s name, followed by a period, followed by the property name **(Example: employeeInfo.address)**
```js
console.log(employeeInfo.address.city)
// Output=> Brisbane
console.log(employeeInfo.employeeId)
// Output=> 45585
```
<br/>
##### Bracket Notation
The object name is followed by a set of square brackets, with the property name specified inside the brackets via either a string **(Example: employeeInfo['address']) or a variable (Example: employeeInfo['address'])**
```js
console.log(employeeInfo['employeeId'])
// Output=> 45585
console.log(employeeInfo['address']['state])
// Output=> Queensland
```
##### Destructuring the object
The destructuring assignment syntax allows you to unpack array values or object properties into different variables.
```js
const employeeInfo = {
employeeName: "Alan Turing",
employeeId: 45585,
salary: {
2021: "130000"
},
address: {
streetName: {
address1: "101 Queens Street"
},
city: "Brisbane",
state: "Queensland",
country: "Australia"
}
}
const {salary} = employeeInfo
console.log(salary) //Output=> {2021:'130000'}
const {address: {streetName} = {}} = employeeInfo
console.log(streetName) // { address1: "101 Queens Street"}
```
<br/>
<br/>
## <a name='function'>function declaration vs function expression in JS</a> <a href='https://www.instagram.com/reel/Cm-t3hSoKNt/?igshid=MDM4ZDc5MmU='>🎬</a>
#### function declaration
- Also known function statement, declares a function.
- A declared function is “saved for later use”, and will be executed later, when it is invoked (called).
- We can declare a function in JS using keyword **function**, followed by a name, followed by parentheses ().
```js
// Declaring a function, we can invoke anytime and anywhere in our program.
function sum(a, b) { // NOT INVOKED, just declared
return a + b
}
```
#### function expression
- A function expression is similar to a function declaration, however function expression can be stored in a variable.
```js
const sum = function (){
return a + b
}
```
- Functions stored in variables do not need function names(anonymous function). They are always invoked (called) using the variable name like **`const sum`** above.
- As soon as the function is defined with an expression, it is invoked.
- After a function expression has been stored in a variable, the variable can be used as a function in our code.
#### Difference Between function expressions & function declarations
- Function declarations are hoisted, while function expressions are not, which means you can call a **function** **declaration** before it is defined, but you cannot do this with a **function expression**.
- With **function expressions,** you can use a function immediately after it is defined. With **function declarations**, you have to wait until the entire script has been parsed.
- Function expressions can be used as an **argument** to another function, but function declarations cannot.
- Function expressions can be **anonymous**, while function declarations cannot.
## <a name='this'>this, call, apply, bind in JS</a> <a href='https://www.instagram.com/reel/CnGuCQmqpxX/?igshid=MDM4ZDc5MmU='>🎬</a>
#### this ( )
- In JavaScript, **this** always refers to an object.
- **this** refers to an object which calls the function it contains.
- In the global context **this** refers to either window object or is undefined if the ‘strict mode’ is used.
```js
var car = {
plateNumber: 'CEF158',
maker: 'Holden',
carDetails: function(){
console.log(this.plateNumber, this.maker)
}
}
car.carDetails() //Output `CEF158 Holden`
var vehicleOne = car.carDetails()
vehicleOne(); // THIS WONT WORK, and BIND () CAN MAKE IT WORK
```
#### Bind( )
- With the bind() method, an object can borrow a method from another object.
```js
var car = {
plateNumber: 'CEF158',
maker: 'Holden',
carDetails: function(){
console.log(this.plateNumber, this.maker)
}
}
car.carDetails() //Output `CEF158 Holden`
var vehicleOne = car.carDetails.bind(car)//Output `CEF158 Holden
```
##### Passing parameter in bind()
```js
var car = {
plateNumber: 'CEF158',
maker: 'Holden',
carDetails: function(color){
console.log(this.plateNumber, this.maker, color)
}
}
var vehicleOne = car.carDetails.bind(car, "Red")
vehicleOne() // `CEF158 Holden Red`
```
#### Call ( )
- With call(), an object can use a method belonging to another object.
```js
const vehicle = {
details: function () {
return this.make + " " + this.model
}
}
const car1 = {
make: 'Tesla',
model: 'Model X'
}
vehicle.details.call(car1)//Output => Tesla Model X
```
**Call ( ) can accept arguments as well**
```js
const vehicle = {
details: function (year) {
return this.make + " " + this.model + " " + year
}
}
const car1 = {
make: 'Polestar',
model: 'Polestar 2'
}
vehicle.details.call(car1, 2022) //Output => Polestar Polestar 2 2022
```
#### Apply( )
- With the apply( ) method, you can write a method that can be used on different objects. ( *Similar to the call( )* )
- The only **difference** between **call ( )** and **apply ( )**
- The call( ) method takes arguments separately.
- The** apply( )** method takes arguments as an array.
```js
const person = {
fullName: function(city, country) {
return this.firstName + " " + this.lastName + "," + city + "," + country;
}
}
const person1 = {
firstName:"John",
lastName: "Doe"
}
person.fullName.apply(person1, ["Oslo", "Norway"]);
//Output => John Doe, Osla, Norway
```
<br/>
<br/>
## <a name='engines'>JavaScript Engines</a> <a href='https://www.instagram.com/reel/CnYKcQVqedI/?igshid=MDM4ZDc5MmU='>🎬</a>
- A JavaScript engine is a program that interprets JavaScript code and translates it into a format that a computer can understand.
- The execution of JS code is done one line-by-line and objects and variables are created as needed.
- The main purpose of a JavaScript engine is to run the JavaScript code written by the developer, and to make sure the code is executed correctly.
- Some of the most common examples of JavaScript engines are:
- Google V8
- Microsoft Chakra
- Mozilla SpiderMonkey
- Apple JavaScriptCore.
#### Google V8
- Google's V8 JavaScript engine is a high performance, open source JavaScript engine developed by Google for use in its Chrome web browser.
- V8 compiles JavaScript code into native machine code instead of using an interpreter, resulting in improved performance. It can also be used to execute code outside of a browser through Node.js.
- It compiles JavaScript code into native machine code units, including functions and data. This compilation process is called **‘lazy compilation’**, because it only compiles code when it is needed. This improves performance, since it doesn't need to compile code that isn't used or needed.
- It also includes many performance optimizations to improve the speed of execution and reduce the amount of memory needed to run code. This includes advanced memory management, intelligent garbage collection and compiler optimizations that reduce the size of generated code.
#### Microsoft Chakra
- Microsoft Chakra is an open-source scripting engine designed for scripting in the Microsoft Windows environment. It is the common execution engine for JavaScript code in Microsoft Edge.
- It is designed for high-throughput, real-time performance and scalability to provide a responsive experience for users of Microsoft services such as Office, Windows, Bing, and Xbox.
- Chakra is also optimized to ensure efficient memory usage and fast startup up times. It has a number of advanced features such as Just-In-Time compilation, a powerful debugging infrastructure, a unique memory management technology, and advanced types of JIT optimizations.
- Microsoft Chakra is a great tool for creating performant, modern web applications and is a great choice for developers looking to develop powerful applications with better user experiences.
#### Mozilla SpiderMonkey
- SpiderMonkey is Mozilla’s open source JavaScript engine for web browsers.
- It is the foundation for Firefox, Mozilla’s popular web browser, and it is also used as a standalone JavaScript interpreter.
- SpiderMonkey has many features that make it attractive to developers. The language is designed to be extensible and can be used to create web applications with high performance.
- It has an efficient type system and provides APIs that can be used to modify JavaScript objects.
#### Apple JavaScriptCore
- Apple JavaScriptCore is a framework that is built into Apple's products, such as Safari and OS X.
- It is a JavaScript engine that is embedded in applications, meaning that it can interpret and execute JavaScript code.
- The JavaScriptCore framework works by taking JavaScript code and running it as a virtual machine. JavaScriptCore provides an intermediate representation of the code, which enables fast and efficient execution of the code.
- The use of the virtual machine helps improve performance, as the JavaScript code can be interpreted and optimized once it is in the virtual machine.
<br/>
<br/>
## <a name='object-assign'>Object.create( ) & Object.assign( ) in JS </a> <a href='https://www.instagram.com/reel/Cndqon-o9LK/?igshid=MDM4ZDc5MmU='>🎬</a>
#### Object.create( )
It is a method used to create an object from an existing object. It creates a new object and sets the newly created object’s prototype to the original object.
```js
/* Let's create a car object and use it as
prototype for our new object.*/
// create the original object
const Car = {
type: 'Sedan',
wheels: 4,
color: 'black',
engine: '2.4L'
};
// create a new object which uses Car as its prototype
const myCar = Object.create(Car);
// now myCar and Car share the same properties
console.log(myCar.type); // 'Sedan'
```
You can also use the Object.create( ) to assign the initial values of the new object.
```js
// create the original object
const Car = {
type: 'Sedan',
wheels: 4,
color: 'black',
engine: '2.4L'
};
// create a new object which uses Car as its prototype and sets the initial values
const myCar = Object.create(Car, {
mileage: {
value: 100
}
});
// now myCar has the same properties as Car plus the initial mileage value
console.log(myCar.mileage); // 100
```
#### Object.assign( )
Object.assign( ) is a method that is used to copy the values of all enumerable own properties from one or more source objects to a target object. It returns the target object.
```js
// Example 1
let object1 = {
a: 1,
b: 2
}
let object2 = {
c: 3,
d: 4
}
let object3 = Object.assign({}, object1, object2);
console.log(object3);
// Output: { a: 1, b: 2, c: 3, d: 4 }
```
```js
// Example 2
let object1 = {
a: 1,
b: 2,
c: {
d: 3
}
}
let object2 = Object.assign({}, object1);
console.log(object2);
// Output: { a: 1, b: 2, c: { d: 3 } }
```
<br/>
<br/>
## <a name="deconstruction">Object Deconstruction</a> <a href='https://www.instagram.com/reel/Cnn0oK0qqgp/?igshid=MDM4ZDc5MmU='>🎬</a>
- Destructuring is a JavaScript expression that allows us to extract data from arrays, objects, and maps and set them into new, distinct variables.
#### Syntax
```js
let{var1, var2} = {var1: val1,var2:val2}
variables Object
```
#### Examples
```js
const person = {
firstname: 'Bruce',
lastname: 'Wayne',
city: 'Gotham'
};
const { firstname, lastname, place } = person;
console.log( firstname, lastname, place);
// Output Bruce Wayne Gotham
```
#### Assign new variable names
Code below destructures the object into variables with a different name than the object property:
```js
const person = {
firstname: 'Bruce',
lastname: 'Wayne',
city: 'Gotham'
};
const { firstname: fName,
lastname: lName, city: loc } = person;
console.log( fName, lName, loc);
// Output Bruce Wayne Gotham
```
#### Assign to a variable with default values
We can also assign default values to variables whose keys may not exist in the object we want to destructure. This will prevent our variable from having an undefined value assigned to it.
```js
const person = {
firstname: 'Bruce',
lastname: 'Wayne',
};
const { firstname = 'Bruce',
lastname = 'Wayne',
city = 'Toronto' } = person;
console.log( firstname, lastname, city);
// Bruce Wayne Toronto
```
## <a name="exports">Default vs Named exports</a> <a href='https://www.instagram.com/reel/Cn6D3F9qZNn/?igshid=MDM4ZDc5MmU='>🎬</a>
#### Default vs Named exports in JS
- The **export** declaration is used to export values from a JavaScript module.
- Exported values can then be imported into other programs with the import declaration or dynamic import. this is done by adding **type="module"**
- A file can have not more than one default export, but it can have as many named exports as you like.
- There are two primary ways to export values in JS
- Default Export
- Named Export
#### Default Export
- Only one default export is allowed per file. When importing, a specific name must be provided and the import must be written in the following format:
```js
// my-module.js
function sayHello() {
console.log('Hello!');
}
export default sayHello;
// main.js
import sayHello from './my-module.js';
sayHello(); // 'Hello!'
```
#### Named Export
- Named exports allow for multiple exports from a single file.Specific exports can be imported by enclosing their names in curly braces.
- It is important to note that the name of the imported module has to match the name of the module being exported.
```js
import { myExport } from "/modules/my-module.js";
// You can import multiple names from the same module.
import { foo, bar } from "/modules/my-module.js";
// You can rename an export when importing it.
import { longModuleExportName as shortName }
from "/modules/my-module.js";
```
## <a name="maps">.map( ), .reduce( ), .filter( )</a> <a href='https://www.instagram.com/reel/CoG15Q9oVan/?igshid=MDM4ZDc5MmU='>🎬</a>
####
#### .map ( )
- The map( ) method creates a new array populated with the results of calling a provided function on every element in the calling array.
<br/>
- Map can be used when you want to perform an action on each element in a collection, and gather the results into a new array.
##### Examples
```js
// Use .map() to find the square of all elements in an array:
const numbers = [1, 2, 3, 4, 5];
const squares = numbers.map(num => num * num);
// Create a new array of objects using .map() and an array of data:
const data = [
{name: 'Alex', job: 'Engineer'},
{name: 'Bob', job: 'Doctor'}
];
const people = data.map((person, index) => {
const newPerson = {
id: index + 1,
name: person.name,
job: person.job
};
return newPerson;
});
```
#### .reduce( )
- reduce takes( ) an array and reduces it into a single value. For instance, with an array of numbers you can easily find the average of all values or calculate sum of array.
##### Examples
```js
//Example 1 - Sum All Items in an Array
const numbers = [2, 3, 5, 10];
const sum = numbers.reduce((total, amount)=> total + amount);
console.log(sum); // Output: 20
// Example 2 - Flatten an Array of Arrays
const flattened = [[0, 1], [2, 3], [4, 5]].reduce(
(accumulator, array) => accumulator.concat(array),
[]
);
console.log(flattened); // Output: [ 0, 1, 2, 3, 4, 5 ]
```
#### .filter ( )
- The filter( ) method creates a shallow copy of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function.
##### Examples
```js
// Filtering an array of numbers:
let numbers = [2, 4, 6, 8, 10];
let evenNumbers = numbers.filter(number => number % 2 === 0);
// evenNumbers will be [2, 4, 6, 8, 10]
// Filtering an array of objects:
let users = [
{name: 'John', age: 30},
{name: 'Jane', age: 25},
{name: 'Bob', age: 32},
{name: 'Sara', age: 20}
];
let adults = users.filter(user => user.age >= 18);
/* adults will be [{name: 'John', age: 30},
{name: 'Jane', age: 25},{name: 'Bob', age: 32}]*/
```
## <a name="new">The new operator</a> <a href='https://www.instagram.com/reel/CoTclNGoaBi/?igshid=MDM4ZDc5MmU='>🎬</a>
The new operator does 4 things:
- It creates a new, empty object.
- It adds a property onto our newly created object called “__proto__” which points to the constructor function’s prototype object.
- It binds this to our newly created object.
- It adds a return this to the end of the function, so that the object that is created is returned from the function.
#### Example
```js
function Person(name, age) {
this.name = name;
this.age = age;
}
//Invoke the Person constructor using new
var candidate = new Person('Logan', 28)
```
###### Behind the scenes after we run the above
- A new object is created — the candidate object.
- this is bound to our candidate object. So any references to this will point to candidate.
- Our __proto__ is added. candidate.__proto__ will now point to Person.prototype.
- After everything is done, our brand new candidate object is returned to our new candidate variable.
#### What is \__proto__
- It is an actual object that provides a way to inherit properties from JavaScript with the help of an object which is created with new. Every object with behavior associated has internal property [[prototype]].
Lets head to chrome dev tools and follow the steps below
```js
function Person(name, age) {
this.name = name;
this.age = age;
}
var candidate = new Person('Logan', 28)
// open console type
candidate
```
In ScreenShot below, Object have proto property
<img width="253" src="https://user-images.githubusercontent.com/115108831/216867503-84dd7ccd-7a78-4435-abeb-58f9f682d9fe.png">
## <a name="typeof">typeof, instanceof Operators </a> <a href='https://www.instagram.com/reel/CogO3JjqjDq/?igshid=MDM4ZDc5MmU='>🎬</a>
#### typeof
The typeof operator returns a string indicating the type of the operand's value. Mainly primitive values such as numbers, strings, symbols, booleans, bigint and undefined values.
```js
console.log(typeof 42);// Output: "number"
console.log(typeof 'blubber');// Output: "string"
console.log(typeof true);// Output: "boolean"
console.log(typeof undeclaredVariable);// "undefined"
```
Please note that it can’t be used to check for the **null type**.
```js
console.log(typeof null);// Output: Object
```
###### Why typeof(null) returns `Object`?
In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The type tag for objects was 0. null was represented as the NULL pointer (0x00 in most platforms). Consequently, null had 0 as type tag, hence the **typeof** return value "object".
#### instanceof
- instanceof checks the current object and returns true if the object is of the specified object type.
```js
// Syntax
object instanceof constructor
```
**Examples**
```js
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}
const auto = new Car('Tesla', 'Model 3', 2023);
console.log(auto instanceof Car);
// Expected output: true
console.log(auto instanceof Object);
// Expected output: true
```
- Anything Created with **new** can also Be Checked with the instanceof Operator
```js
let foo = new String('foo');
console.log(typeof foo);
console.log(foo instanceof String);
```
## <a name="pure">Pure functions </a> <a href='https://www.instagram.com/reel/Covh14kIhVb/?igshid=MDM4ZDc5MmU='>🎬</a>
- A Pure Function is a function that always returns the **same result** if the same arguments are **passed**.
- It does not depend on any **state** or data change during a program’s execution.
- It only depends on its input arguments.
- A pure function does not produce any observable side effects such as network requests or data mutation, etc.
#### Example
```js
function calculateFederalTax( itemPrice ) {
return itemPrice * 0.03;
}
console.log(calculateFederalTax(34))
```
- The above function is an example of **pure function**, It will always return the same value if we pass the same argument and Its output does not depend on anything else.
#### Please note the below function is not a pure function
```js
var specialTax = 0.10
function calculateFederalTax( itemPrice ){
return (itemPrice * 0.03) + specialTax;
}
console.log(calculateFederalTax(34))
```
- It is not a pure function as the output is dependent on an external variable “specialTax”.
- If specialTax updated, the output is going to be different even if the itemPrice is same.
## <a name="higher">Higher-Order functions </a> <a href='https://www.instagram.com/reel/CpDIAk6IyXB/?igshid=MDM4ZDc5MmU='>🎬</a>
- Higher order functions are functions that take other functions as arguments and/or return functions as output.
- These functions can be used to apply sequence of operations as well as for composition of expressions for evaluation.
- This ability to handle higher-order functions, among other characteristics, makes JavaScript one of the programming languages well-suited for functional programming.
#### Examples
##### map( )
- The map( ) method is a higher-order function in JavaScript that can be used to apply a function to every element in an array:
```js
const numbers = [2, 4, 6, 8];
const evenNumbers = numbers.map(number =>
number * 2);
console.log(evenNumbers);//Output: [4, 8, 12, 16]
```
#### filter( )
- The filter( ) method is another higher-order function in JavaScript that can be used to filter an array based on a condition.
```js
const numbers = [2, 4, 6, 8, 10];
const evenNumbers = numbers.filter(number
=> number % 2 == 0);
console.log(evenNumbers);//Output: [2, 4, 6, 8, 10]
```
## <a name='effects'>Side Effects in JavaScript</a> <a href='https://www.instagram.com/reel/CpT3BU2DZLi/?igshid=MDM4ZDc5MmU='>🎬</a>
- A side effect occurs in a program whenever you use an external code in your function—which, as a result, impacts the function's ability to perform its task.
#### Code in the snippet below has 3 side-effects.
```js
let x = 5;
function sum(y) {
return x += y;
}
```
##### Side-effect 1 - Dependency on x
- sum( ) depends on the value of x to return `x += y`, if the the x is not available, we would get an **Uncaught ReferenceError**.
```js
let x = 5;
function sum(y) {
return x += y;
}
```
##### Side-effect 2 - Modifies External Code
- sum( ) is changing the value of exteranl variable by adding `y`, hence, sum( ) has a side effect of manipulating external code.
##### Side-effect 3 - makes sum() non-deterministic function
- A non-deterministic function—as you can never determine its output by solely reading it.
## <a name='spread'>Spread operator (...) in JS</a> <a href='https://www.instagram.com/reel/CpoSp34o_kg/?igshid=YmMyMTA2M2Y='>🎬</a>
- The spread operator is a feature in the Javascript language that enables you to expand (or "spread") an array into a list of individual values.
- It is represented by three consecutive periods (...).
#### What `...` can do
- Copying an array
- Concatenating or combining arrays
- Using Math functions
- Using an array as arguments
#### Examples
**Copying an Array**
Using the spread operator, you can quickly make copies of an array without having to manually loop or push elements.
```js
const arr = [1, 2, 3];
const arrCopy = [...arr];
console.log(arrCopy) // [1,2,3]
```
**Array Concatenation**
The spread operator also enables you to quickly merge multiple arrays into one.
```js
const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];
const arr3 = [...arr1, ...arr2];
console.log([1, 2, 3, 4, 5, 6])
```
**Spread in function calls**
```js
function myFunction(x, y, z) {}
const args = [0, 1, 2];
myFunction(...args);
```
**Using Math functions**
One of the best ways to understand the use of spread operator in JavaScript is to look at the the built-in functions Math.min( ) and Math.max( ), which both expect a list of arguments, not an array.
```js
const numbers = [37, -17, 7, 0]
console.log(Math.min(numbers)) // NaN
console.log(Math.min(...numbers)) // -17
console.log(Math.max(...numbers)) // 37
```
## <a name='jsobjects'>JavaScript Objects</a> <a href='https://www.instagram.com/reel/Cp6azlkD97H/?igshid=YmMyMTA2M2Y='>🎬</a>
#### Example 1
Imagine you have a toy car with some properties like **color and speed**. In JavaScript, you can create an object called "**Car**" that has those same properties.
Here's some code for the Car object:
```js
let car = {
color: "red",
speed: 10,
move() {
console.log("The car is moving!");
}
};
```
In this object, we use the curly braces {} to create a container for the car's properties. We set the **color and speed** properties to "red" and 10, respectively. We also create a method called move( ) that logs a message to the console.
```js
console.log(car.color); // logs "red"
car.move(); // logs "The car is moving!"
```
#### Example 2
Now imagine you have a toy dog with some properties like **breed and age**. In JavaScript, you can create an object called **"Dog"** that has those same properties.
Here's some code for the Dog object:
```js
let dog = {
breed: "golden retriever",
age: 5,
bark() {
console.log("Woof!");
}
};
```
In this object, we set the **breed and age** properties to "golden retriever" and 5, respectively. We also create a method called bark( ) that logs a message to the console.
```js
console.log(dog.breed); // logs "golden retriever"
dog.bark(); // logs "Woof!"
```
#### Example 3
Imagine you have a toy phone with some properties like **brand and model**. In JavaScript, you can create an object called **"Phone"** that has those same properties.
Here's some code for the Phone object:
```js
let phone = {
brand: "Apple",
model: "iPhone 12",
ring() {
console.log("Ring ring!");
}
};
```
In this object, we set the **brand and model** properties to "Apple" and "iPhone 12", respectively. We also create a method called ring() that logs a message to the console.
```js
console.log(phone.model); // logs "iPhone 12"
phone.ring(); // logs "Ring ring!"
```
## <a name='closures'>Closures in JavaScript</a> <a href='https://www.instagram.com/reel/CqMuq6norDR/?igshid=YmMyMTA2M2Y='>🎬</a>
- Imagine you have a toy box with different toys inside. When you want to play with a toy, you open the box and pick the toy you want to play with. When you're done playing, you put the toy back in the box and close the lid.
- Now, let's say the toy box is like a function in JavaScript. When you call the function, it "opens" and you can access everything inside, like variables or other functions. When the function is done running, it "closes" and everything inside goes away. But what if you want to keep something from the function even after it's done running? That's where closures come in.
- A closure is like taking a toy out of the toy box and keeping it with you even after you close the lid. In JavaScript, a closure is when a function keeps access to variables from its outer scope, even after the function has returned.
### Example of Closure
```js
function createCounter() {
let count = 0;
return function() {
count++;
console.log(count);
};
}
let counter = createCounter();
counter(); // output: 1
counter(); // output: 2
```
- In this example, createCounter returns a function that keeps track of a count variable even after createCounter has finished running. When we call createCounter, it creates a new variable called count and returns a new function. We save that function in a variable called counter.
- When we call counter( ), it increments the count variable and logs the new value to the console. Because counter is a closure, it has access to the count variable even though createCounter has finished running.
### Closures in real-world scenarios
- Creating private variables and functions in JavaScript classes
- Memoizing expensive calculations to improve performance
- Handling asynchronous operations with callbacks
## <a name='memoization'>Memoizing in JavaScript</a> <a href=''>🎬</a>
- Memoizing is a fancy way of saying "remembering things" to save time later.
- Just like how you remember your mom's phone number or your friend's favorite color so you don't have to look it up every time.
- Let's say you have a fun game where you need to roll a dice and add up the numbers. But sometimes, you might need to add up the numbers multiple times. Instead of rolling the dice every time, you can memoize the result so that you don't have to roll it again.
### Example
```js
function add(x, y) {
console.log('Calculating...');
return x + y;
}
function memoize(fn) {
const cache = {};
return function(...args) {
const key = JSON.stringify(args);
if (cache[key]) {
return cache[key];
}
const result = fn(...args);
cache[key] = result;
return result;
}
}
const memoizedAdd = memoize(add);
console.log(memoizedAdd(2, 3));
// logs "Calculating..." and returns 5
console.log(memoizedAdd(2, 3));
// returns 5 without logging "Calculating..."
```
- In the example, we have an **add** function that simply adds two numbers together and logs "Calculating..." to the console.
- We also have a **memoize** function that takes any function as an argument and returns a memoized version of that function.
- We can use memoize to memoize the add function and avoid logging "Calculating..." more than once for the same arguments. The first time we call **memoizedAdd(2, 3)**, it logs "Calculating..." and returns 5. The second time we call memoizedAdd(2, 3), it returns 5 without logging "Calculating..." because the result is already cached in the cache object.
## <a name='classesvsobjects'>Objects vs Classes in JS</a> <a href='https://www.instagram.com/reel/Cqo2VR_Ibxr/?igshid=YmMyMTA2M2Y='>🎬</a>
#### JavaScript Objects
- Imagine you have a toy car and a toy truck. They are both toys, but they look different and have different features.
- In the same way, objects and classes in JavaScript are both things that can store information, but they are **different** from each other.
- An **object** is like a container that can hold different pieces of information, like a person's name, age, and favorite color. So, you can create an object called "person" and give it these properties:
```js
const person = {
name: "Sarah",
age: 5,
favoriteColor: "purple"
};
```
#### JavaScript Class
- A **class**, on the other hand, is like a blueprint for creating objects. It's like a set of instructions that tells you how to create objects with certain properties and methods.
- For example, you can create a class called "Animal" that has properties like "species" and "age" and methods like "eat" and "sleep".
```js
class Animal {
constructor(species, age) {
this.species = species;
this.age = age;
}
eat() {
console.log("I'm eating!");
}
sleep() {
console.log("I'm sleeping!");
}
}
```
Once you have a class, you can create objects that follow its blueprint by using the "new" keyword. For example:
```js
const cat = new Animal("cat", 3);
cat.eat(); // Output: "I'm eating!"
cat.sleep(); // Output: "I'm sleeping!"
```
## <a name='rest'>Rest Parameters in JavaScript</a> <a href='https://www.instagram.com/reel/Cq7Gn--IBb5/?igshid=YmMyMTA2M2Y='>🎬</a>
- Rest parameters in JavaScript are a feature that allows a function to accept an indefinite number of arguments as an array.
- This means that a function can take any number of arguments, and these arguments can be accessed as an array inside the function.
- The rest parameter is denoted by three dots `...` followed by the name of the parameter.
#### Example of Rest Parameter
A function that calculates the average of a set of numbers:
```js
function average(...numbers) {
let total = 0;
for (let i = 0; i < numbers.length; i++) {
total += numbers[i];
}
return total / numbers.length;
}
average(1, 2, 3); // returns 2
average(1, 2, 3, 4, 5); // returns 3
```
## <a name='classes'>JavaScript Classes</a> <a href='https://www.instagram.com/reel/Cre9TqsobOw/?igshid=YmMyMTA2M2Y='>🎬</a>
Imagine you have a social media app, and you want to create many user accounts for different people. A "Person" class can serve as a blueprint to create multiple user objects with similar properties and actions.
```js
class Person {
constructor(firstName, lastName, age, gender) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.gender = gender;
}
greet() {
console.log(`Hi, my name is ${this.firstName} ${this.lastName}!`);
}
postStatus(status) {
console.log(`${this.firstName} posted: "${status}"`);
}
addFriend(friend) {
console.log(`${this.firstName} added ${friend} as a friend!`);
}
}
// Creating person objects from the Person class
const person1 = new Person("John", "Doe", 18, "Male");
const person2 = new Person("Jane", "Smith", 17, "Female");
```
In this example, we've created two person objects, **`person1`** and **`person2`**, using the "Person" class. We passed in different values for **`firstName`**, **`lastName`**, **`age`**, and **`gender`** for each object.
Now, we can use these objects to access the properties and methods defined in the "Person" class:
```js
// Accessing properties and methods of person objects
console.log(person1.age); // Output: 18
console.log(person2.gender); // Output: "Female"
person1.greet(); // Output: "Hi, my name is John Doe!"
person2.postStatus("Feeling happy today!"); // Output: "Jane posted: 'Feeling happy today!'"
person1.addFriend(person2); // Output: "John added Jane as a friend!"
```
As you can see, we can use the "Person" class as a blueprint to create multiple person objects with similar properties and behaviors. Just like how you can create many user accounts in a social media app from the same blueprint, you can create many objects from the same class in JavaScript!
#### Scenarios for Classes
JavaScript classes are used in various scenarios where object-oriented programming (OOP) concepts are employed to structure code, create reusable components, and manage complex application logic. Some common scenarios where JavaScript classes are used include:
1. Creating UI components: JavaScript classes can be used to create UI components such as buttons, modals, forms, and sliders, where each component can have its own properties (e.g., size, color) and methods (e.g., event handling, animation).
2. Implementing data models: JavaScript classes can be used to define data models, such as representing a user, product, or order in an e-commerce application. Classes can define the properties and methods related to these data models, making it easier to create, manipulate, and manage data objects.
3. Managing application state: JavaScript classes can be used to represent the state and behavior of different parts of an application, such as managing the state of a game, a shopping cart, or a user session. Classes can help organize and encapsulate the logic related to managing the application state, making the code more modular and maintainable.
4. Implementing utility functions: JavaScript classes can be used to create utility functions, such as for handling date and time, managing network requests, or performing mathematical operations. Classes can encapsulate the logic and provide a clean and reusable way to implement utility functions throughout an application.
5. Building APIs and libraries: JavaScript classes can be used to define APIs and libraries that provide functionality to other parts of an application or to external developers. Classes can encapsulate complex logic, provide clear interfaces, and offer a convenient way for other developers to interact with the API or library.
6. Implementing design patterns: JavaScript classes can be used to implement various design patterns, such as the Singleton pattern, Factory pattern, or Observer pattern, which are common patterns used in software development to solve specific problems. Classes can provide a structured and organized way to implement these patterns.
In summary, JavaScript classes are used in scenarios where there is a need for reusable, organized, and structured code to create objects with similar properties and behavior, manage application state, implement utility functions, build APIs and libraries, and implement design patterns. Classes in JavaScript provide a powerful tool for object-oriented programming, allowing developers to write more modular, maintainable, and scalable code.
## <a name='inheritance'>Class Inheritance in JavaScript</a> <a href='https://www.instagram.com/reel/Cr4jgM6K76B/?igshid=YmMyMTA2M2Y='>🎬</a>
- Class inheritance is a concept in programming that allows you to create new classes based on existing ones.
- It's like creating a new type of animal by taking the characteristics of an existing one and modifying them.
- For example, let's say you have a class called **"Animal"** that has some properties like "name" and "age", as well as some methods like "eat" and "sleep". You can create a new class called **"Dog"** that inherits from **"Animal"** and adds some new properties and methods specific to dogs, such as "breed" and "bark".
```js
class Animal {
constructor(name, age) {
this.name = name;
this.age = age;
}
eat() {
console.log(`${this.name} is eating`);
}
sleep() {
console.log(`${this.name} is sleeping`);
}
}
class Dog extends Animal {
constructor(name, age, breed) {
super(name, age);
this.breed = breed;
}
bark() {
console.log(`${this.name} is barking`);
}
}
let myDog = new Dog("Rufus", 3, "Labrador");
console.log(myDog.name); // "Rufus"
console.log(myDog.age); // 3
console.log(myDog.breed); // "Labrador"
myDog.eat(); // "Rufus is eating"
myDog.sleep(); // "Rufus is sleeping"
myDog.bark(); // "Rufus is barking"
```
- In this example, we created a new class called **"Dog"** that extends the **"Animal"** class. The **"Dog"** class has a constructor that takes a name, age, and breed, and it calls the **"Animal"** constructor using the **"super"** keyword to set the name and age properties. It also has a new method called "bark" that prints out a message.
Using class inheritance can solve several problems in programming, such as:
- **Code Reusability:** By inheriting from an existing class, you can reuse code that has already been written and tested, rather than writing it from scratch. This can save time and reduce the chances of introducing bugs.
- **Modularity:** Inheritance allows you to create modular code by organizing related classes into a hierarchy of inheritance. This can help to simplify the management of code and make it easier to maintain and modify.
- **Polymorphism:** Inheritance enables polymorphism, which allows objects of different classes to be treated as if they were of the same type. This can be useful for creating flexible and extensible code.
## <a name='encapsulation'>Encapsulation in JavaScript</a> <a href='https://www.instagram.com/reel/Cr7a2XFgxiB/?igshid=NTc4MTIwNjQ2YQ=='>🎬</a>
- Imagine you have a toy box with different compartments for different toys. The toy box protects your toys from getting lost or damaged, and you can only access your toys through the compartments. That's what encapsulation does in programming.
- Encapsulation in JavaScript means that we can protect our data and code from being accessed or changed directly by other parts of our program.
- We achieve this by creating a "box" around our code and data that we only allow specific parts of our program to access.
```javascript
class BankAccount {
constructor(initialBalance) {
let balance = initialBalance;
this.deposit = function(amount) {
balance += amount;
};
this.withdraw = function(amount) {
if (balance >= amount) {
balance -= amount;
return amount;
} else {
return "Insufficient funds";
}
};
this.getBalance = function() {
return balance;
};
}
}
```
```js
const account = new BankAccount(1000);
account.deposit(500);
console.log(account.getBalance());
// Output: 1500
account.withdraw(2000);
console.log(account.getBalance());
// Output: Insufficient funds
```
- In this example, we have a `BankAccount` class that has three methods: `deposit`, `withdraw`, and `getBalance`. These methods all have access to a `balance` variable, but that variable is not accessible outside of the class. This means that the balance cannot be changed directly from outside of the class, protecting it from accidental or malicious changes.
#### Encapsulation scenarios
- Encapsulation is useful in scenarios where we want to protect our data from being changed directly, as well as in situations where we want to control how our data is accessed.
- For example, a user account system might use encapsulation to protect user data such as passwords and personal information from being accessed or changed by unauthorized parties.
- Another example might be a game object that uses encapsulation to protect its internal state and only expose certain properties or methods for other game objects to interact with.
## <a name='factory'>Factory Function in JS</a> <a href='https://www.instagram.com/reel/CskYxxRI0wj/?igshid=MzRlODBiNWFlZA=='>🎬</a>
- Imagine you want to create multiple cars in a game. Each car should have its own properties, like **color, speed, and model**. Instead of creating each car manually, a factory function helps us create cars easily.
- Let's create a factory function called "createCar" that takes in the color, speed, and model of a car as parameters. Inside the function, we'll create a new object and set its properties based on the parameters we received. Finally, we'll return this new car object.
```javascript
function createCar(color, speed, model) {
const car = {}; // Create a new object
// Set the properties of the car object
car.color = color;
car.speed = speed;
car.model = model;
// Return the car object
return car;
}
// Now, let's create two cars
const car1 =
createCar("blue", 200, "Sedan");
const car2 =
createCar("red", 180, "Sports Car");
console.log(car1);
// { color: 'blue', speed: 200, model: 'Sedan' }
console.log(car2);
// { color: 'red', speed: 180, model: 'Sports Car' }
```
- In this example, we defined a factory function called "createCar" that takes three parameters: color, speed, and model. Inside the function, we created a new object called "car" and set its properties based on the parameters. Then, we returned the car object.
- Using this factory function, we can easily create multiple cars by calling the function with different parameters. We created two cars, car1 and car2, with different colors, speeds, and models.
**Difference** between **factory functions and classes**.
- In JavaScript, classes are another way to create objects with similar properties and methods.
- While factory functions create objects directly and assign their properties individually, classes provide a blueprint for creating objects.
- Classes allow you to define methods that can be shared among all objects created from the class. This makes it easier to manage and organize code when you have many objects with similar behaviors.
#### Why use factory functions?
- factory functions are more flexible and lightweight. They allow you to create objects without the need for a constructor or prototypes. Factory functions are suitable when you want to create multiple objects with their own unique properties, without the need for shared methods.
- Here's a rule of thumb: if you need to create multiple objects with similar properties but different behaviors, factory functions are a good choice. If you want to create objects with shared behaviors and properties, classes are a better fit.
| This repo explains 40 of the most essential concepts that every developer should know to become a successful Javascript programmer. | front-end-development,javascript,web-development | 2023-01-21T03:24:34Z | 2023-05-23T02:18:39Z | null | 1 | 0 | 27 | 0 | 1 | 7 | null | null | null |
ramilabbaszade/Javascript-Interview-Questions-and-Simple-Answers | master | null | Javascript technical interview questions. Answers are simple and generated by ChatGPT 😉 | interview-questions,javascript,javascript-interview-questions,chatgpt,javascript-interview,js-interview-questions,interview,interview-preparation,javascript-interview-question | 2023-01-18T18:40:49Z | 2023-04-03T20:52:24Z | null | 1 | 0 | 9 | 0 | 3 | 7 | null | null | null |
Ghanishtkhurana/5mg | main | # Project Title
5 MG Healthcare & Product Website.
## Deployed link
### Vercel Link
[https://frontend-meenakshi176.vercel.app/](https://frontend-meenakshi176.vercel.app/)
![Logo](https://i.postimg.cc/B696yn9C/5mglogo-removebg-preview.png)
<h3 align="center">It's a Full Stack healthcare web application with all the major functionalities</h3>
<br/>
<h2 align="center">🖥️ Tech Stack</h2>
<h4 align="center">Frontend:</h4>
<p align="center">
<img src="https://img.shields.io/badge/React (18.2.0)-20232A?style=for-the-badge&logo=react&logoColor=61DAFB" alt="reactjs" />
<img src="https://img.shields.io/badge/Redux (4.2.0)-593D88?style=for-the-badge&logo=redux&logoColor=white" alt="redux" />
<img src="https://img.shields.io/badge/Chakra%20UI (2.2.8)-3bc7bd?style=for-the-badge&logo=chakraui&logoColor=white" alt="chakra-ui" />
<img src="https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E" alt="javascript" />
<img src="https://img.shields.io/badge/Rest_API-02303A?style=for-the-badge&logo=react-router&logoColor=white" alt="restAPI" />
<img src="https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge&logo=css3&logoColor=white" alt="css3" />
<img src="https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge&logo=html5&logoColor=white" alt="html5" />
</p>
<h4 align="center">Backend:</h4>
<p align="center">
<img src="https://img.shields.io/badge/Node.js (16.14.2)-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="nodejs" />
<img src="https://img.shields.io/badge/Express.js (4.18.1)-000000?style=for-the-badge&logo=express&logoColor=white" alt="expressjs" />
<img src="https://img.shields.io/badge/MongoDB (6.0)-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white" alt="mongodb" />
</p>
<h4 align="center">Deployed On:</h4>
<p align="center">
<img src="https://img.shields.io/badge/vercel-000000?style=for-the-badge&logo=vercel&logoColor=white" alt="vercel" />
</p>
<h3 align="center"><a href="https://frontend-meenakshi176.vercel.app/"><strong>Want to see live preview »</strong></a></h3>
Tata 1mg is India’s leading consumer health platform. It provides services, including e-pharmacy, diagnostics, e-consultation and health content.
<br/>
## 🚀 Features
- whole website is fully Responsive.
- Landing Page & Footer.
- Login and Signup Page with Express,mongodb,Nodejs & React.
- Product Filters Based on Brand and Discount
- Product Details in brief manner.
- Product Sorting Based on Price, Rating
- Product Filtering and Sorting works together
- Cart Add and Remove Items
- Cart Update Quantities
- Order Summary
## 🚀 Our Team Members:-
- Ghanisht Khurana [[LinkedIn Profile](https://www.linkedin.com/in/ghanisht-khurana-355b691b0/)] [[Github Profile](http://github.com/ghanishtkhurana/)]
- Meenakshi Singh Thakur [[LinkedIn Profile](https://www.linkedin.com/in/meenakshi-singh-thakur-8b60a5220/)] [[Github Profile](https://github.com/meenakshi176/)]
- Vivek Bhatt [[LinkedIn Profile](https://www.linkedin.com/in/vivek-bhatt-4a2835237/)] [[Github Profile](https://github.com/Vivek-bhatt05/)]
- Suman Sourav [[LinkedIn Profile](https://www.linkedin.com/in/suman-saurav-06896b231/)] [[Github Profile](https://github.com/sumansauravmay/)]
- Prateek Soni [[LinkedIn Profile](https://www.linkedin.com/in/prateek-soni-b354b012a/)] [[Github Profile](https://github.com/PRATEEK9425/)]
## Screenshots
### Homepage -
This is the main landing page of our website. Here, if you clicked on any navigation then you will redirect to respective page. Also, we have added searching of product option with debouncing feature.
All pages are responsive.
![landing_page](https://user-images.githubusercontent.com/105916064/213938491-d79b65a6-b0a2-4a2c-bb7d-db08ab181d91.png)
### Sign up Page -
On this page, you can register a user. If the user is already registered, you can simply sign in by providing valid details of the user.
![signup](https://user-images.githubusercontent.com/105916064/214049776-17fcbfcc-947e-46c9-b61a-22a84dcff769.png)
### Sign in Page -
On this page, you have to login with your registered email and password .you can simply sign in by providing valid details of the user.
![Login](https://user-images.githubusercontent.com/105916064/214049832-4efedc58-9bb6-4179-8ad0-b14f20869d26.png)
### Products Page -
Here users can browse, `filter` the product based on `brand and discound`, `sort` by `price or rating`, filter and sort will work togather and add items to the cart by clicking on the `Add to Cart` button.
![product](https://user-images.githubusercontent.com/105916064/213938969-0fdb0fa7-dac5-4d44-b285-53032655c9f8.png)
### Products Details Page -
![product_details](https://user-images.githubusercontent.com/105916064/213939243-1d874976-ce30-4f65-b4de-1714d7222bd8.png)
### Cart Page -
Here all the products added to the cart will be shown. On this page, By Clicking on add to cart your cart added successfully.
![cart](https://user-images.githubusercontent.com/105916064/213939230-fb8aa16b-b6e9-455b-8b14-d2c281a022ac.png)
### Order Summary Page -
On this page, you can see your order details. you can `remove` the item from cart and also, `increase` or `decrease` count. By clicking on the payment button you will be redirect to the checkout page.
![cart](https://user-images.githubusercontent.com/105916064/214049958-760780f2-99eb-405e-9d11-faac14e08416.png)
### Footer Page -
On This Page there is info about the site....
![footer](https://user-images.githubusercontent.com/105916064/214050102-eb35d759-ec57-490d-b45c-5cef8cfe056e.png)
## Run Locally
Clone the project
```bash
git clone https://github.com/Ghanishtkhurana/brief-toes-9591.git
```
Go to the project directory
```bash
cd brief-toes-9591
```
Install dependencies for frontend as well as backend
```bash
cd frontend
npm install
```
```bash
cd backend
npm install
```
Start the localhost server
```bash
cd frontend
npm start
```
## Show your support
Give a ⭐️ if you like this project!
| 5mg is a clone of Tata 1mg is India’s leading consumer health platform. It provides services, including e-pharmacy, diagnostics, e-consultation and health content. | chakra-ui,cyclic,javascript,mongodb,mongoose,nodejs,reactjs,redux,redux-thunk,vercel | 2023-01-17T10:02:52Z | 2023-07-15T09:05:37Z | null | 5 | 55 | 139 | 0 | 6 | 7 | null | null | JavaScript |
lenkon/to-do-list | main | <a name="readme-top"></a>
<div align="center">
<h3><b>Testing To Do list: part 2</b></h3>
</div>
# 📗 Table of Contents
- [📖 About the Project](#about-project)
- [🛠 Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Usage](#usage)
- [👥 Authors](#authors)
- [🔭 Future Features](#future-features)
- [🤝 Contributing](#contributing)
- [⭐️ Show your support](#support)
- [🙏 Acknowledgements](#acknowledgements)
- [❓ FAQ](#faq)
- [📝 License](#license)
# 📖 [Testing To Do list: part 2] <a name="about-project"></a>
> In this project unit tests for the To Do list application will be written. The testing project has been divided into two parts. In this part of the testing project, you will test functions responsible for the status and content updates.
**[Testing To Do list: part 2]** is...
## 🛠 Built With <a name="built-with"></a>
### Tech Stack <a name="tech-stack"></a>
> Built with html, css and javascript with webpack, jest, and linter configuration setup.
<details>
<summary>Client</summary>
<ul>
<li><a href="https://github.com/lenkon/to-do-list/blob/main/.github/workflows/linters.yml">linter</a></li>
<li><a href="https://www.w3schools.com/html/">html</a></li>
<li><a href="https://www.w3schools.com/w3css/defaulT.asp">css</a></li>
<li><a href="https://www.w3schools.com/js/default.asp">javascript</a></li>
</ul>
</details>
### Key Features <a name="key-features"></a>
> Key features of the application.
- **[Use webpack]**
- **[To do list]**
- **[Use webpack dev server]**
- **[Adding a new task]**
- **[Deleting a task]**
- **[Editing task]**
- **[Task completion status]**
- **[Clear all completed]**
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🚀 Live Demo <a name="live-demo"></a>
- [Demo Link](https://lenkon.github.io/)
<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:
- Web Browser (e.g. Firefox, Chrome, Edge)
- NPM (Node Package Manager)
### Setup
Clone this repository to your desired folder:
```
$ git clone https://github.com/lenkon/to-do-list
$ cd to-do-list
```
### Install
Install all project dependencies by running the command below:
```
$ npm install
```
### Usage
Open the index.html file in your Web Browser.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 👥 Authors <a name="authors"></a>
👤 **lenkon**
- GitHub: [@lenkon](https://github.com/lenkon)
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🔭 Future Features <a name="future-features"></a>
> Features to be added.
- [ ] **[Add more projects]**
- [ ] **[Add milestones and achievements]**
<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 please rate and give a star.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## 🙏 Acknowledgments <a name="acknowledgements"></a>
I would like to thank Microverse for sharing the tools and requirements.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
## ❓ FAQ <a name="faq"></a>
<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>
| This is a simple To-Do list web application that has features for users to add, edit and remove tasks from or to a list. Built with JavaScript, HTML, and CSS. | css,html5,javascript,webpack | 2023-01-25T04:11:42Z | 2023-02-12T02:24:49Z | null | 3 | 9 | 32 | 0 | 0 | 7 | null | MIT | JavaScript |