From 3b536f7e701f45f9260b797fe14c8b90aa8d98a6 Mon Sep 17 00:00:00 2001 From: Rob Santana Date: Sun, 29 Sep 2024 14:27:31 -0700 Subject: [PATCH] Customize --- config.json | 52 ++++++++++++--------------- src/utils/api.ts | 15 +------- src/utils/bin/api_commands.ts | 18 ---------- src/utils/bin/commands.ts | 68 +++++++++-------------------------- src/utils/bin/sumfetch.ts | 54 ++++++++-------------------- 5 files changed, 55 insertions(+), 152 deletions(-) diff --git a/config.json b/config.json index d1fa47c..cbd1b11 100644 --- a/config.json +++ b/config.json @@ -1,39 +1,31 @@ { - "readmeUrl": "https://raw.githubusercontent.com/cveinnt/cveinnt/master/README.md", - "title": "LiveTerm", - "name": "John Doe", - "ascii": "liveterm", + "title": "Robert Santana", + "name": "Robert Santana", "social": { - "github": "github", - "linkedin": "linkedin" - }, - "email": "contact@email.com", - "ps1_hostname": "liveterm", - "ps1_username": "visitor", - "repo": "https://github.com/Cveinnt/LiveTerm", - "resume_url": "https://upload.wikimedia.org/wikipedia/commons/c/cc/Resume.pdf", - "donate_urls": { - "paypal": "https://paypal.me/cveinnt", - "patreon": "https://patreon.com/cveinnt" + "linkedin": "robsanta" }, + "email": "rob@santana.io", + "ps1_hostname": "santana.io", + "ps1_username": "recruiter", + "resume_url": "https://drive.google.com/file/d/1LGg66XeFfk-NTiyk29r4nLfUKQIlhNcc/view?usp=sharing", "colors": { "light": { - "background": "#FBF1C9", - "foreground": "#3C3836", - "yellow": "#D79921", - "green": "#98971A", - "gray": "#7C6F64", - "blue": "#458588", - "red": "#CA2124" + "background": "#151515", + "foreground": "#D0D0D0", + "yellow": "#F4BF75", + "green": "#90A959", + "gray": "#505050", + "blue": "#75B5AA", + "red": "#AC4142" }, "dark": { - "background": "#2E3440", - "foreground": "#E5E9F0", - "yellow": "#5E81AC", - "green": "#A3BE8C", - "gray": "#88C0D0", - "blue": "#EBCB8B", - "red": "#BF616A" + "background": "#151515", + "foreground": "#D0D0D0", + "yellow": "#F4BF75", + "green": "#90A959", + "gray": "#505050", + "blue": "#75B5AA", + "red": "#AC4142" } } -} +} \ No newline at end of file diff --git a/src/utils/api.ts b/src/utils/api.ts index 6840cac..4fba0e6 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -1,17 +1,4 @@ import axios from 'axios'; -import config from '../../config.json'; - -export const getProjects = async () => { - const { data } = await axios.get( - `https://api.github.com/users/${config.social.github}/repos`, - ); - return data; -}; - -export const getReadme = async () => { - const { data } = await axios.get(config.readmeUrl); - return data; -}; export const getWeather = async (city: string) => { try { @@ -23,7 +10,7 @@ export const getWeather = async (city: string) => { }; export const getQuote = async () => { - const { data } = await axios.get('https://api.quotable.io/random'); + const { data } = await axios.get('http://api.quotable.io/random'); return { quote: `“${data.content}” — ${data.author}`, }; diff --git a/src/utils/bin/api_commands.ts b/src/utils/bin/api_commands.ts index ce4d487..246df7f 100644 --- a/src/utils/bin/api_commands.ts +++ b/src/utils/bin/api_commands.ts @@ -1,31 +1,13 @@ // // List of commands that require API calls -import { getProjects } from '../api'; import { getQuote } from '../api'; -import { getReadme } from '../api'; import { getWeather } from '../api'; -export const projects = async (args: string[]): Promise => { - const projects = await getProjects(); - return projects - .map( - (repo) => - `${repo.name} - ${repo.html_url}`, - ) - .join('\n'); -}; - export const quote = async (args: string[]): Promise => { const data = await getQuote(); return data.quote; }; -export const readme = async (args: string[]): Promise => { - const readme = await getReadme(); - return `Opening GitHub README...\n - ${readme}`; -}; - export const weather = async (args: string[]): Promise => { const city = args.join('+'); if (!city) { diff --git a/src/utils/bin/commands.ts b/src/utils/bin/commands.ts index 338c9f8..7edb68f 100644 --- a/src/utils/bin/commands.ts +++ b/src/utils/bin/commands.ts @@ -22,20 +22,13 @@ Type 'sumfetch' to display summary. `; }; -// Redirection -export const repo = async (args: string[]): Promise => { - window.open(`${config.repo}`); - return 'Opening Github repository...'; -}; - // About export const about = async (args: string[]): Promise => { - return `Hi, I am ${config.name}. -Welcome to my website! + return `Hello, I'm ${config.name}. +I'm an experienced software engineer. More about me: 'sumfetch' - short summary. -'resume' - my latest resume. -'readme' - my github readme.`; +'resume' - my latest resume.`; }; export const resume = async (args: string[]): Promise => { @@ -43,27 +36,12 @@ export const resume = async (args: string[]): Promise => { return 'Opening resume...'; }; -// Donate -export const donate = async (args: string[]): Promise => { - return `thank you for your interest. -here are the ways you can support my work: -- paypal -- patreon -`; -}; - // Contact export const email = async (args: string[]): Promise => { window.open(`mailto:${config.email}`); return `Opening mailto:${config.email}...`; }; -export const github = async (args: string[]): Promise => { - window.open(`https://github.com/${config.social.github}/`); - - return 'Opening github...'; -}; - export const linkedin = async (args: string[]): Promise => { window.open(`https://www.linkedin.com/in/${config.social.linkedin}/`); @@ -86,11 +64,6 @@ export const bing = async (args: string[]): Promise => { return `Wow, really? You are using bing for ${args.join(' ')}?`; }; -export const reddit = async (args: string[]): Promise => { - window.open(`https://www.reddit.com/search/?q=${args.join(' ')}`); - return `Searching reddit for ${args.join(' ')}...`; -}; - // Typical linux commands export const echo = async (args: string[]): Promise => { return args.join(' '); @@ -101,16 +74,14 @@ export const whoami = async (args: string[]): Promise => { }; export const ls = async (args: string[]): Promise => { - return `a -bunch -of -fake -directories`; + if(args.length) + return `ls: ${args.join(' ')}: Operation not permitted`; + return `. +..`; }; export const cd = async (args: string[]): Promise => { - return `unfortunately, i cannot afford more directories. -if you want to help, you can type 'donate'.`; + return `cd: ${args}: Operation not permitted`; }; export const date = async (args: string[]): Promise => { @@ -133,25 +104,20 @@ export const emacs = async (args?: string[]): Promise => { return `you know what? just use vscode.`; }; -export const sudo = async (args?: string[]): Promise => { - window.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '_blank'); // ...I'm sorry - return `Permission denied: with little power comes... no responsibility? `; -}; - // Banner export const banner = (args?: string[]): string => { return ` -█████ ███ ███████████ -░░███ ░░░ ░█░░░███░░░█ - ░███ ████ █████ █████ ██████ ░ ░███ ░ ██████ ████████ █████████████ - ░███ ░░███ ░░███ ░░███ ███░░███ ░███ ███░░███░░███░░███░░███░░███░░███ - ░███ ░███ ░███ ░███ ░███████ ░███ ░███████ ░███ ░░░ ░███ ░███ ░███ - ░███ █ ░███ ░░███ ███ ░███░░░ ░███ ░███░░░ ░███ ░███ ░███ ░███ - ███████████ █████ ░░█████ ░░██████ █████ ░░██████ █████ █████░███ █████ -░░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ + ███████████ █████ █████ █████████ +░░███░░░░░███ ░░███ ░░███ ███░░░░░███ + ░███ ░███ ██████ ░███████ ██████ ████████ ███████ ░███ ░░░ + ░██████████ ███░░███ ░███░░███ ███░░███░░███░░███░░░███░ ░░█████████ + ░███░░░░░███ ░███ ░███ ░███ ░███░███████ ░███ ░░░ ░███ ░░░░░░░░███ + ░███ ░███ ░███ ░███ ░███ ░███░███░░░ ░███ ░███ ███ ███ ░███ + █████ █████░░██████ ████████ ░░██████ █████ ░░█████ ░░█████████ +░░░░░ ░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░ Type 'help' to see the list of available commands. Type 'sumfetch' to display summary. -Type 'repo' or click here for the Github repository. +Type 'resume' or click here to download my resume. `; }; diff --git a/src/utils/bin/sumfetch.ts b/src/utils/bin/sumfetch.ts index e55686e..69df747 100644 --- a/src/utils/bin/sumfetch.ts +++ b/src/utils/bin/sumfetch.ts @@ -1,46 +1,22 @@ import config from '../../../config.json'; const sumfetch = async (args: string[]): Promise => { - if (config.ascii === 'cveinnt') { - return ` - @@@@@@@@@@@@@  sumfetch: summary display - @@@@ @@@@ ----------- - @@ @@  ABOUT - @@ @@  ${config.name} - @@ @@ ﰩ ${config.ps1_hostname} - @@ @@@ @@  resume -@@ @@@ @@ 爵 Github repo -@@ @@ ----------- -@@ .@@@@@@@@@@. @@  CONTACT - @@ @@ @@ @@  ${config.email} - @@ @@ @@ @@  github.com/${config.social.github} - @@ @@@@@@ @@  linkedin.com/in/${config.social.linkedin} - @@@ @@@ ----------- - @@@ @@@ @@  DONATE - @| @@@@@@@@@@@@@@@@ @@  ${config.donate_urls.paypal} - @| @@  ${config.donate_urls.patreon} - -`; - } else { - return ` - ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄   sumfetch - ▄▓▓▀ ▄▓▓▀▓▓▓▀▓▓▄ ▀▀▓▓▄  ----------- - ▓▓▀ ▄▓▀  ▐▓▓ ▀▓▓  ▓▓▄   ABOUT - ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   ${config.name} - ▓▓ ▓▓▓  ▐▓▓  ▐▓▓  ▓▓   resume -▐▓▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▓ 爵 Github repo -▐▓  ▐▓ ----------- -▐▓  > L I V E T E R M ▐▓  CONTACT -▐▓  ▐▓  ${config.email} -▐▓▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▓  github.com/${config.social.github} - ▓▓ ▐▓▓  ▓▓  ▐▓▓  ▓▓   linkedin.com/in/${config.social.linkedin} - ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  ----------- - ▓▓▓  ▐▓▓  ▓▓  ▓▓▓ ▓▓▀   DONATE - ▀▓▓▄▄ ▀▓▓▄▓▓▄▓▓▓▄▄▓▓▀   ${config.donate_urls.paypal} - ▀▓▓▓▓▓▓▓▓▓▓▓▀▀   ${config.donate_urls.patreon} - + return ` +======================================================== +|| . . .-. .-. .-. .-. || +||-( |------------| )---( )---( )---( )---( )-||  sumfetch: summary display +|| " " "-" "-" "-" "-" || ----------- +|| .-. .-. .-. .-. .-. ||  ABOUT +||-( )----------------( )---( )---( )---( )-||  ${config.name} +|| "-" "-" "-" "-" "-" ||  resume +|| .-. . . .-. .-. .-. || 爵 website +||-( )---( |------------| )---( )---( )---( )-|| ----------- +|| "-" " " "-" "-" "-" ||  CONTACT +|| .-. .-. .-. .-. .-. ||  ${config.email} +||-( )---( )----------------( )---( )---( )-||  linkedin.com/in/${config.social.linkedin} +|| "-" "-" "-" "-" "-" || +======================================================== `; - } }; export default sumfetch;