Skip to content

Instantly share code, notes, and snippets.

View iremlopsum's full-sized avatar

Kristjan Vool iremlopsum

View GitHub Profile
# Traffic light with Raspberry Pi
import RPi.GPIO as GPIO
import time
# import sys for warning
import sys
# Variable that states if polling should be used
polling = False
const FORM_INIT_STATE = {
firstName: { value: '' },
lastName: { value: '' },
email: { value: '' },
}
const STATE_VALIDATOR_SCHEMA = {
firstName: {
required: true,
validator: isLengthy,
validateOn: 'submit',
import React, { memo, useRef, useEffect } from 'react'
import { StyleProp, ViewStyle } from 'react-native'
import Animated, {
Value,
Node,
interpolate,
Extrapolate,
} from 'react-native-reanimated'
import size from '../styles/size'
import React, { memo, useRef, useEffect } from 'react'
import { StyleProp, ViewStyle } from 'react-native'
import Animated, {
Value,
Node,
interpolate,
Extrapolate,
concat,
} from 'react-native-reanimated'
import React, { memo, useRef, useEffect } from 'react'
import Animated, { Value, Node, interpolate } from 'react-native-reanimated'
import size from '../styles/size'
const SINGLE_ELEMENT_DELAY = 85
const SPRING_CONFIG = {
damping: 80,
mass: 6,
stiffness: 500,
overshootClamping: false,
/* eslint-disable react/jsx-props-no-spreading */
import React, { useRef, useCallback } from 'react'
import {
View,
StyleSheet,
TouchableOpacity,
GestureResponderEvent,
Dimensions,
} from 'react-native'
import { State, PanGestureHandler } from 'react-native-gesture-handler'
class ScrollView extends PureComponent {
state = {
// This actually lives within redux for me, but this list will be updated as the user navigates through chatbot
chatItems: [
{
message: 'Hello, this is bot',
},
{
message: 'I am here to help you',
},
// CT = time that line was written in the file
// TT = time token that is added to the signal
// SIGNAL = signal that comes through
CT: 2019-11-27T02:01:32.898Z |||||||||||| TT: 15748200927700660 |||||||||||| SIGNAL: 354.1.23.21
CT: 2019-11-27T02:02:57.890Z |||||||||||| TT: 15748201778069393 |||||||||||| SIGNAL: 344.1.26.21
CT: 2019-11-27T02:02:59.324Z |||||||||||| TT: 15748201792642008 |||||||||||| SIGNAL: 343.1.26.21
CT: 2019-11-27T02:03:37.618Z |||||||||||| TT: 15748202175587349 |||||||||||| SIGNAL: 305.1.28.21
CT: 2019-11-27T02:05:37.738Z |||||||||||| TT: 15748203376692547 |||||||||||| SIGNAL: 215.1.28.23
CT: 2019-11-27T02:05:39.579Z |||||||||||| TT: 15748203394570727 |||||||||||| SIGNAL: 213.1.28.23
interface SetupCallback {
/**
* @param { "0" | "1" | "2" } statusCode - Decides if registration through the native module was successful
* `"0"` - Registration was successful
* `"1"` - User canceled
* `"2"` - Registration failed
*
* @param { JSON } response - Response from the Amazon call that happens in the native module. Should include the following info:
* `authorizationCode`,
* `clientId`,
@iremlopsum
iremlopsum / AnimatedSvgMap.js
Created July 24, 2019 11:00
animatedSVGMap
import React, { PureComponent } from 'react'
import { View, StyleSheet, Animated, Easing } from 'react-native'
import { scale } from 'react-native-size-matters'
import Svg, { G, Path } from 'react-native-svg'
import withStore from '@new-redux/withStore'
import { Colors } from '../../../Values'
import { getCountryColor } from '../../../Helper/worldHelper'
import { VIEW_BOX, mapPathData } from '../svg-map-data'