Skip to content

Instantly share code, notes, and snippets.

View SirSerje's full-sized avatar
🏠
Working from home

Serhii Viazkov SirSerje

🏠
Working from home
View GitHub Profile
@SirSerje
SirSerje / perf-test.jsx
Last active February 22, 2025 23:36
Performance test for vue vs react
import React, { useEffect, useState } from "react";
interface PerfTestProps {
pressureLevel: number;
}
export function PerfTest({ pressureLevel }: PerfTestProps) {
const [items, setItems] = useState<number[]>([]);
@SirSerje
SirSerje / readme.md
Created February 20, 2025 02:40
proposal

Motivation

Based on the previous experience of the framework team—which follows a company-wide approach for column definitions, time management, and sprint organization—this document proposes several improvements. Most of the methods described here are already used by Agile Scrum teams of around 5–10 members, which aligns well with our current project goals.

1. Simplify the Columns and Workflow

Columns:

  • To Do – Newly created items or backlog items ready to be worked on.
  • In Progress – Development or active work is happening.
  • Review – Code review or peer review in progress.
  • QA – Tester verifies front-end and back-end functionality against acceptance criteria.
@SirSerje
SirSerje / readme.md
Last active December 19, 2024 01:55
my startup

Lazy vim

needs to be in config :

  • + u + f : disable autoformat
  • + e : explorer
  • shift + h : show hidden files

disable markdown LSP

nice to have

I apologize for the misunderstanding earlier. Let’s focus on diagnosing why your custom state management solution is running slower than NGXS, despite appearing to have a simpler implementation. We’ll explore potential bottlenecks in your code, compare them with NGXS’s optimizations, and provide actionable recommendations to enhance performance.

  1. Potential Performance Bottlenecks in Your Custom Store

a. Usage of Immer’s produce Function

•	Issue: While Immer simplifies immutable state updates, it introduces overhead by creating proxies and performing structural sharing. This can become a performance bottleneck, especially with frequent or large state updates.
•	Impact: Each call to set involves produce, which can slow down state mutations, particularly in applications with complex or large state trees.

b. Local Storage Operations on Every State Update

### ALIASES
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
@SirSerje
SirSerje / memo.js
Created November 10, 2021 16:13
Memo on a budget
const add = (a,b) => a+b;
function memo (fn) {
let args = [];
function result(a,b) {
let hasMemo = args.reduce((acc, i) => {
if(i.a === a && i.b === b) {
return i;
}
@SirSerje
SirSerje / 1.js
Last active October 25, 2021 18:45
2 - Object Oriented Programming
class Counter {
constructor(i = 0) {
// this.counter = 999
this._count = i
}
addOne() {
this._count++
}
@SirSerje
SirSerje / index.ts
Created October 25, 2021 14:33
Typescript example or how you can use OOP on more object oriented languages, like C / Java
console.clear() //just clear console
//any instantinated dog should bark somehow
interface IBark {
bark: (param: any) => string
}
// abstract for class means, class should be extended, not instantinated
abstract class AbstractDog implements IBark {
private weight: number = 15;
@SirSerje
SirSerje / extendArrayFucntionality.js
Last active October 21, 2021 06:16
1 - prototype inheritance
Array.prototype.odd = function () {
return this.filter(i => i%2 === 1)
}
console.log([1,2,3,4,5,6].odd())
@SirSerje
SirSerje / tsconfig.json
Created February 9, 2021 08:10
Cant resolve aliases for Webpack with Typescript for React
{
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": false,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,