Skip to content

Instantly share code, notes, and snippets.

View mishelen's full-sized avatar

Mikhail Hozhy mishelen

  • Krakow, Poland
  • 07:05 (UTC +02:00)
View GitHub Profile
class AutoComplete {
constructor(input, config) {
this.input = typeof input == "string" ? document.querySelector(input) : input;
this.wholeSuggestList = config.wholeSuggestList;
this.suggestListMathes = [];
this.options = Object.assign({
delay: 150,
suggestListClassName: 'suggestions list-unstyled',
maxSuggestions: 7,
minChars: 1
.list-unstyled {
list-style: outside none none;
padding-left: 0;
}
#suggestions-block {
margin-top : 1em;
margin-bottom : 1em;
}
.suggestions {

Успел сделать только прототип плагина. С проблемами не столкнулся, просто не успел. Думаю их будет хватать. А пока уже практически познакомился с ES6.

@mishelen
mishelen / tiktak.js
Created February 9, 2017 00:09
Node Test Task
const WebSocket = require('ws');
const ws = new WebSocket('ws://nuclear.t.javascript.ninja');
const coincidences = {};
const states = {};
const historyLimit = 5;
ws.on('open', () => console.log('Launched'));
ws.on('error', e => console.log(e));
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Input, FormFeedback, FormText } from 'reactstrap';
export const renderTextField = ({ input, meta: { touched, error, warning }, ...custom }) => (
<Fragment>
<Input {...(touched ? { valid: !error } : {})} {...input} {...custom} />
{error && <FormFeedback>{error}</FormFeedback>}
{!error && warning && <FormText>{warning}</FormText>}
</Fragment>
@mishelen
mishelen / git-tag-delete-local-and-remote.sh
Created May 20, 2018 09:12 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@mishelen
mishelen / partioningExecutor.js
Created November 16, 2018 14:21
Suppose you want to do complex calculations in JavaScript without blocking the Event Loop. You could partition your calculations so that each runs on the Event Loop but regularly yields (gives turns to) other pending events. In JavaScript it's easy to save the state of an ongoing task in a closure
function asyncExec(func, load, jobs) {
let done = false;
let value;
const makeDone = () => done = true;
return new Promise((resolve) => {
function executor(cb) {
if (!done) {

Keybase proof

I hereby claim:

  • I am mishelen on github.
  • I am mikhailhozhy (https://keybase.io/mikhailhozhy) on keybase.
  • I have a public key ASAIL8mzEusmbytMswbHDW0AlPeqiPReyenSqqL_OQBzsAo

To claim this, I am signing this object: