Skip to content

Instantly share code, notes, and snippets.

View dmitryshelomanov's full-sized avatar
🎯
Focusing

Shelomanov Dmitry dmitryshelomanov

🎯
Focusing
View GitHub Profile
const paletteHelpers = {
wrapStyles(styles) {
StyleSheet.create(styles)
},
createColor(styles) {
for (let classProp in styles) {
for (let styleProp in styles[classProp]) {
const style = styles[classProp][styleProp]
import { StyleSheet } from 'react-native'
export const colors = {
dark: 'hsl(0, 0%, 0%)',
warm_grey_87: ' hsl(0, 0%, 53%)',
greyish_brown_87: 'rgba(87, 87, 87, 0.87)',
yellow_orange: 'hsl(0, 0%, 34%)',
brick: 'hsl(1, 67%, 47%)',
marigold: 'hsl(46, 100%, 50%)',
const data = [4, 3, 5, 0, 1, 10, 8, 2, 9]
function insertedSort(data) {
for (let i = 0; i < data.length; i++) {
for (let j = i; j > 0 && data[j] < data[j - 1]; j--) {
[data[j], data[j - 1]] = [data[j - 1], data[j]]
}
}
return data
}
const withHideHeader = (key, WrapComponent) => (props) => {
const { params = {} } = getCurrentState(props.scene.route)
if (params[key]) {
return null
}
return <WrapComponent {...props} />
}
function getCurrentState(state = {}) {
export const colors = {
dark: '#272b37',
warm_grey_87: 'rgba(134, 134, 134, 0.87)',
greyish_brown_87: 'rgba(87, 87, 87, 0.87)',
yellow_orange: 'rgb(250, 185, 0)',
brick: 'rgb(200, 43, 39)',
marigold: 'rgb(255, 197, 0)',
greyish_brown: 'rgb(57, 55, 53)',
dusty_orange: 'rgb(236, 106, 51)',
black_38: 'rgba(0, 0, 0, 0.38)',
import React from 'react'
import {
View,
TouchableOpacity,
Text,
StyleSheet,
ActivityIndicator,
} from 'react-native'
import LinearGradient from 'react-native-linear-gradient'
import PropTypes from 'prop-types'
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<LinearGradient
colors={['#93C6F9', '#97B4FA', '#A768FE']}
start={[0, 0]}
end={[1, 0]}
style={{ padding: 15, alignItems: 'center', borderRadius: 5 }}>
<Text
style={{
backgroundColor: 'transparent',
fontSize: 15,
const exec = require('./promisify-exec')
const command = []
async function start() {
for (let i = 0; i < command.length; i++) {
const data = await exec(command[i])
console.log(data)
}
// topRoute.routeName === 'Entry' || topRoute.routeName === 'Login' || topRoute.routeName === 'Main'
getScene(topRoute.routeName)
function getScene(routeName) {
const names = ['Entry', 'Login', 'Main']
return names.indexOf(routeName !== -1)
}
import {
createAction,
createActions,
handleAction,
handleActions,
combineActions
} from 'redux-actions'
import { combineReducers } from 'redux'
import axios from 'axios'