Skip to content

Instantly share code, notes, and snippets.

View dy's full-sized avatar

Dmitry Iv. dy

View GitHub Profile
@dy
dy / ce-decorators.js
Last active October 26, 2019 00:24
Custom element decorators
export const customElement = (tagName, options) => (classOrDescriptor) => (typeof classOrDescriptor === 'function') ?
legacyCustomElement(tagName, options, classOrDescriptor) :
standardCustomElement(tagName, options, classOrDescriptor);
const standardCustomElement = (tagName, options, descriptor) => {
const { kind, elements } = descriptor;
return {
kind,
elements,
// This callback is called once the class is otherwise fully defined
@dy
dy / iskcon-vs-orthodox.md
Last active September 18, 2020 15:46
ISKCON / Orthodox Christianity

Некоторые наблюдения (или возможно искажения моего восприятия).

  1. Подать
  • В православии имеется тенденция идти навстречу просящим, нищим, прокаженным - святой Антоний побежал обнимать прокаженного, так как увидел в нем Бога.
  • В сознании Кришны есть тенденция не подавать тому, чью карму не готов на себя брать, тенденция избегать невежества и строить кастовые барьеры.
  1. Гордыня и оскорбления
  • В православии имеется тенденция смирения и кротости. В критике монах умывается.
  • В ИСКОН гордыня и зависть - симптом деградации из-за оскорбления преданного.
@dy
dy / react-vs-spect.md
Last active August 13, 2019 18:31
React vs spect

Same amount of code, same time:

  • no html side-effect restriction allows easily implement portals and get rid of useContext hooks
  • batched state allows simpler effect code
  • aspects integrate better with DOM, can be applied to any elements
  • aspects can be loaded gradually, not as single framework bundle, allowing progressive enhancement
  • aspects cross-cut concerns and can be developed independently
  • references enable transparency for components - allows cross-subscribing
@dy
dy / jquery.js
Last active August 1, 2019 02:56
Spect style
import $ from 'spect'
import { route } from 'wouter'
import { t } from 'ttag'
// main aspect
$('#app').aspect($app => {
let [ , { id } ] = route('user/:id')
$app.fx(() => $app
.attr({ loading: true })
@dy
dy / settings.json
Created July 17, 2019 15:56
Vscode settings
{
"workbench.colorTheme": "Eiffel",
"workbench.activityBar.visible": false,
"files.autoSave": "onFocusChange",
"files.trimTrailingWhitespace": true,
"window.menuBarVisibility": "default",
"workbench.statusBar.visible": false,
"editor.wordWrap": "on",
"files.insertFinalNewline": true,
"editor.tabSize": 2,
@dy
dy / context-new-menu.sh
Created May 31, 2019 07:14
Slow windows10 context > new menu
Get-AppxPackage *zune* | Remove-AppxPackage
Get-AppxPackage *sketch* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *wallet* | Remove-AppxPackage
Get-AppxPackage *solitai* | Remove-AppxPackage
Get-AppxPackage *bing* | Remove-AppxPackage
Get-AppxPackage *help* | Remove-AppxPackage
Get-AppxPackage *3d* | Remove-AppxPackage
Get-AppxPackage *reality* | Remove-AppxPackage
Get-AppxPackage *office* | Remove-AppxPackage
@dy
dy / infinite-scroll.jsx
Created April 23, 2019 15:15
Infinite-scroll-react
import React, { useState, useRef, useMemo } from 'react';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import Tooltip from '@material-ui/core/Tooltip';
import Paper from '@material-ui/core/Paper';
import MenuList from '@material-ui/core/MenuList';
import MenuItem from '@material-ui/core/MenuItem';
import ListItemText from '@material-ui/core/ListItemText';
import IconButton, { IconButtonProps } from '@material-ui/core/IconButton';
import ArrowLeftIcon from '@material-ui/icons/ArrowLeft';
@dy
dy / async.js
Created April 15, 2019 01:18
React async hooks
import { useCallback, useState, useEffect, useMemo, useRef } from 'react';
/*
Async hooks.
Take in async function & deps,
returns [value, error, loading] object.
*/
const defaultState = [undefined, null, true]
@dy
dy / recuperators.md
Last active March 3, 2019 01:37
Recuperator table
Model Country Efficiency Filter m3/h Ventilator Consumption price
MARLEY MENV-180 Germ
HELIOS KWLR EC 60 Germ
MAICO WRG 35-1-SE Germ
МELTEM M-WRG Germ
ТВИНФРЕШ Ukr
ПРАНА -200G Ukr
УРВК -50 Ru
Двухмоторная установка СПВВР Ru