Almost complete

This commit is contained in:
2022-03-20 01:47:39 -04:00
parent 156e47f4de
commit e754daa6b2
21 changed files with 21596 additions and 0 deletions

180
src/views/CodeServer.vue Normal file
View File

@@ -0,0 +1,180 @@
<template>
<section class="text-gray-400 bg-gray-900 body-font">
<div class="container px-5 py-24 mx-auto">
<div class="flex flex-col text-center w-full mb-12">
<h1 class="sm:text-3xl text-2xl font-medium title-font mb-4 text-white">
REST Remote Code Server Project
</h1>
<p class="lg:w-2/3 mx-auto leading-relaxed text-base">
Built a RESTful API that can compile and run code on a remote server
in isolated docker containers. Easily add support for any language
that can be compiled and run from a bash script.
</p>
<p class="lg:w-2/3 mx-auto leading-relaxed text-base">
<br>
Java is run Main.jar, and thus needs to be placed in the Main class.
</p>
<div class="bg-zinc-800 align-left" style="margin-top: 15px">
Code:
<prism-editor
class="my-editor bg-zinc-800"
v-model="code"
:highlight="highlighter"
line-numbers
></prism-editor>
Output:
<code style="">
<p
v-for="item in data"
:key="item.message"
style="padding-left: 15px"
>
{{ item }}
</p>
</code>
<center>
<button
v-on:click="runCode"
class="
bg-blue-500
hover:bg-blue-700
text-white
font-bold
py-2
px-4
rounded
width:
100%
"
>
Run Code
</button>
<div class="relative inline w-full text-gray-700" style="margin-left: 20px;">
<select
class="
h-10
pl-3
pr-6
text-base
placeholder-gray-600
border
rounded-lg
appearance-none
focus:shadow-outline
"
v-model="selected"
placeholder="Select Language"
>
<option v-for="language in languages" :key="language">
{{ language }}
</option>
</select>
<div class="absolute inset-y-0 right-0 flex items-center px-2">
<svg class="w-4 h-4 fill-current" viewBox="0 0 20 20">
<path
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
clip-rule="evenodd"
fill-rule="evenodd"
></path>
</svg>
</div>
</div>
</center>
</div>
</div>
</div>
</section>
</template>
<script>
// import Prism Editor
import { PrismEditor } from "vue-prism-editor";
import "vue-prism-editor/dist/prismeditor.min.css"; // import the styles somewhere
// import highlighting library (you can use any library you want just return html string)
import { highlight, languages } from "prismjs/components/prism-core";
import "prismjs/components/prism-clike";
import "prismjs/components/prism-javascript";
import "prismjs/themes/prism-tomorrow.css"; // import syntax highlighting styles
export default {
name: "CodeServerComponent",
components: {
PrismEditor,
},
created() {
this.getLanguages();
},
data() {
return {
data: [],
code: "",
languages: [],
selected: "",
};
},
methods: {
async runCode() {
this.data = [];
let res = await fetch("http://localhost:8000/run/run", {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({ code: this.code, language: this.selected }),
});
// Retrieve its body as ReadableStream
const reader = res.body.getReader();
let isDone = false;
while (!isDone) {
const response = await reader.read();
isDone = response.done;
if (isDone) {
return;
}
console.log(response);
let str = "";
for (let i = 8; i < response.value.length; i++) {
str += String.fromCharCode(response.value[i]);
}
console.log(str);
this.data.push(str);
}
},
highlighter(code) {
return highlight(code, languages.js); // languages.<insert language> to return html with markup
},
async getLanguages() {
let res = await fetch("http://localhost:8000/run/languages");
this.languages = await res.json();
},
},
};
</script>
<style>
/* required class */
.my-editor {
/* we dont use `language-` classes anymore so thats why we need to add background and text color manually */
color: #ccc;
/* you must provide font-family font-size line-height. Example: */
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
font-size: 14px;
line-height: 1.5;
padding: 5px;
}
/* optional class for removing the outline */
.prism-editor__textarea:focus {
outline: none;
}
.align-left {
text-align: left;
padding: 10px;
}
</style>

26
src/views/Home.vue Normal file
View File

@@ -0,0 +1,26 @@
<template>
<div>
<ProfileComponent></ProfileComponent>
</div>
</template>
<script>
import ProfileComponent from '@/components/ProfileComponent.vue'
export default {
name: "HomeComponent",
props: {
msg: String,
},
components: {
ProfileComponent,
},
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
@tailwind base;
@tailwind components;
@tailwind utilities;
</style>

378
src/views/Work.vue Normal file
View File

@@ -0,0 +1,378 @@
<template>
<section class="text-gray-400 bg-gray-900 body-font overflow-hidden">
<div class="container px-5 py-24 mx-auto">
<p>Check out some of my projects! I'm not yet done setting up each project on my VPS yet, so not every project is hosted yet.</p>
<br>
<div class="-my-8 divide-y-2 divide-gray-800">
<div class="py-8 flex flex-wrap md:flex-nowrap">
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Vue, TailwindCSS</span>
<span class="mt-1 text-gray-500 text-sm">March 2022</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Personal Website
</h2>
<p class="leading-relaxed">
Used VueJS, and TailwindCSS to build a personal website to showcase my work experience and projects.
</p>
<a href="https://github.com/jslightham/jslightham.github.io" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">NodeJS, Express, Docker</span>
<span class="mt-1 text-gray-500 text-sm">March 2022</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
REST Remote Code Server
</h2>
<p class="leading-relaxed">
Built a RESTful API that can compile and run code on a remote server in isolated docker containers. Easily add support for any language that can be compiled and run from a bash script.
</p>
<router-link to="/codeserver">
<a class="text-blue-400 inline-flex items-center mt-4"
>See Project
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</router-link>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">NodeJS, Express, MongoDB</span>
<span class="mt-1 text-gray-500 text-sm">Oct 2021</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Kno-Logic API
</h2>
<p class="leading-relaxed">
Built a backend with a REST interface for a news aggregation project. Assisted with integration into the frontend react native applicaton.
</p>
<a href="https://github.com/jslightham/kno-logic-api" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Java, NodeJS</span>
<span class="mt-1 text-gray-500 text-sm">Aug 2021</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Brute Forced War Game
</h2>
<p class="leading-relaxed">
An experiment to learn using crowdsourced computing and multithreaded programming in Java to brute force a solution.
</p>
<a href="https://github.com/jslightham/brute-forced-war-game" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Unity, C#</span>
<span class="mt-1 text-gray-500 text-sm">Jul 2021</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Zero Waste Game
</h2>
<p class="leading-relaxed">
A group project where we created a multiplayer space exploration game in Unity.
</p>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">NodeJS, Vue, TensorflowJS, Websockets</span>
<span class="mt-1 text-gray-500 text-sm">Feb 2021</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Multiplayer Stick Figure Game
</h2>
<p class="leading-relaxed">
A project for a hackathon, where my group created a multiplayer game. The game's input was the user's camera that used TensorflowJS to place a realtime virtual representation of them in the game. The player's positions were synchronized via websockets, which allowed games such as soccer and volleyball to be played virtually.
</p>
<a href="https://github.com/jslightham/multiplayer-stickfigure-game" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">NodeJS, Vue, Handbrake, FFMPEG, Video.js, MongoDB</span>
<span class="mt-1 text-gray-500 text-sm">Dec 2020</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
NodeJS Video Streamer
</h2>
<p class="leading-relaxed">
A simple clone project of the popular video sharing website YouTube. Automatically transcodes uploads, modern video player (Video.js), video and audio streaming from NodeJS backend, automatic thumbnail generation through FFmpeg, comment &amp; like system, and metadata storage in MongoDB.
</p>
<a href="https://github.com/jslightham/NodeJS-Video-Streamer" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">HTML, Javascript</span>
<span class="mt-1 text-gray-500 text-sm">Jun 2020</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Collision Simulator
</h2>
<p class="leading-relaxed">
A javascript canvas collision simulation in 2D for a combined high school Physics and Computer Science final project.
</p>
<a href="https://jslightham.github.io/Collision-Simulator/" class="text-blue-400 inline-flex items-center mt-4"
>See Project
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Vue, Bootstrap, NodeJS, Express, MongoDB</span>
<span class="mt-1 text-gray-500 text-sm">Jun 2020</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
MEVN Attendance System
</h2>
<p class="leading-relaxed">
A group project for a school project, where we created an attendance system in MongoDB.
</p>
<a href="https://github.com/jslightham/MEVN-Attendance-Tracker" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Java</span>
<span class="mt-1 text-gray-500 text-sm">2019-2020</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
MC Plugins
</h2>
<p class="leading-relaxed">
Built a few Java edition Minecraft plugins to learn how to.
</p>
<a href="https://github.com/jslightham/MC-Plugins" class="text-blue-400 inline-flex items-center mt-4"
>View on GitHub
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Firebase, Google Cloud, Keybase, NodeJS</span>
<span class="mt-1 text-gray-500 text-sm">Sep 2019</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Translate Bot
</h2>
<p class="leading-relaxed">
A project for a hackathon that won the best use of google cloud award. This project translated conversations in real time within the keybase application into a language that the user selects.
</p>
<a href="https://devpost.com/software/translatebot" class="text-blue-400 inline-flex items-center mt-4"
>View on Devpost
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</div>
</div>
<div
class="py-8 flex border-t-2 border-gray-800 flex-wrap md:flex-nowrap"
>
<div class="md:w-64 md:mb-0 mb-6 flex-shrink-0 flex flex-col">
<span class="font-semibold title-font text-white">Java</span>
<span class="mt-1 text-gray-500 text-sm">Jun 2019</span>
</div>
<div class="md:flex-grow">
<h2 class="text-2xl font-medium text-white title-font mb-2">
Zork
</h2>
<p class="leading-relaxed">
A group project where we recreated the classic text based adventure game Zork in Java, with some extra functionality.
</p>
<router-link to="/zork">
<a class="text-blue-400 inline-flex items-center mt-4"
>See Project
<svg
class="w-4 h-4 ml-2"
viewBox="0 0 24 24"
stroke="currentColor"
stroke-width="2"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M5 12h14"></path>
<path d="M12 5l7 7-7 7"></path>
</svg>
</a>
</router-link>
</div>
</div>
</div>
</div>
</section>
</template>
<script>
export default {
name: "WorkComponent",
};
</script>
<style>
</style>

15
src/views/Zork.vue Normal file
View File

@@ -0,0 +1,15 @@
<template>
<div>
Zork
</div>
</template>
<script>
export default {
name: "ZorkComponent"
}
</script>
<style>
</style>