Skip to content

Instantly share code, notes, and snippets.

View sompylasar's full-sized avatar

Ivan Babak sompylasar

View GitHub Profile
@sompylasar
sompylasar / ZIndexManager.js
Last active February 28, 2018 23:44
ZIndexManager – Stores and manages z-indexes in a stacking order. ZIndexManagerProvider – provides ZIndexManager functions via React context. Refs: https://hackernoon.com/my-approach-to-using-z-index-eca67feb079c
/**
* ZIndexManager
*
* Stores and manages z-indexes in a stacking order.
*/
export default class ZIndexManager {
constructor(onChange) {
this._zIndexMin = 99;
this._zIndexes = {};
this._zIndexMax = this._zIndexMin;
@sompylasar
sompylasar / Cypress.Commands.getVisuallyBelow.js
Created April 6, 2018 00:13
Cypress custom command that finds a visible element rendered visually below the previous subject. Using it to find inputs below labels that miss accessible identifiers. https://twitter.com/sompylasar/status/982027453764792320
// `queries.matches` is this function: https://github.com/kentcdodds/testing-workshop/blob/888201516879d067adddc6b6dd3c76394f0b2bee/cypress/support/queries.js#L74-L82
Cypress.Commands.add('getVisuallyBelow', { prevSubject: 'element' }, (subject, matcher) => {
const domNode = subject.get(0);
const log = Cypress.log({
name: 'GET_VISUALLY_BELOW',
message: '' + (
String(
domNode.nodeName +
@sompylasar
sompylasar / todo-md-generator.js
Created April 9, 2018 23:51
TODO.md generator
#!/usr/bin/env node
/* eslint-disable strict, no-console, prefer-arrow-callback, prefer-spread */
'use strict';
const glob = require('glob');
const leasot = require('leasot'); // eslint-disable-line import/no-extraneous-dependencies
const path = require('path');
const fs = require('fs');
const gitAdd = require('../_binUtils').gitAdd;
diff --git a/frontend/DataView/DataView.js b/frontend/DataView/DataView.js
index 1a7fd1a..ba35cc4 100644
--- a/frontend/DataView/DataView.js
+++ b/frontend/DataView/DataView.js
@@ -32,6 +32,7 @@ type DataViewProps = {
startOpen?: boolean,
noSort?: boolean,
readOnly?: boolean,
+ themeKind?: 'props' | 'state',
};
#!/bin/bash
set -eu
REPO_PATH=$1
if [[ ! -d "${REPO_PATH}" ]]; then
exit -1
fi
#!/bin/bash
set -eu
REPO_PATH=$1
SHA=$2
if [[ ! -d "${REPO_PATH}" ]]; then
exit -1
fi
@sompylasar
sompylasar / styles.less
Last active October 18, 2018 18:30
Atom 1.30: Adapt tree view and editor font size for large monitors (like the 27" ones). NOTE: This overrides the built-in editor text zoom feature (Cmd + / Cmd - / Cmd 0).
// Adapt tree view and editor font size for large monitors (like the 27" ones).
@media (min-width: 1800px) {
// Root font size
body {
font-size: 18px;
}
// Editor font size is specified separately
atom-workspace {
// NOTE: This overrides the built-in editor text zoom feature (Cmd + / Cmd - / Cmd 0).
@sompylasar
sompylasar / gmail-2018.css
Last active September 27, 2018 22:21
Tweaks to the GMail look&feel (apply via Stylebot Chrome extension)
.hx .ii,
div.G3.G2.afm {
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
div.T-I.J-J5-Ji.T-I-KE.L3 {
height: 30px;
margin: 0;
padding: 0 16px;
text-align: center;
justify-content: center;
.discussion-item-header[id^=ref-] .discussion-item-icon {
background-color: #6db2ff;
color: #ffffff;
}
.discussion-item-header[id^=ref-]::before {
content: '';
position: absolute;
display: block;
z-index: -1;
@sompylasar
sompylasar / .prettierrc
Last active November 22, 2018 21:36
Prettier config
{
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"semi": true,
"useTabs": false,
"jsxBracketSameLine": false,
"printWidth": 120
}