Skip to content

Instantly share code, notes, and snippets.

View alfredayibonte's full-sized avatar
🏀
omnia vincit labor

Alfred Ayi-Bonte alfredayibonte

🏀
omnia vincit labor
View GitHub Profile
@alfredayibonte
alfredayibonte / Recover-2factor-auth-for-gitlab
Created March 21, 2022 06:50
command helps you recovery your 2factor authentication code for gitlab
ssh git@gitlab.com 2fa_recovery_codes
import ComprehendMedical from 'aws-sdk/clients/comprehendmedical';
import Config from 'react-native-config';
import { getDrugDetails } from './utils';
export function acm(text) {
return new Promise((resolve, reject) => {
let comprehendmedical = new ComprehendMedical({
region: Config.AWS_REGION,
apiVersions: Config.AWS_MEDICAL_API_VERSION,
credentials: {
const URL = `https://vision.googleapis.com/v1/images:annotate?key=${Config.GOOGLE_VISION_API_KEY}`;
export function ocr(base64) {
const request = {
requests: [
{
image: {
content: base64
},
features: [
{
import React, { Component } from 'react';
const requestUrls = [
'https://jsonplaceholder.typicode.com/posts',
'https://jsonplaceholder.typicode.com/users',
'https://jsonplaceholder.typicode.com/todos',
'https://jsonplaceholder.typicode.com/comments',
'https://jsonplaceholder.typicode.com/albums',
'https://jsonplaceholder.typicode.com/photos'
]
let count = 0;
self.addEventListener('message', e => {
console.log('web worker is starting...')
let { requestUrls } = e.data;
const req = () => {
fireRequest(requestUrls[count], token)
.then((data) => {
//posts to component to be store in db.
@alfredayibonte
alfredayibonte / TotalRevenueAndTotalCost.csv
Last active June 12, 2018 09:34
demonstrating javascript reduce by calculating total cost and total revenue
initialValue selling_price cost_price quantity accumulator.TotalCost accumulator.TotalRevenue
0 20 5 4 20 80
- 25 5 10 70 330
- 10 10 2 90 350
- 15 15 8 210 470
- 20 5 4 230 550
accumulator currentValue.selling_price currentValue.quantity Revenue
0 20 4 80
80 25 10 330
330 10 2 350
350 15 8 470
470 20 4 550