Skip to content

Instantly share code, notes, and snippets.

View kdichev's full-sized avatar
⚛️
useEffect(() => { setWorking(true) }, [])

Konstantin Dichev kdichev

⚛️
useEffect(() => { setWorking(true) }, [])
View GitHub Profile
@kdichev
kdichev / endpoints.graphql
Created June 19, 2018 20:17
Car endpoints
mutation {
createCar(
name: "car"
carBrand: "Mercedes-Benz"
carMode: "C63 AMG"
carYear: "2018-06-19T19:51:13.701Z"
) {
id
carBrand
}
const data = [
[
'west',
'north'
],
[
'north'
],
[
'north'
@kdichev
kdichev / grid.js
Last active August 30, 2018 18:21
// data contains width * height walkable path entries
// each entry has at most two walls "west" | "north"
// to find all walkable directions from X use the array entries X, X+1 and X+width to construct walls
// grid is 15x15 blocks
const data = [["west","north"],["north"],["west","north"],["north"],["north"],["west","north"],["north"],["north"],["west","north"],["north"],["north"],["north"],["west","north"],["north"],["north"],["west","north"],["west"],["west"],["north"],["west"],["west"],["west"],["west"],["north"],["north"],[],["west"],["north"],["north"],[],["west"],[],["west"],["west"],["north"],[],["west"],["north"],["north"],["west","north"],["north"],[],["west","north"],["north"],["west"],["west"],["north"],["north"],["west"],["north"],["north"],["north"],["north"],["west"],["north"],["north"],["north"],["west"],["west"],["west"],["west","north"],["north"],["west"],["west"],["west","north"],["north"],["north"],["west"],["west","north"],["north"],["west"],["west"],[],["west"],["north"],["west"],["west
@kdichev
kdichev / data.js
Created September 4, 2018 16:33
example
// that needs to become something readable for a pathfinding algorithm like
// [
// [0, 0, 0, 1, 0],
// [1, 0, 0, 0, 1],
// [0, 0, 1, 0, 0],
// ]
const apiData = [
[
"west",
@kdichev
kdichev / test.js
Last active January 30, 2019 10:55
// bad
<div
className={`miniBook__tab miniBook__tabOneWay${oneWay ? ' miniBook__tab--active' : ''}`}
onClick={() => this.tabOnClick(oneWay)}
>
{children}
</div>
// better
<div
@kdichev
kdichev / master
Created March 17, 2020 10:36
this is our latest master build under our infrastructure.
2020-03-17T08:26:02.8640112Z yarn run v1.19.1
2020-03-17T08:26:02.9055760Z $ yarn validate:schema
2020-03-17T08:26:03.1232878Z $ node ./scripts/validate-local-schema.js
2020-03-17T08:26:03.3995455Z $ gatsby build
2020-03-17T08:26:04.7039219Z success open and validate gatsby-configs - 0.076s
2020-03-17T08:26:05.4198376Z success load plugins - 0.702s
2020-03-17T08:26:05.4353014Z success onPreInit - 0.004s
2020-03-17T08:26:05.4545610Z success delete html and css files from previous builds - 0.009s
2020-03-17T08:26:05.4693152Z success initialize cache - 0.005s
2020-03-17T08:26:05.5002112Z success copy gatsby files - 0.022s
dfds-kd:bench-app kdichev$ yarn run build
yarn run v1.17.3
$ gatsby build
success open and validate gatsby-configs - 0.038s
success load plugins - 0.682s
Loaded gatsby-source-contentful
Loaded gatsby-starter-plugin
success onPreInit - 0.022s
success delete html and css files from previous builds - 0.733s
success initialize cache - 0.019s