diff --git a/posts/software/competitive-programming-setup.html b/posts/software/competitive-programming-setup.html deleted file mode 100644 index 5e0744a..0000000 --- a/posts/software/competitive-programming-setup.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - competitive programming setup - - - -
-
-
-

competitive programming setup

- -
-
-

HTML, JavaScript, and CSS

-

That's all there is to it.

-

I thought about using the following frameworks:

-
    -
  1. React.js
  2. -
  3. Next.js
  4. -
  5. Hugo
  6. -
  7. Astro
  8. -
-

- But I did not actually need any of them to make this site - look decent. -

-

What I've Learned

-

- Of course, most people build simple websites like these to learn a - new technology or framework, not to use an optimal tool. That's - actually why I - hosted this website on AWS. -

-

- Building this website with truly bare-bones technologies has made me - appreciate why these web frameworks have emerged. -

-
    -
  • - Writing JavaScript to manipulate the DOM works just fine but lacks - the readability and composability that many JavaScript frameworks - bring to the table. -
  • -
  • - Re-using code is odd. For example, I created a - "common.js" with general utilities—there is zero - indication (both to me and my language servers) that these - functions are exposed to other scripts included by the same HTML - file. -
  • -
  • - JSX is great. Dynamically inserting HTML as raw strings or writing - them line by line with the DOM is a pain, and a verbose one at - that. -
  • -
  • - Similarly, CSS styling (inline/stylesheet) works at the small - scale. However, with styles being completely divorced from the - HTML itself, much is left to be desired. -
  • -
  • - Reusing HTML, styles, and JavaScript feels extremely fragile. - Innovative type-safe, optimized, and composable solutions - definitely have their place in the web. -
  • -
  • - You can be efficient with HTML, JS, and CSS. My iteration - speed on on this site versus other React.js/MDX blogs I have - worked on is the same if not faster. While this may be a testament - to my lack of JavaScript experience, I think people conclude too - early that their task is beyond the technologies that form the - foundation of the web today. -
  • -
-
-
-
- - - - - diff --git a/posts/software/my-cp-setup.html b/posts/software/my-cp-setup.html new file mode 100644 index 0000000..c7b1eb4 --- /dev/null +++ b/posts/software/my-cp-setup.html @@ -0,0 +1,111 @@ + + + + + + + + + + my cp setup + + + +
+
+
+

my cp setup

+ +
+
+

+ Source code + here. +

+

my goals

+

+ I wanted the following features in my competitive programming (cp) + setup: +

+
    +
  • + Flexibility: support various environments (codeforces, + USACO, cses, etc.) with ease +
  • +
  • + Speed: instantaneous, non-blocking running/debugging; + automatic environment configuration and easy code testing +
  • +
  • + Editor-Agnostic: while I do provide first-in-class NeoVim + integration for my setup, it should be easily portable to + any os/editor. +
  • +
+

the solution

+

+ Some (POSIX-compliant, of course) scripts and a + makefile are more than enough. I created the following + intuitive way to interact with my CP setup: +

+
    +
  1. + make setup: populate the environment with + configurations in ~/.config/cp-template for + clang-format and clangd +
  2. +
  3. make run file
  4. +
  5. make debug file
  6. +
  7. make clean
  8. +
+

+ That's it. The makefile relies on some scripts that + compile code and run the corresponding executables. +

+

neovim integration

+
+ screenshot of my neovim competitive programming setup +
+

+ Leveraging + LuaSnip, a custom CP user command, and some scripting for + window management and asynchronous jobs, I'm able to: +

+
    +
  • + Asynchronously format, run, and debug code (:h vim.system) +
  • +
  • Use a three-window (input, output, and code) view
  • +
  • Toggle between problems instantly (yes, the windows update)
  • +
  • + Automatically populate my coding buffers with competition-specific + templates (i.e. USACO, CSES, etc.) +
  • +
  • Run the code from the CLI in less than a second
  • +
  • + Easily tweak and change the setup—there's absolutely nothing + fancy. +
  • +
+
+
+
+ + + + + diff --git a/public/posts/my-cp-setup/cp-setup.webp b/public/posts/my-cp-setup/cp-setup.webp new file mode 100644 index 0000000..aa2d276 Binary files /dev/null and b/public/posts/my-cp-setup/cp-setup.webp differ diff --git a/scripts/index.js b/scripts/index.js index 5550b86..9469ed3 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -2,6 +2,7 @@ const postMapping = new Map([ [ "software", [ + "my cp setup", "from github pages to aws", "designing this website", // "working in the terminal", diff --git a/styles/post.css b/styles/post.css index 1d75ad9..bfc9353 100644 --- a/styles/post.css +++ b/styles/post.css @@ -4,6 +4,9 @@ body { margin: 0; padding: 0; height: 100%; + min-height: 100vh; + display: flex; + flex-direction: column; } header { @@ -25,6 +28,7 @@ li { .main { display: flex; justify-content: center; + flex: 1; } .post-header {