Skip to content
View c-marc's full-sized avatar

Block or report c-marc

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
c-marc/README.md

Hello World πŸ‘‹

TL;DR: Jump to More Readable Readme or to Contact Me

Me as an experimental module πŸ€–

I'm trying to write clean and safe code.
// profile.ts

// Discriminating unions are a powerful pattern
type Activity =
  | {
      status: "procrastinating";
    }
  | {
      status: "learning";
      what: string | string[];
    };

// Interface
interface Profile {
  firstName: string;
  activity: Activity;
}

// Fully typed function
/** Fight with heterogenous types of return */
const currentActivity = (
  motivation: number,
  what: string | string[] = "[un]important stuffs"
): Activity => {
  return Math.random() > motivation
    ? { status: "procrastinating" }
    : { status: "learning", what: what };
};

// Config Me
const motivation = Math.random(); // let's not be too specific
const currentInterests = ["Remix", "vitest"];

// Typed Me
const me: Profile = {
  firstName: "Marc", //πŸ‘ˆ πŸ‘Ύ
  activity: currentActivity(motivation, currentInterests),
};

// Backend Me (IA will never beat this one)
/** Mock a server route */
const thinking = async (question: string): Promise<string> => {
  try {
    if (!question || typeof question !== "string" || question === "42?") {
      throw new Error("422: Haha!"); //unprocessable content
    }
    const answer = "42";
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(answer);
      }, 3000);
    });
  } catch (error: unknown) {
    // this block might need improvement (typing error is tricky)
    if (error instanceof Error && error.message) throw error; //rethrow
    else throw new Error("500: Brain crash :/", { cause: error });
  }
};

// Frontend interaction with Me
/** Mock a fetch */
export const askMeAnything = async (
  question: string = "What's the meaning of life?"
): Promise<string | void> => {
  try {
    if (!question || typeof question !== "string") {
      return "Hmm... It doesn't look like a question...";
    }
    const answer = await thinking(question);
    return answer;
  } catch (error: unknown) {
    // this block might need improvement (typing error is tricky)
    if (error instanceof Error && error.message) throw error; //rethrow
    else throw new Error("You found a bug! Please tell me!", { cause: error });
  }
};

// Frontend Me
export default me;

Hello world:

// main.ts
import me, { askMeAnything } from "./profile";

(async () => {
  console.info("Hi πŸ‘‹");
  try {
    const answer = await askMeAnything("6*7");
    console.info(`${me.firstName} says: ${answer}`);
  } catch (error: unknown) {
    if (error instanceof Error) {
      console.log(error.message);
    }
  }
  console.info("See you later, Alligator 🐊");
})();

More Readable Readme πŸ™‚

Hi πŸ‘‹, I'm Marc,

Here I'm still studying, now learning fullstack development, web & mobile.

// TODO: landing page and/or portfolio

What I'm into ⚑

  • Languages: HTML5, CSS and javascript/typescript (I learnt Python in another life, but right now I'm into JS/TS for backend too)
  • Frontend libs: React, React Router
  • Fullstack frameworks: I'm into Remix right now
  • Pretty stuffs: I'm a little bit versatile with this subject: plain CSS, TailwindCSS, classless or minimalistic CSS approches...
  • ODM/ORM: mongoose, Prisma, BaaS
  • Backend: (Remix), Express, BaaS
  • DevOps: I'm fine with simple deployment, CI/CD concepts, but this is not something I'm fluent with in a production environment where you cannot mess with migrations, security...
  • Mobile: React Native
  • UX/UI: some knowledge of concepts and some knowledge of Figma

What I'm interested in learning right now 🌱

  • sharpen my skills with the already mentionned tech;
  • get a better workflow and get better at choosing and leveraging the right tools (frameworks, 3rd-party libs or services... ); and at focusing my learning and expertise on these...
  • get better at testing: Vitest, cypress;
  • maybe a UI library
  • maybe Storybook;
  • maybe a headless-CMS

Worth mentioning πŸ”§

I've also got a statistical background and a solid experience with R. Even though I've recently been spending more time on web development, you may be here because of that... Want to talk about causality, misconceptions about p-values or confidence intervals, or the Tidyverse?

Contact Me πŸ’¬

Feel free to contact me the way you want:

  • Use the following form: Get in Touch
  • Post an issue
  • Find my e-mail around here if you're a git ninja

Popular repositories Loading

  1. testGH testGH Public

    tester git

  2. blog blog Public

  3. predictr predictr Public

    Interactive Exploration Of Predictive Values

    R

  4. ws11 ws11 Public

  5. eleventy-base-blog eleventy-base-blog Public template

    Forked from 11ty/eleventy-base-blog

    A starter repository for a blog web site using the Eleventy static site generator.

    Nunjucks

  6. my_distill my_distill Public

    HTML