Skip to content

Instantly share code, notes, and snippets.

View ivan-kleshnin's full-sized avatar
🏠
Working from home

Ivan Kleshnin ivan-kleshnin

🏠
Working from home
View GitHub Profile
@ivan-kleshnin
ivan-kleshnin / gist:601503b9062ba45863d5
Last active December 30, 2022 05:57
Brainstorming middleware ordering... Wider application though.
;; 0. Given that `app` is a RING handler
;; 1. We have 6 functions: 3 to modify requests, 3 to modify responses
;; 1.1. Request modifiers
(defn modify-request-first [handler]
(fn [request]
(println "modify-request-first") ; "println" is a placeholder for real code
(handler request)))
@ivan-kleshnin
ivan-kleshnin / course.md
Last active October 5, 2022 07:29
Some courses I've finished (a sample of a full list, as of now)

Quest for a good UI library

Quick notes for myself.

MUI

  • Emotion based 📝
  • Large ecosystem 👍
  • A lot of components 👍
  • Also hooks and utils 👍
const experiences = [
// all `nulls`s
{id: 1, name: "FOO", startDateYear: null, startDateMonth: null, endDateYear: null, endDateMonth: null},
// three `null`s
{id: 2, name: "FOO", startDateYear: 2022, startDateMonth: null, endDateYear: null, endDateMonth: null},
{id: 3, name: "FOO", startDateYear: null, startDateMonth: 2, endDateYear: null, endDateMonth: null},
{id: 4, name: "FOO", startDateYear: null, startDateMonth: null, endDateYear: 2022, endDateMonth: null},
{id: 5, name: "FOO", startDateYear: null, startDateMonth: null, endDateYear: null, endDateMonth: 2},
@ivan-kleshnin
ivan-kleshnin / react-query-checks.tsx
Last active December 25, 2021 07:02
React-Query-Checkx
/*
Check this: https://tkdodo.eu/blog/status-checks-in-react-query
Check this: https://github.com/ivan-kleshnin/react-query-status-checks
*/
// TWO PARALLEL QUERIES, RESULTS ARE RENDERED SEPARATELY
export function Controller() : JSX.Element {
const query1 = useQuery("...first")
const query2 = useQuery("...second")

1. HTTP Performance

1.1 Reduce number of HTTP Requests

  • Use HTTP/2
  • GraphQL
  • CSS sprites
  • Bundling
  • Browser Caching
  • Cache Busting
// Publish-Subscribe
// Observable – Observer
// Publisher - Listener
// Emitter - Handler
/*
Updates:
0) off
1) once
2) raise event on add listener

paqmind

ФУЛЛСТЕК РАЗРАБОТКА для продвинутых

Утомили пересказы документации и Hello-World туториалы?

На Paqmind регулярно публикуем уникальный авторский контент по
веб-разработке и программированию для уровней Junior+, Middle и выше.

  • современные технологии и тренды
@ivan-kleshnin
ivan-kleshnin / promise.js
Created June 19, 2019 11:33 — forked from vkarpov15/promise.js
Simple Promises/A+ Compliant Promise
const assert = (v, err) => {
if (!v) {
throw err;
}
};
let counter = 0;
class Promise {
constructor(executor) {