Skip to content

Instantly share code, notes, and snippets.

View dmitryshelomanov's full-sized avatar
🎯
Focusing

Shelomanov Dmitry dmitryshelomanov

🎯
Focusing
View GitHub Profile
import { createCharacter } from "@lib/pixi"
import { AnimatedIcons } from "@lib/pixi/icons"
import { root } from "@lib/root"
import { merge } from "effector"
import * as PIXI from "pixi.js"
import { GROUND_Y, HERO_X, TARGET_X } from "../constants"
import { attachEffect } from "../lib"
const { createEvent } = root
@dmitryshelomanov
dmitryshelomanov / alg.js
Last active September 10, 2022 12:54
tasks
function isPrime(num) {
for (let i = 2; i < num; i++) {
if (num % i === 0 && num !== 2 ) {
return false;
}
}
return true;
}
// Тут понятно найти простые
// @flow
import { of, Subject, defer, Observable } from "rxjs"
import { map, catchError, flatMap, switchMap } from "rxjs/operators"
import {
type Event,
type Store,
createEvent,
createStore,
merge,
// @flow
import { type Store, combine, forward } from "effector"
import { createGate } from "effector-react"
import { mapTo, createListFetching } from "@lib/effector-extend"
import type { GeoPoint, Event as CardEvent, Place } from "@lib/ws"
import {
wsSearchForPlacecEvents,
$likes,
combineEventsWithLikesState,
// @flow
import {
type Store,
type Effect,
type Event,
sample,
guard,
combine,
restore,
import { createEvent, createStore } from "effector";
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
const scoreElement = document.querySelector("#score");
const DIRECTIONS = {
LEFT: 37,
RIGHT: 39,
TOP: 38,
const LEFT = 65;
const RIGHT = 68;
function keyCodeToString(keyCode) {
const validSceme = [LEFT, RIGHT].includes(keyCode);
if (validSceme) {
const str = {
[LEFT]: "left",
[RIGHT]: "right"
import React, { Component } from 'react'
import validatejs from 'validate.js'
const validate = (fieldName, value, rule) => {
const result = validatejs({ [fieldName]: value }, { [fieldName]: rule })
if (result) {
return result[fieldName][0]
}
import React from 'react'
import { StyleSheet, Text, TouchableOpacity } from 'react-native'
import { Card, CardItem } from 'native-base'
import { nest, compose, withPropsOnChange } from 'recompose'
import * as Animatable from 'react-native-animatable-unmountable'
import { FlatListWithError } from 'features/common'
import { withLocalFetch } from 'react-local-fetch'
import { H3, Loader } from 'ui'
import { colors } from 'ui/colors'
import { Distance } from './distance'
function buildNumber (number) {
return (op) => {
if (typeof op === 'function') {
return op(number)
}
return number
}
}