-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ed0b5d
commit 850fedd
Showing
8 changed files
with
175 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { useEffect, useState, useContext } from 'react'; | ||
import Header from '../../../src/Header'; | ||
import Footer from '../../../src/Footer'; | ||
import { ThemeContext } from '../../../pages/_app'; | ||
import CodeBlock from '../../../src/CodeBlock' | ||
import { Typewriter } from '../../../src/Typewriter' | ||
export default function WakaTimeBlog() { | ||
const { state } = useContext(ThemeContext) | ||
const classStringText = "ml-10 mobile:ml-0 mr-[20%] mobile:mr-0" | ||
const quote = ` | ||
"Collecting intelligence information is like trying to drink water out of a fire hydrant. | ||
You know, in hindsight It's great. The problem is there's a million dots at the time." | ||
- Louis Freeh | ||
` | ||
const quoteMobile = ` | ||
"We must not ignore the small | ||
daily differences we can make | ||
which, over time, add up to | ||
big differences that we often | ||
cannot foresee" | ||
- Mariean Write Edelman | ||
` | ||
//Colosasl ascii font | ||
return ( | ||
<> | ||
<Header /> | ||
<div className="IndexMainContent w-screen md:w-95% pl-5 pr-5 p-1 text-lightTextPrimary dark:text-darkTextPrimary "> | ||
<pre className="text-[8px] mobile:text-[7px] leading-[6px] text-center font-black">{` | ||
d8888 8888888888 d8b 888 8888888b. 888 | ||
d88888 888 Y8P 888 888 Y88b 888 | ||
d88P888 888 888 888 888 888 | ||
d88P 888 8888888 .d88b. 888d888 8888b. 888 888 888 88888b. 888888 .d88b. 888 d88P 888 888 .d8888b 888888 | ||
d88P 888 888 d88""88b 888P" "88b 888 888 888 888 "88b 888 d88""88b 8888888P" 888 888 88K 888 | ||
d88P 888 888 888 888 888 .d888888 888 888 888 888 888 888 888 888 888 T88b 888 888 "Y8888b. 888 | ||
d8888888888 888 Y88..88P 888 888 888 Y88b 888 888 888 888 Y88b. Y88..88P 888 T88b Y88b 888 X88 Y88b. | ||
d88P 888 888 "Y88P" 888 "Y888888 "Y88888 888 888 888 "Y888 "Y88P" 888 T88b "Y88888 88888P' "Y888 | ||
888 | ||
Y8b d88P | ||
"Y88P" | ||
`}</pre> | ||
<br /> | ||
<br /> | ||
<Typewriter script={quote} scriptMobile={quoteMobile} waitTime={500} className="mobile:h-[160px] desktop:h-[100px] desktop:w-[790px] desktop:mx-auto" /> | ||
<br /> | ||
<br /> | ||
<div className={classStringText}> | ||
<p> | ||
In early 2023 I started hearing about this language Rust starting to be introduced to the kernel for improved memory safety. This got my attention, because at the time I was still quite hesitant of working with C/C++ for anything complicated. Too many ways for things to go wrong I thought. | ||
</p> | ||
<br /> | ||
<p> | ||
This hesitation about C, and every programmers desire for a fast, compiled language lead me to start learning the basics of Rust. I was immediately impressed with the language, compiler, and the community. Everything you've heard about is true. A massive pain in the butt, but incredibly rewarding. Who knew a mashup between Python, C, and Haskell would lead to something amazing? | ||
</p> | ||
</div> | ||
</div> | ||
<br /> | ||
<br /> | ||
<Footer /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,74 @@ | ||
const waka_data="https://v44xqrj223xagx464afcfc4jcy0mocts.lambda-url.us-east-1.on.aws/" | ||
import {useEffect,useState} from 'react' | ||
const waka_data = "https://v44xqrj223xagx464afcfc4jcy0mocts.lambda-url.us-east-1.on.aws/" | ||
import { useEffect, useState } from 'react' | ||
import { WakaCodeObj, WakaLangObj } from './ChartData' | ||
import { WakaTimeBarChart, WakaTimePieChart } from './Charts' | ||
export const Wakatime = () => { | ||
const [languagesData, setLanguagesData] = useState<Object|null>(null) | ||
const [codeData, setCodeData] = useState<Object|null>(null) | ||
const [hours, setHours] = useState<string|null>(null) | ||
const [mins, setMins] = useState<string|null>(null) | ||
async function fetchWakaData(){ | ||
try{ | ||
const waka_code_lang = await fetch(waka_data) | ||
return await waka_code_lang.json() | ||
} | ||
catch(e:any){ | ||
return null | ||
} | ||
} | ||
useEffect(()=>{ | ||
const response = fetchWakaData() | ||
//console.log('response wakatime') | ||
//console.log(response) | ||
response.then((data)=>{ | ||
setCodeData(data.code) | ||
setLanguagesData(data.languages) | ||
setHours(data.hours) | ||
setMins(data.mins) | ||
//console.log(data) | ||
}).catch((e)=>{ | ||
//console.log("error in response") | ||
//console.log(e) | ||
}) | ||
},[]) | ||
return ( | ||
<div className="h-full w-full p-4"> | ||
<p className="text-lg">WakaTime Coding Statistics</p> | ||
<br /> | ||
{codeData? | ||
<> | ||
<div className="w-full h-full grid grid-cols-2 gap-0 mobile:block"> | ||
<div className="col-start-1 grid"><WakaTimePieChart className="max-w-[10cm] desktop:place-self-center mobile:mx-auto" data={languagesData as WakaLangObj} title={"My Languages"} showLegend={screen.width>500}/></div> | ||
<div className="p-8 col-start-2 mobile:p-0"> | ||
<p className="text-lg font-black">General Stats:</p> | ||
<br /> | ||
<pre className="text-sm">Primary OS: Linux</pre> | ||
<br /> | ||
<pre className="text-sm">Main Editor: Neovim</pre> | ||
<br /> | ||
<pre className="text-sm">Leetcode: 36 Problems</pre> | ||
<br /> | ||
<pre className="text-sm">Waka Total: {hours} hrs {mins} mins</pre> | ||
<br /> | ||
<p className="text-lg">About WakaTime</p> | ||
<br /> | ||
<p className="text-sm">This is a tool that tracks active usage of editors and coding projets I started tracking my time with this tool March 2023.</p> | ||
<br /> | ||
<p className="text-sm"> The 'Broswer' language category for documentation and other development sites. Specific domains have been categorized as a "language" due to their importance.</p> | ||
<br /> | ||
<p className="text-sm">This is important to note since I use Jupyter notebook as my primary Python IDE. This will appear as "localhost" alongside my standard web development activity.</p> | ||
</div> | ||
<div className="col-start-1 col-span-2 p-10 w-[80%] max-w-[24cm] mx-auto mobile:p-0 mobile:w-[100%]"><WakaTimeBarChart data={codeData as WakaCodeObj} title={"Hours Coding Last 30 Days"} isMobile={screen.width < 500}/></div> | ||
</div> | ||
</> | ||
: | ||
"Loading ..."} | ||
</div> | ||
) | ||
const [languagesData, setLanguagesData] = useState<Object | null>(null) | ||
const [codeData, setCodeData] = useState<Object | null>(null) | ||
const [hours, setHours] = useState<string | null>(null) | ||
const [mins, setMins] = useState<string | null>(null) | ||
async function fetchWakaData() { | ||
try { | ||
const waka_code_lang = await fetch(waka_data) | ||
return await waka_code_lang.json() | ||
} | ||
catch (e: any) { | ||
return null | ||
} | ||
} | ||
useEffect(() => { | ||
const response = fetchWakaData() | ||
console.log(response) | ||
//console.log('response wakatime') | ||
//console.log(response) | ||
response.then((data) => { | ||
setCodeData(data.code) | ||
setLanguagesData(data.languages) | ||
setHours(data.hours) | ||
setMins(data.mins) | ||
//console.log(data) | ||
}).catch((e) => { | ||
//console.log("error in response") | ||
//console.log(e) | ||
}) | ||
}, []) | ||
return ( | ||
<div className="h-full w-full p-4"> | ||
{languagesData ? | ||
<> | ||
<div className="w-full h-full grid grid-cols-2 gap-0 mobile:block"> | ||
<div className="col-start-1 grid"><WakaTimePieChart className="max-w-[10cm] max-h-[10cm] desktop:place-self-center mobile:mx-auto" data={languagesData as WakaLangObj} title={"My Languages"} showLegend={false} /></div> | ||
<div className="p-8 col-start-2 mobile:p-0"> | ||
<p className="text-lg font-black">General Stats:</p> | ||
<br /> | ||
<pre className="text-sm">Primary OS: Linux</pre> | ||
<br /> | ||
<pre className="text-sm">Main Editor: Neovim</pre> | ||
<br /> | ||
<pre className="text-sm">Leetcode: 68 Problems</pre> | ||
<br /> | ||
<pre className="text-sm">Waka Total: {hours} hrs {mins} mins</pre> | ||
<br /> | ||
<pre className="text-sm">Wyzant Rating: 5.0 stars, 30 impressions</pre> | ||
<br /> | ||
<pre className="text-sm">Wyzant Students: 72 Students</pre> | ||
<br /> | ||
<pre className="text-sm">Wyzant Total: 275 hrs</pre> | ||
<br /> | ||
<p className="text-lg">About WakaTime</p> | ||
<br /> | ||
<p className="text-sm">This is a tool that tracks active usage of editors and coding projets I started tracking my time with this tool March 2023.</p> | ||
</div> | ||
{codeData ? | ||
<div className="col-start-1 col-span-2 p-10 w-[80%] max-w-[24cm] mx-auto mobile:p-0 mobile:w-[100%]"><WakaTimeBarChart data={codeData as WakaCodeObj} title={"Hours Coding Last 30 Days"} isMobile={screen.width < 500} /></div> | ||
: | ||
<></> | ||
} | ||
</div> | ||
</> | ||
: | ||
"Loading ..."} | ||
</div> | ||
) | ||
} | ||
|