Skip to content

Instantly share code, notes, and snippets.

View kettanaito's full-sized avatar
🚀
Extremely busy. Open source activity paused.

Artem Zakharchenko kettanaito

🚀
Extremely busy. Open source activity paused.
View GitHub Profile
@kettanaito
kettanaito / Component.jsx
Last active June 25, 2018 09:49
Atomic layout - Numeric (px)
import { Composition } from 'atomic-layout'
<Composition
gutter={10} // compiles to "10px" of "grid-gap"
paddingVertical={25} // compiles to "25px" of "padding-top" and "padding-bottom"
/>
@kettanaito
kettanaito / App.js
Last active December 2, 2018 20:17
Medium - Atomic layout - Numeric - Custom
import Layout from 'atomic-layout'
Layout.configure({
defaultUnit: 'rem' // append "rem" instead of "px" to all numeric values by default
})
// rest of the App code here, such as ReactDOM.render()
@kettanaito
kettanaito / Component.jsx
Created June 25, 2018 09:48
Atomic layout - Numeric (combination)
import { Composition } from 'atomic-layout'
<Composition
gutter={10} // compiles to "10px" of "grid-gap"
padding="2rem" // compiles to explicit "2rem" of "padding"
height="95vh" // compiles to explicit "95vh" of "height"
/>
@kettanaito
kettanaito / redux-boilerplate-comparison.txt
Created August 19, 2018 19:34
Rexux boilerplate comparison
https://github.com/markerikson/redux-starter-kit/issues/17#issuecomment-414091942
handlePeopleInFlatChange = ({ nextValue }) => {
this.setState({ peopleInFlat: nextValue })
}
render() {
const { peopleInFlat } = this.state
return (
@kettanaito
kettanaito / RegistrationForm.jsx
Last active November 3, 2018 08:38
Form Case Study: Field grouping
import React from 'react'
import { Form, Field } from 'react-advanced-form'
import { Input } from '@fields'
export default class RegistrationForm extends React.Component {
registerUser = ({ serialized }) => {
console.log(serialized)
/**
* {
* billingAddress: {
const path = require('path')
const webpack = require('webpack')
const express = require('express')
const WebpackDevServer = require('webpack-dev-server')
const webpackHotMiddleware = require('webpack-hot-middleware')
const print = require('../bin/utils/print')
const getWebpackConfig = require('../webpack.config')
const promiseCompile = (compiler) => {
return new Promise((resolve, reject) => {
@kettanaito
kettanaito / next.js
Created March 19, 2019 19:45
Grammar fun
const random = (list) => {
const index = Math.floor((Math.random() * (list.length)) + 0);
return list[index]
}
function next() {
const tenses = ['present', 'past', 'future']
const verbs = ['need', 'must', 'decide', 'forget', 'hope', 'learn', 'offer', 'plan', 'pretend', 'promise', 'promise', 'remember', 'start', 'try', 'want', 'would like', 'enjoy', 'finish', 'hate', 'like', 'love', 'spend (time)', 'stop', 'feel like']
const sentenceType = ['question', 'negative', 'regular']
@kettanaito
kettanaito / YourSile.js
Last active April 22, 2019 16:28
mdx-deck slide module
import React from 'react'
const YourSlide = () => (
<code>
function() {}
</code>
)
export default YourSlide
@kettanaito
kettanaito / responsive-values.jsx
Last active April 29, 2019 11:49
Responsive values analyzis
/* Examples of usage */
// I will leave out scaling feature, as we are looking at the API itself.
// styled-system
<Box padding={[2, 4, 8]} />
// atomic-layout
<Box padding={2} paddingMd={4} paddingLg={8} />
/* Comparison */
// styled-system