Skip to content

Instantly share code, notes, and snippets.

View akinolu52's full-sized avatar
🚀
Doings

Akinyemi Emmanuel akinolu52

🚀
Doings
View GitHub Profile
@akinolu52
akinolu52 / ansible-assignment.yaml
Created April 3, 2024 14:26
provision using ansible
---
- hosts: centos
become: true
tasks:
- name: install httpd package
yum:
name: httpd
state: latest
import styled from 'styled-components/native';
const ProgressBar = ({progress, height = 8, outerBackgroundColor, innerBackgroundColor, padded = true}) => (
<Container
height={height}
padded={padded}
outerBackgroundColor={outerBackgroundColor}
 >
<Content 
@akinolu52
akinolu52 / async-local-storage..js
Last active October 27, 2021 21:57
An implementation of react-native-async-storage
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;
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];
}
@akinolu52
akinolu52 / flatten_array.js
Created January 6, 2019 22:18
to flatten an array in Javascript
function flattenArray(arr) {
return arr.reduce((acc, e) => Array.isArray(e) ? acc.concat(flattenDeep(e)) : acc.concat(e), []);
}