Skip to content

Instantly share code, notes, and snippets.

View exah's full-sized avatar
🇺🇦
Slava Ukraini

John Grishin exah

🇺🇦
Slava Ukraini
View GitHub Profile
import { mq } from '@revolut/ui-kit'
import { size } from 'polished'
import { css } from 'styled-components'
const AVATAR_S = css`
${size(40)}
font-size: 1.25rem;
font-weight: 500;
line-height: 1.2;
const toISO = (date) => new Date(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
).toISOString().slice(0, -1)
@exah
exah / Dockerfile
Last active November 18, 2017 10:23
Slim Multi-Stage JS App Image
# Base
FROM node:8-alpine AS base
ENV APP_DIR /app/
ENV NODE_ENV production
WORKDIR $APP_DIR
ADD package.json yarn.lock $APP_DIR
RUN yarn
CMD []
.container {
display: flex;
justify-content: space-between;
&::before { content: ''; }
&::after { content: ''; }
}
.el {
width: 100px;

Keybase proof

I hereby claim:

  • I am exah on github.
  • I am exah (https://keybase.io/exah) on keybase.
  • I have a public key ASC_9SV4OWQ-PDFzWqiA5ALleoi73WU0vILNn4yJgvy9Dwo

To claim this, I am signing this object:

@exah
exah / promisify.js
Last active October 26, 2016 13:00
Simple Promisify Function
// Compact version
const promisify = (fn, ...args) => new Promise((resolve, reject) =>
fn(...args, (error, result) => error && reject(error) || resolve(result))
)
// Example
// function myAsyncFn(options = Object, callback = Function) {}
// Like Promise
promisify(myAsyncFn, { msg: 'test' }).then(result => console.log(result))
@exah
exah / globals.js
Last active October 9, 2016 10:33
Log global variables
// Based on https://davidwalsh.name/global-variables-javascript
(function logGlobals() {
var iframe = document.createElement('iframe');
iframe.onload = function() {
var iframeKeys = Object.keys(iframe.contentWindow);
var windowKeys = Object.keys(window);
windowKeys.forEach(function(key) {
if (iframeKeys.indexOf(key) === -1) {
@exah
exah / vue-redux-store-mixin.js
Last active April 4, 2016 16:14
Simple Vue + Redux mixin
import { bindActionCreators } from 'redux';
export default (
store,
actions,
stateKey = 'state',
actionsKey = '$actions'
) => {
const getFrozenState = () => Object.freeze( store.getState() );
@exah
exah / _css-arrow.scss
Last active December 12, 2015 09:59
SCSS Arrow Please Mixin – append arrow to any element with ease.
/* !SCSS Arrow Please Mixin – append arrow to any element with ease.
Inspired by http://cssarrowplease.com
Copyleft: John Grishin (@exah)
Usage:
1. Import mixin in your SCSS file: @import "_css-arrow.scss";
2. Write in your rule: @include arrow($direction, $width, $bg-color, [$border-color], [$border-width]);
Direction parameters: top, bottom, left, right.