Skip to content

Instantly share code, notes, and snippets.

View Eliah7's full-sized avatar
🏠
Working from home

Eliah Mbwilo Eliah7

🏠
Working from home
View GitHub Profile
@Eliah7
Eliah7 / README.md
Created April 10, 2024 12:59 — forked from dims/README.md
Kubernetes Resources
############ Number Guessing Game #################
import random
import time
print('Hello World! Welcome to the game')
time.sleep(2)
n = random.randint(1, 10)
print('Number has been generated!!\nYou have 4 chances to guess the number')
count = 4
@Eliah7
Eliah7 / app
Last active April 30, 2021 07:13
const RoleBasedAccessApp: () => React$Node = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
options={{title: 'Login', headerShown: false}}
name={'/accounts/login'}
component={LoginPage}
/>
<Stack.Screen
export async function applyGuards(guards: Promise[], navigation): boolean {
if (guards && Array.isArray(guards) && guards.length > 0) {
try {
const results = [];
for (const guard of guards) {
results.push(await guard(navigation));
}
return results.reduce((a, b) => a && b, true);
} catch (e) {
// throw e;
import React, {useEffect, useState} from 'react';
import {applyGuards} from '../utils/guarded.util';
import {useNavigation} from '@react-navigation/native';
import {LoadingComponent} from './loading.component';
import {StyleSheet, View} from 'react-native';
export const RoleBasedView = function ({component, guards, loadingView}) {
const navigation = useNavigation();
const [rba, setRba] = useState(false);
var express = require('express');
var app = new express();
app.get('/', function (request, response) {
// your logic
response.send('get users');
});
app.post('/user', function (request, response) {
// your logic
bfast fs create <NAME_OF_PROJECT>