Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Pulling refs/heads/alpha into beta #595

Merged
merged 17 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,27 @@ declare module 'astro:content' {
collection: "journal";
data: InferEntrySchema<"journal">
} & { render(): Render[".md"] };
"06-13.md": {
id: "06-13.md";
slug: "06-13";
body: string;
collection: "journal";
data: InferEntrySchema<"journal">
} & { render(): Render[".md"] };
"06-14.md": {
id: "06-14.md";
slug: "06-14";
body: string;
collection: "journal";
data: InferEntrySchema<"journal">
} & { render(): Render[".md"] };
"06-15.md": {
id: "06-15.md";
slug: "06-15";
body: string;
collection: "journal";
data: InferEntrySchema<"journal">
} & { render(): Render[".md"] };
"asset.mdx": {
id: "asset.mdx";
slug: "asset";
Expand Down Expand Up @@ -1065,6 +1086,13 @@ declare module 'astro:content' {
collection: "project";
data: any
} & { render(): Render[".mdx"] };
"bizops.mdx": {
id: "bizops.mdx";
slug: "bizops";
body: string;
collection: "project";
data: any
} & { render(): Render[".mdx"] };
"charles.mdx": {
id: "charles.mdx";
slug: "charles";
Expand Down
4 changes: 4 additions & 0 deletions markdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import rehypeExternalLinks from "rehype-external-links";
//! import rehypeSlug from "rehype-slug"; There is a bug with displaying the Table of Contents , when importing the .MD files inside of the .MDX
import { rehypeHeadingIds } from "@astrojs/markdown-remark";

//! [June 13, 2023] - Adding Mermaid
import { mermaid } from "./src/components/Library/MDX/mermaid"

export default {
extendMarkdownConfig: true,
rehypePlugins: [
Expand Down Expand Up @@ -37,4 +40,5 @@ export default {
//? External Plugins -> True
extendPlugins: true,
gfm: true,
remarkPlugins: [mermaid],
};
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"kbve": "yarn-upgrade-all && astro sync && astro build && astro dev --host"
},
"devDependencies": {
"@types/eslint": "^8.40.1",
"@types/eslint": "^8.40.2",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"astro-eslint-parser": "^0.14.0",
Expand All @@ -26,13 +26,14 @@
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tsdoc": "^0.2.17",
"sass": "^1.63.3",
"sass": "^1.63.4",
"svgo": "2.8.0",
"yarn-upgrade-all": "^0.7.2"
},
"dependencies": {
"@astrojs/alpinejs": "^0.2.2",
"@astrojs/image": "^0.17.0",
"@astrojs/markdown-remark": "^2.2.1",
"@astrojs/mdx": "^0.19.7",
"@astrojs/partytown": "^1.2.3",
"@astrojs/preact": "^2.2.1",
Expand All @@ -59,22 +60,23 @@
"@types/react-router-dom": "^5.3.3",
"alpinejs": "^3.12.2",
"appwrite": "^11.0.0",
"astro": "^2.6.3",
"astro": "^2.6.4",
"astro-compress": "^1.1.47",
"crypto-js": "^4.1.1",
"dompurify": "^3.0.3",
"interweave": "^13.1.0",
"jquery": "^3.7.0",
"lodash": "^4.17.21",
"mermaid": "^10.2.3",
"micromodal": "^0.4.10",
"million": "^2.4.5",
"nanostores": "^0.9.1",
"million": "^2.4.6-beta.2",
"nanostores": "^0.9.2",
"react": "^18.2.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0",
"react-hook-form": "^7.44.3",
"react-icons": "^4.9.0",
"react-router-dom": "^6.12.1",
"react-router-dom": "^6.13.0",
"react-unity-webgl": "^9.4.2",
"rehype-autolink-headings": "^6.1.1",
"rehype-external-links": "^2.1.0",
Expand All @@ -86,7 +88,9 @@
"svelte": "^3.59.1",
"tailwindcss": "^3.3.2",
"tailwindcss-fluid-type": "^2.0.3",
"ts-dedent": "^2.2.0",
"typewriter-effect": "^2.20.1",
"unist-util-visit": "^4.1.2",
"use-sound": "^4.0.1"
},
"yarn-upgrade-all": {
Expand Down
Binary file added public/assets/audio/pull_request_made.mp3
Binary file not shown.
73 changes: 73 additions & 0 deletions public/data/unity/deprecated/StrapiLogin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//* Unity API Login
//* [IMPORT]
using System.Collections;
using SimpleJSON;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using TMPro;
public class Login : MonoBehaviour
{
//? [VAR] -> [START]
[SerializeField] private TMP_InputField _text_Username;
[SerializeField] private TMP_InputField _text_Password;
[SerializeField] private TMP_InputField _text_Error;
[SerializeField] private string _text_JWT;
[SerializeField] private string LoginURL = "https://api.kbve.com/api/auth/local/";
[System.Serializable] public class UserLoginData { public string identifier; public string password; }
//? [VAR] -> [END]

public void LoginRequest() { StartCoroutine(LoginEnumProcess()); } // {Coroutine()}
private IEnumerator LoginEnumProcess() // [VOID] -> {LoginEnumProcess()}
{
var user = new UserLoginData(); user.identifier = _text_Username.text; user.password = _text_Password.text;

//* {Request Header}
string jsonData = JsonUtility.ToJson(user);
var request = new UnityWebRequest(LoginURL, "POST");
byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(jsonData);
request.uploadHandler = (UploadHandler)new UploadHandlerRaw(jsonToSend);
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
request.method = "POST";
request.SetRequestHeader("Content-Type", "application/json");
request.SetRequestHeader("Accept", "application/json");

yield return request.SendWebRequest();

//? {y} -> Error
if(request.result != UnityWebRequest.Result.Success) { Debug.Log(request.error); yield break; }
else {
//! {y} -> Success -> #NEXT -> #WIP

JSONNode userData = JSON.Parse(request.downloadHandler.text);
Debug.Log(userData);

GlobalValue.PlayerJWT = userData["jwt"];
GlobalValue.PlayerEmail = userData["user"]["email"];
GlobalValue.PlayerUsername = userData["user"]["username"];

// PlayerPrefs.SetString("jwt", userData["jwt"]);
// PlayerPrefs.SetString("username", userData["user"]["username"]);
// PlayerPrefs.SetString("email", userData["user"]["email"]);
// PlayerPrefs.Save();
//? {y} -> Migrate load to Global Values?
Debug.Log(PlayerPrefs.GetString("username"));


SceneManager.LoadScene("Base", LoadSceneMode.Single);
yield break;
//! Grab the userData , prase, then set the JWT that represents the user.
//! The JWT might not need any extra levels of security but should expire 30 days.
//! There will be two arrays that get returned, one with JWT and the other with userData.
}

}

//? In theory, after the login is true, we save the JWT and <user> information
//? Then we use UnityEngine.SceneManagement; to load "IntroMenu"


void Start () { }
void Update () { }
}
Empty file added public/data/unity/index.html
Empty file.
27 changes: 27 additions & 0 deletions src/components/Library/MDX/mermaid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { RemarkPlugin } from "@astrojs/markdown-remark"
import { visit } from "unist-util-visit"
import dedent from "ts-dedent"

const escapeMap: Record<string, string> = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#39;",
}

const escapeHtml = (str: string) => str.replace(/[&<>"']/g, c => escapeMap[c])

export const mermaid: RemarkPlugin<[]> = () => tree => {
visit(tree, "code", node => {
if (node.lang !== "mermaid") return

// @ts-ignore
node.type = "html"
node.value = dedent`
<div class="mermaid" data-content="${escapeHtml(node.value)}">
<p>Loading graph...</p>
</div>
`
})
}
74 changes: 74 additions & 0 deletions src/components/Tools/Webmaster/ReactWebmaster.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//? Webmaster Tools to make it easier to manage your website(s).

import React from 'react';
import { useForm } from 'react-hook-form';
import DOMPurify from 'dompurify';

//* [START] -> Domain Functions Below by Kory Becker
function getHostName(url) {
const match = url.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);
if (
match != null &&
match.length > 2 &&
typeof match[2] === 'string' &&
match[2].length > 0
) {
return match[2];
} else {
return null;
}
}
function getDomain(url) {
const hostName = getHostName(url);
let domain = hostName;

if (hostName != null) {
const parts = hostName.split('.').reverse();

if (parts != null && parts.length > 1) {
domain = `${parts[1]}.${parts[0]}`;

if (hostName.toLowerCase().indexOf('.co.uk') !== -1 && parts.length > 2) {
domain = `${parts[2]}.${domain}`;
}
}
}

return domain;
}
//* [END] -> Domain Functions
///
///
//! [START] -> ReactWebmaster
const ReactWebmaster = () => {
const {
register,
handleSubmit,
formState: { errors },
} = useForm();

const [domain, setDomain] = React.useState(null);
const [webmasterError, setWebmasterError] = React.useState('');

React.useEffect(() => {
const sanitizeData = async () => {
const _url = getDomain(dork);
const clean = DOMPurify.sanitize(_url, {
USE_PROFILES: { html: false, mathMl: false, svg: false },
});
setDomain(clean);
};
sanitizeData();
}, []);

if (domain) {
return (
<>
<div>{domain}</div>
</>
);
}
};

//! [END] -> ReactWebmaster
export default ReactWebmaster;
3 changes: 3 additions & 0 deletions src/components/Tools/Webmaster/Webmaster.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
63 changes: 0 additions & 63 deletions src/components/Tools/Webmaster/index.jsx

This file was deleted.

Loading