Giter Site home page Giter Site logo

srele96 / sk-experiments Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 41.76 MB

The collection of Srecko Kostic's experiments.

HTML 12.54% JavaScript 42.04% Python 1.17% CSS 0.04% C++ 34.79% TypeScript 3.96% Batchfile 0.68% CMake 1.78% C 0.12% EJS 0.21% SWIG 0.11% PowerShell 2.28% Dockerfile 0.12% SCSS 0.04% Shell 0.12%
algorithms-and-data-structures cpp javascript linear-algebra powershell problem-solving-techniques learning-techniques

sk-experiments's Introduction

Srecko Kostic - Experiments

Srecko Kostic's collection of learning, practice, and self-reflection.

My self-improvement history. I am generally curious.

Experiments

Advices

If you think something is stupid, ridiculous, makes no sense, or anything remotely similar, research and learn it extensively. It will make sense.

I used to think that unit tests are stupid, testers should test the software. I didn't know anything about unit tests.

I used to think Data Structures and Algorithms are stupid and algorithmic problems are ridiculous waste of time. They are not real programming, they are not how you write real software. I didn't know anything about any of them.

Every time I thought how something is stupid, ridiculous, makes no sense, or anything remotely similar, I did not agree with those opinions once I learned about it.

Algorithmic problems

Motivation

I started around three years ago to work on different topics. I did all the work in a directory on my pc, but it became unmanageable. The idea of doing something cool every day drove me. I realized I didn't share anything, and because of that, most of it is useless, forgotten, or abandoned. That is sad because I love some of those projects.

Working on this repository is among one the best decisions I made. I discovered so much thanks to it. I can never know the beast an initial idea will develop into.

sk-experiments's People

Contributors

srele96 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

skostic96

sk-experiments's Issues

create changelog using git-log

What

Create a changelog markdown file as part of the simulated release process.

Why

It sounds like an impressive and interesting idea to utilize tools.

prompt user for experiment description

What

  • Add feature to javascript/packages/new.
  • Notify the user when he creates a directory without a description.
  • Ask the user if he wants to continue and prompt him with yes or no.

Why

Don't create an experiment without a description by an accident (Like I just did).

update comment and readme

What

The package https://github.com/srele96/sk-experiments/tree/develop/experiments/new

Readme, Docs

Docs say

new <directory>                       Creates directory with empty package.json description.
new <directory> -d, --description     Creates directory with provided description for package.json.

But should say

new <directory>                       Creates directory with package.json's empty description and empty yarn.lock.
new <directory> -d, --description     Creates directory with provided description for package.json and empty yarn lock.

Comment in program

Here https://github.com/srele96/sk-experiments/blob/develop/experiments/new/index.js

A comment is wrong, only directory name is correct name for package.json but full path isn't.

program
  .argument('<directory>', 'new directory for an experiment')
  .option('-d, --description <description>', 'experiment description', '')
  .action((directory, { description }) => {
--  // user may provide dirname or path which
++  // user may provide path which results
--  // results in invalid name for package.json
++  // in invalid name for package.json
    const baseDirname = basename(directory);

solve specific problems in blog posts

What

Create structured blog post that solves specific problem.

Why

  • Help readers solve a specific problem.
  • A lot people don't know wide variety of technology that is around the problem.
  • They want to solve a specific problem fast, without learning all the technologies around it.
  • Use knowledge to help others solve problems efficiently.

How

  • Start with an idea that solves specific problem:

    • For example:

      • Create react dropdown.
      • Create react mousemove.
      • Create react expandable list.
    • Describe what do i want to make.

  • Refine the idea:

    • Write technical implementation details that i can foresee.
    • Write implementation steps.
    • Write pseudo code.
  • Prepare the ground for implementation:

    • Write pre-requisites.
    • Structure codepen, repository or wherever i decide to implement it.

learn about design documents

What

Read:

Why

Design documentation is essential. I spent most of the time reviewing potential solutions and wanted behavior. That happened while working on the command line interface. I realized I'm somewhat working on a design document. I was trying to find a solution and describe it. The design document fits the description of what I was doing.

create release for breaking change refactors

What

Freeze a project state before making structural refactors. Structural refactor is a breaking change refactor. A breaking change refactor breaks all reference links to the project.

Why

Keep backwards compatibility. Don't break reference links. Articles will have invalid links to the examples.

How

Research how.

  • Tag?
  • Release?

write about pull request review

What

Add pull request review experience, problems, opinions and potential solutions:

The view:

Solutions are very individual, two people will come up with two different solutions.

Point 1:

The view is very important for pull requests:

We can not request a complete rework of the solution because it's ridiculous.

Point 2:

The view is very important for pull requests:

- We can align on the usage of api.
- Have a clear picture how it works.
- Have a clear picture how to use it.
- Align on the solution approach.

Pull request review guidelines:

Make sure that PR:

- We follow project guidelines.
- Use good programming practices.
- Oney good programming principles.
- Code is readable and non ambigous.

Why

The pull request review process has been bugging me for six months. I gathered thoughts and came up with potential solutions in form of guidelines.

How

Create markdown file in a docs directory with more details.

read web technology for developers

What

Read articles from - Web technology for developers

Why

Expand web development knowledge. I was always curious to learn about CRP. This article looks promising and mentions it. It is one of the highly trusted web development resources. I've been using it for two years.

How

Read and optionally try to do some conceptual exercises.

use markdown lint because it seems useful

What

Use markdown lint and consider markdownlint.

Why

Using markdown lint extension in Visual Studio Code helped me catch some errors. It feels useful.

How

Use CI to integrate it. It appears to be ruby gem, and I didn't use ruby before.

Additional information

It may require whole repository markdown file correction.

Consider using markdown format that can check markdown files on CI and format them locally.

read about web apps performance

What

Read

  • HTML performance

    • What affects HTML performance?
    • Price of updating DOM elements
    • Price of rendering DOM elements
    • What else is there?
  • CSS performance

    • What affects CSS performance?
    • Price of CSSOM
    • Price of CSS changes
    • What else is there?
  • JS performance

    • What affects JS performance?
    • What else is there?

Add subsequent topics for them.

Why

@srele96 Update me.

move todos to issues

What

  • Move todos to issues
  • Delete todos markdown file

Why

Make addig todos easy. A pr process is an obstacle. When i finish todo and delete it, i lose context why i did it. Issues should improve that. I kind of forgot about them. Issues should make todos more visible.

stop throwing an error when the directory already exist

What

Change the package javascript/packages/new. Show a message and exit with a failure code instead of throwing an error.

Why

Good question. I don't know โ€” research when an app should throw an error. We want to tell a user the command line interface declined to act intentionally. That doesn't sound like erroneous behavior.

prettier, husky package configuration

I as a user would like to install a package that:

  • sets up husky pre commit hook that runs prettier
  • sets up prettier configuration
  • installs prettier package

To reuse it between projects.

more intuitive project structure

example:

// paths
sk-experiments
sk-experiments/experiments
sk-experiments/experiments/experiment-A
sk-experiments/experiments/experiment-B
sk-experiments/experiments/experiment-C
sk-experiments/experiments/README.md
sk-experiments/README.md
  • Hide index page configuration
  • Make index page more presentable
  • Index page shows title and short description of each experiment

create and host documentation web site

What

  • buy domain sk-experiments.com
  • create docusaurus docs
  • host docs to the domain (netlify or vercel, do research before making a choice)

Why

  • my research lacks exposure
  • it is really cool idea
  • i wanted to buy domain for past 2 years
  • opens a window for documenting experiments

find a way to test functionality

What

Find a way to test functionality using unit or other kind of tests.

Why

Repository needs refactors. Tests provide security that everything works. Make sure refactors don't break anything.

setup c++ formatter and linter on ci

What

Enforce consistent styling and lint checks for C++ directory. CI will verify that any code in the repo is formatted and linted. That eliminates need for pre-commit hooks that format or lint.

Run format and lint check on:

  • Every branch. (Provides early lint and formatting feedback)
  • Pull request. (Enforces consistent code by preventing merging)

Why

Prevent unwanted code using CI so whatever machine I use, the code is consistent.

How

Use bat files that run checks since I'm developing stuff on windows. The CI will probably need to setup MSYS2 because I'm using it.

cleanup branches

Amount of branches is increasing and some are probably stale.

don't use workspaces for javascript directory

What

The package new should stay workspace package. It is global package that the whole project can use. It creates directory from the template.

  • Create directory packages and use it for workspaces.
  • Move package new from experiments to packages.

Why

Only package to create directory from template is good for workspaces.

  • The whole repository can use it.
  • It is installed in node_modules and we can run it using npx.

All other work is individual and doesn't depend on each other.

Additional information

See more in the following issues:

consider not using workspaces

yarn workspaces are used for monolithic repository

Previous migration: #11

After two months of usage, I can say the following:

  • WebStorm autocomplete doesn't support packages. When I started working on graphql, WebStorm couldn't find the type declaration file.
  • Navigating to a repository and running npm install was never an issue.
  • I can share prettier, husky, and other configurations without monorepo.
  • I feel like I'm using monorepo the wrong way. My experiments aren't packages.
  • I don't feel the benefits of monorepo.

Concerns

How to use a monolithic repository for projects? The current approach doesn't feel right. None of my workspaces share anything in common. I had to create projects in a separate repository. They weren't compatible with this one because I didn't want conflicting node modules. I have to reconsider my approach.

Goals

Read about monolithic repositories, use cases, benefits, and experiences.

create directory for experiment

What

I would like to reduce repetitive tasks. I would like to initiate directory with package.json and empty yarn.lock. The package json should have a base template that I can reuse or edit.

Why

Every time I create a directory:

  • I copy package.json
  • create empty yarn.lock so yarn doesn't complain (because I'm using version 3)

How

For example:

npx newdir try-graphql

Will create:

try-graphql/package.json
try-graphql/yarn.lock

standardize commit messages

Commit message examples:

Title:

  • (feat): learned streams
  • (bugfix): something didn't work and i fixed it
  • (refactor): removed unused code

I forget the commit rules i come up with. It would be nice to have consistency.

reduce root readme size

What

Move majority of content from root readme somewhere else.

Why

Reduce too high visual overload after opening the repository.

How

Create root docs directory. Maybe this is an opportunity to create a starting point for documentation website for the whole repository?

improve repository navigation

What

Expose experiments through README.md files. Experiments that I have done should be immediately visible in a list.

  • Correct grammar in the issue questionnaire
  • Create a pull request template
    • Use imperative for template title, for example: this pull request will <pull_request_title>. The title should grammatically fit in that sentence.
    • Write a well-written and structured commit message with high-quality context.
    • Update README.md for appropriate repository:
  • Update current content
    • Remove monorepo text from root README.md. It is obsolete information. I have relatively OK knowledge of mono repo... I guess.
    • Update README.md in the root and add: Collection of experiments and reading topic wishlist in form of issues.
    • Add list to experiments in the following README.md files:
      • sk-experiments/README.md
      • sk-experiments/javascript/README.md
      • sk-experiments/python/README.md
      • sk-experiments/cpp/README.md
    • Add list to docs for
      • sk-experiments/README.md
      • sk-experiments/javascript/README.md
      • sk-experiments/python/README.md
      • sk-experiments/cpp/README.md

Why

The context that drives this change.

The reason for a well-written message for the default branch:

The commit message should contain either collection of all commit messages or a new one. A new commit message should provide context for all changes. The reason behind this decision is we will lose context and history if commit messages are not on the main branch. The reason for commit messages being in the pull request is a lack of knowledge. I thought it was enough to keep commit messages in pull requests.

The reason for links to experiments

Links to experiments should improve navigation. I can manage around the repository, but someone unfamiliar can't.

How

Add content for pull request template

## What changed

## Why was the change needed

## What was the previous behavior

## Checklist

- [ ] Write a well-written and structured commit message with high-quality context
- [ ] If you created an experiment, add a link to it in `README.md`

## Commit

_When done, edit the pull request and add the commit content here._

remove husky and use ci

What

Use CI to check formatting in JavaScript directory.

Why

Refactoring broke husky, CI is more reliable.

Additional information

See more in this issue #39

create webpack development ssr server

What

Find a way to create webpack development ssr server that stores files in memory.

Why

I was always curious how to do it. In the past I have spent hours researching how to do that. I can finally do it with the new approach of defining goal, searching for solution and repeating steps of:

  • Define goal
  • Search for solution

I repeat these two steps until I have the clear path to the implementation. No code commits or anything before the solution is clear.

How

Refer to online documentation. Define the goal, read through webpack documentation to see tools at disposal. Use the most appropriate tool to implement the requirements.

develop web apps using slow internet

What

add to TOPICS.md

  • use slow internet between 10 to 100 kb/s and observe loading speed
  • improve loading speed
  • add library
    • observe compiled javascript size change
    • improve loading speed

create problem for inheriting from multiple classes

What

Create a problem for inheriting from multiple parents.

Why

Implement the problem using the solution to remember it. Try out new well defined learning method.

How

Child inherits from two parents. Animal inherits from two parents. Find more problems that require this solution.

create an idea for a specific solution then implement it using that solution

What

Create an idea for a specific solution then implement it using that solution.

I read about run time polymorphism in C++, then created a story that requires it as solution. After that I clearly remember that chapter. Try to do that with other solutions to remember them.

I guess that is why solving a problem makes us remember the problem and solution. Our mind maps a story to abstract solution. The two somehow persist in my mind.

Why

Improve learning if the technique works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.