Skip to content

Instantly share code, notes, and snippets.

View limarc's full-sized avatar
🚀

Alex Lobashev limarc

🚀
  • Cyprus, Limassol
View GitHub Profile
// Define global React
if (typeof window !== 'undefined') {
window.React = React;
}
// https://github.com/facebook/react/blob/e3131c1d55d6695c2f0966379535f88b813f912b/src/renderers/dom/ReactDOM.js
Object.defineProperty(
window, '__REACT_DEVTOOLS_GLOBAL_HOOK__', {
value: {
inject: function(runtime){ this._reactRuntime = runtime },
// Unique with use object
function uniqueObject(array) {
var hash = Object.create(null);
var result = [];
var value;
for (var i = 0; i < array.length; i++) {
value = array[i];
if (!hash[value]) {
hash[value] = true;

Frontend Skills

Browser

  1. HTML
    1. Namespaces (html, svg, xhtml)
    2. Doctype
  2. Network
    1. HTTP/HTTP2
    2. Headers/Cookie
  3. Protocol Data (Restful/JSONRPC)
@limarc
limarc / vscode-settings.js
Last active October 2, 2018 16:02
VSCode settings
{
"editor.fontFamily": "Consolas, monospace",
"editor.fontSize": 15,
"editor.lineHeight": 20,
"workbench.colorTheme": "Material Theme",
"editor.fontLigatures": true,
"explorer.decorations.badges": false,
"window.nativeTabs": true,
"workbench.statusBar.visible": true,
"window.zoomLevel": 0,
@limarc
limarc / jscodshift-transforms.txt
Last active May 13, 2017 21:44
jscodshift transforms
require-default-codeshift.js
https://gist.github.com/nsfmc/aebef4e7a4944819ff40
transform-mobx-map.js
https://gist.github.com/bjrnt/bc5e3079a59924cde995963fcf0bf741
transform-sort-imports.js
https://gist.github.com/deoxxa/4d7aff457058adb44c8f643130bd3c00
rm-merge.js
@limarc
limarc / button.js
Last active January 11, 2018 16:34
React component + Flow
// @flow
import React, { type Node } from 'react';
import classnames from 'classnames';
import styles from './button.css';
type Design = 'primary' | 'ghost' | 'invisible' | 'danger';
type Size = 's' | 'm' | 'l';
type Element = {|
// HTMLButtonElement props