Skip to content

Instantly share code, notes, and snippets.

View b2whats's full-sized avatar
🎯
Focusing

Akimov Vladimir b2whats

🎯
Focusing
View GitHub Profile
Так мы пушим нотификации из любого места системы, статическое свойство класса.
NotificationManager.addMessage({
id?: number | string,
content: React.Node,
timeout?: number,
onClose?: (event: SyntheticEvent<HTMLElement>) => void
})
@b2whats
b2whats / index.html
Created July 9, 2018 13:16 — forked from RubaXa/index.html
(key in object) vs. (object[key] !== void 0) vs. object.hasOwnProperty(key) (http://jsbench.github.io/#1aebf699d73fb743127903c0b0a8bece) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>(key in object) vs. (object[key] !== void 0) vs. object.hasOwnProperty(key)</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
{ __esModule: true,
is: [function is(type /*: string*/, node /*: Object*/, opts /*:: ?: Object*/, skipAliasCheck /*:: ?: boolean*/) /*: boolean*/ ],
isType: [function isType(nodeType /*: string*/, targetType /*: string*/) /*: boolean*/ ],
validate: [function validate(node, key, val) ],
shallowEqual: [function shallowEqual(actual /*: Object*/, expected /*: Object*/) /*: boolean*/ ],
appendToMemberExpression: [function appendToMemberExpression(member /*: Object*/, append /*: Object*/, computed /*:: ?: boolean*/) /*: Object*/ ],
prependToMemberExpression: [function prependToMemberExpression(member /*: Object*/, prepend /*: Object*/) /*: Object*/ ],
ensureBlock: [function ensureBlock(node /*: Object*/) ],
clone: [function clone(node /*: Object*/) /*: Object*/ ],
cloneDeep: [function cloneDeep(node /*: Object*/) /*: Object*/ ],
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@b2whats
b2whats / index.html
Last active August 15, 2017 14:38 — forked from RubaXa/index.html
String#includes vs. String#indexOf vs. RegExp (http://jsbench.github.io/#e9d85ace4fc1febe3744e39d2a2269db) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>String#includes vs. String#indexOf vs. RegExp</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
scheme: {
rowHeight: 45,
headerHeight: 30,
rowClick: true,
checkbox: true,
counter: true,
columns: [{
type: 'text',
dataKey: 'name',
label: 'Name',
function getSnack (type) {
var snack;
function isDrink () {
return snack = 'Drink';
}
function isFood () {
return snack = 'Food';
}
var snacks = {
'coke': isDrink,
@b2whats
b2whats / duck-on-wheels.js
Created December 28, 2016 22:05 — forked from nickbalestra/duck-on-wheels.js
An example of Duck Redux Reducer Bundle with Cycle.js apps to handle async
import xs from 'xstream'
import { combineCycles } from 'redux-cycle-middleware'
import { push } from 'react-router-redux'
import { API_URL } from '../constants/api'
// ACTION TYPES (Format: app-name/reducer/ACTION_TYPE)
// =======================================================
const LOGIN = 'app-name/auth/LOGIN'
const LOGIN_SUCCESS = 'app-name/auth/LOGIN_SUCCESS'
const LOGIN_FAIL = 'app-name/auth/LOGIN_FAIL'
import React, { Component, PropTypes } from 'react'
import { mapProps, compose, withState, setPropTypes, defaultProps, withHandlers } from 'recompose'
import { is } from 'ramda'
import { useSheet } from 'ui/styles/jss'
import { heightRow } from 'ui/styles/styles'
import { blackList } from 'ui/utils/'
import { Input } from '../input/'
import { DropDown, DropDownItem } from '../dropdown/'
import { ArrowIcon } from '../icons/'