This file contains 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
--- | |
- hosts: centos | |
become: true | |
tasks: | |
- name: install httpd package | |
yum: | |
name: httpd | |
state: latest |
This file contains 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 styled from 'styled-components/native'; | |
const ProgressBar = ({progress, height = 8, outerBackgroundColor, innerBackgroundColor, padded = true}) => ( | |
<Container | |
height={height} | |
padded={padded} | |
outerBackgroundColor={outerBackgroundColor} | |
> | |
<Content |
This file contains 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 AsyncStorage from '@react-native-async-storage/async-storage'; | |
export const storeData = async (storageKey, value) => { | |
try { | |
const jsonValue = JSON.stringify(value) | |
await AsyncStorage.setItem(`@${storageKey}`, jsonValue); | |
return true; | |
} catch (e) { | |
// saving error | |
return false; |
This file contains 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
let k = { | |
x: ['mi', 'ko'], | |
y: [] | |
} | |
function clean(obj) { | |
for (let propName in obj) { | |
if (obj.hasOwnProperty(propName)) { | |
if (!obj[propName].length) { | |
delete obj[propName]; | |
} |
This file contains 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
function flattenArray(arr) { | |
return arr.reduce((acc, e) => Array.isArray(e) ? acc.concat(flattenDeep(e)) : acc.concat(e), []); | |
} |