This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function occurenceOfCharacters (string) { | |
| const map = new Map() | |
| for (let i = 0; i < string.length; i++) { | |
| const char = string[i] | |
| if (!map.get(char)) { | |
| map.set(char, 1) | |
| } else { | |
| const currentCount = map.get(char) | |
| map.set(char, currentCount + 1) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Place your settings in this file to overwrite the default settings | |
| { | |
| "stylelint.enable": true, | |
| "window.zoomLevel": 0, | |
| "workbench.colorTheme": "Nord", | |
| "editor.fontSize": 14, | |
| "editor.formatOnSave": true, | |
| "editor.lineNumbers": "relative", | |
| "vim.easymotion": true, | |
| "vim.leader": "<space>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react" | |
| import Swiper from "react-native-deck-swiper" | |
| import { StyleSheet, View, Text, Image, Button } from "react-native" | |
| export default class Exemple extends Component { | |
| constructor(props) { | |
| super(props) | |
| this.state = { | |
| cards: [1, 2], | |
| swipedAllCards: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| nearestBranchRequest, | |
| nearestBranchSuccess, | |
| nearestBranchFailure, | |
| INITIAL_STATE | |
| } from '../branchReducer'; | |
| describe('branch reducer tests', () => { | |
| it('given latitude and longitude when nearestBranchRequest then should set latitude, longitude and searching to true', () => { | |
| const latitude = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ACTION_TYPES } from '../actions/branchActions'; | |
| const { | |
| NEAREST_BRANCH_SUCCESS, | |
| NEAREST_BRANCH_REQUEST, | |
| NEAREST_BRANCH_FAILURE | |
| } = ACTION_TYPES; | |
| export const INITIAL_STATE = { searching: false, nearestBranch: null }; | |
| export default (state = INITIAL_STATE, action) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import update from 'immutability-helper'; | |
| import {cloneDeep} from 'lodash'; | |
| const selectedChoice = {isChosen: true}; | |
| const choices = [selectedChoice, selectedChoice, selectedChoice]; | |
| const options = {choices: choices}; | |
| const selectedOptions = [options, options]; | |
| const OPTION_INDEX = 0; | |
| const CHOICE_INDEX = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Dimensions} from 'react-native' | |
| const {width, height} = Dimensions.get('window') | |
| const calculateFontSizeForAScreenSizePercentage = (percentage) => { | |
| return Math.sqrt((width * width) + (height * height)) * (percentage / 100) | |
| } | |
| const baseUnit = calculateFontSizeForAScreenSizePercentage(2.5) | |
| const em = (value) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { | |
| Component | |
| } from 'react' | |
| import { | |
| AppRegistry, | |
| Easing, | |
| StyleSheet, | |
| Text, | |
| Image, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { | |
| Component | |
| } from 'react' | |
| import { | |
| AppRegistry, | |
| Easing, | |
| StyleSheet, | |
| Text, | |
| Image, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'react-native' | |
| import React from 'react' | |
| import CircleTransition from '../CircleTransition.js' | |
| // Note: test renderer must be required after react-native. | |
| import renderer from 'react-test-renderer' | |
| const positionTest = (position) => { | |
| const tree = renderer.create( | |
| <CircleTransition |