Skip to content

Instantly share code, notes, and snippets.

View lokhmakov's full-sized avatar
🎯
Sciences are divided into natural, unnatural and against natural

Pavel Lokhmakov lokhmakov

🎯
Sciences are divided into natural, unnatural and against natural
View GitHub Profile
@lokhmakov
lokhmakov / ddd.md
Created September 23, 2021 12:56 — forked from zsup/ddd.md
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@lokhmakov
lokhmakov / animation-perf-test.markdown
Created September 10, 2020 08:27
Animation Perf Test
@lokhmakov
lokhmakov / lsdb.ts
Created December 7, 2019 08:25 — forked from zerobias/lsdb.ts
Reactive database with localStorage and effector
import {
createEvent,
createStore,
createEffect,
combine,
forward,
Effect,
Store,
Event,
step
@lokhmakov
lokhmakov / index.js
Last active October 25, 2022 08:37
effector - run effect once through event
const runQuery = createEffect({
handler(props) {
console.log(props)
},
})
const createOnceEvent = to => {
const from = createEvent()
const unsubscribe = forward({from, to})
from.watch(unsubscribe)
body {
background: blue;
}
import Grid from '@material-ui/core/Grid'
import Button from '@material-ui/core/Button'
import { MapMarker } from 'mdi-material-ui'
import Map from 'pigeon-maps'
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import compose from 'recompose/compose'
import lifecycle from 'recompose/lifecycle'
import withHandlers from 'recompose/withHandlers'
import withStateHandlers from 'recompose/withStateHandlers'
@lokhmakov
lokhmakov / CoreEntity.js
Created October 21, 2018 10:48
models/CoreEntity.js
const fs = require('fs').promises
const keystone = require('keystone')
const recast = require('recast')
const Types = keystone.Field.Types
const CoreEntity = new keystone.List('CoreEntity')
const generateModel = require('../lib/core/entity/api/generate/model').default
@lokhmakov
lokhmakov / model.js
Created October 21, 2018 10:41
core/entity/api/generate/model.js
import { builders as b } from 'ast-types'
import generateRequire from './require'
import generateListAdd from './listAdd'
export default ({
name,
fields = [],
@lokhmakov
lokhmakov / listAdd.js
Created October 21, 2018 10:37
core/entity/api/generate/listAdd.js
import { builders as b } from 'ast-types'
import generateField from './field'
export default ({
name,
fields = [],
}) => {
@lokhmakov
lokhmakov / field.js
Created October 21, 2018 10:33
core/entity/api/generate/field.js
import { builders as b } from 'ast-types'
const typeMap = {
'Boolean': b.identifier('Types.Boolean'),
'Date': b.identifier('Types.Date'),
'Number': b.identifier('Types.Number'),
'String': b.identifier('String'),
}