Skip to content

Instantly share code, notes, and snippets.

View kaineer's full-sized avatar
:octocat:
⌨️ 🖱️

Sergey Kluchkovsky kaineer

:octocat:
⌨️ 🖱️
View GitHub Profile
@kaineer
kaineer / Form.jsx
Created April 14, 2025 10:09
method
useEffect(() => {
if (row) {
nameRef.current?.value = name;
cityRef.current?.value = city;
}
}, [row]);
@kaineer
kaineer / foo.js
Created April 11, 2025 12:46
integer
const displayWidth = 8;
const maxInt = parseInt("9".repeat(displayWidth));
const minInt = parseInt("-" + "9".repeat(displayWidth - 1));
const wrongValue = new RuntimeError('некорректное значение');
const wrongOperation = new RuntimeErr('некорректная операция (переполнение)')
const createInteger = (string) => {
const value = parseInt(string);
@kaineer
kaineer / debian-zoom-remove-ibus.md
Created April 9, 2025 16:25 — forked from zxchris/debian-zoom-remove-ibus.md
Zoom for Debian - Removing ibus dependency

Patching zoom_amd64.deb to remove ibus dependency

Installing ibus on Debian has a tendency to stop the keyboard working, particularly in KDE system dialogue boxes and search feilds. ibus is not really required, so patching the deb to prevent the install from also installing ibus as a required dependecy solves the problem:

S=$(mktemp -d)
dpkg -x zoom_amd64.deb $S
dpkg -e zoom_amd64.deb $S/DEBIAN
sed -i -E 's/(ibus, |, ibus)//' $S/DEBIAN/control 
dpkg -b $S zoom_amd64-no-ibus.deb 
@kaineer
kaineer / howto-2to3.md
Created March 24, 2025 08:05
Пересдача

Предварительно

  • Создаем новое реакт-приложение. Нет, старое не подойдет, мне нужно проверить способность создавать приложение самостоятельно
  • Добавляем react-router и react-router-dom
  • Добавляем react-redux и @reduxjs/toolkit

Основная часть

  • Делаем роутинг с использование react-router, так чтобы было, как минимум, две страницы
  • Плюсом будет добавление ссылок для навигации между страницами
@kaineer
kaineer / App.jsx
Created March 21, 2025 10:50
app.jsx
import './App.css'
import { store } from './store/index'
import { Provider } from 'react-redux'
import { Row } from './components/row'
import { Cell } from './components/cell'
function App() {
return (
<Provider store={ store }>
@kaineer
kaineer / core.ts
Created March 17, 2025 09:56
auth_url
const authUrl = (path: string): string => {
return (
__APPLICATION__.__APPLICATION__CONFIG__.services.auth_server_service
+ path
);
}
@kaineer
kaineer / NewTask.jsx
Created March 4, 2025 11:01
new-task
import classes from './NewTask.module.css'
import { TodosSlice } from '../../slices/todo';
import { useDispatch } from 'react-redux'
export const NewTask = ({ addTask }) => {
const { actions: { appendTask } } = TodosSlice;
const dispatch = useDispatch();
const handleEnter = (e) => {
if (e.key === 'Enter') {
import { useDispatch } from 'react-redux';
import { TodosSlice } from '../../slices/todo'
import classes from './Task.module.css'
import clsx from 'clsx'
export const Task = ({ task }) => {
const { actions: { removeTask, toggleTask } } = TodosSlice;
const dispatch = useDispatch();
return (
@kaineer
kaineer / TaskList.jsx
Created March 4, 2025 10:59
tasklist
import { Task } from './Task'
import { TodosSlice } from '../../slices/todo';
import { useSelector } from 'react-redux';
export const TaskList = () => {
const { selectors: { getTasks } } = TodosSlice;
const tasks = useSelector(getTasks);
return (
<ul>