Skip to content

Instantly share code, notes, and snippets.

View isaacssemugenyi's full-sized avatar

Isaac Ssemugenyi isaacssemugenyi

View GitHub Profile
@isaacssemugenyi
isaacssemugenyi / fullCode.js
Created June 15, 2021 10:28
Full code compiled
const users = [
{ name: 'Isaac', age: 29, country_id: 30 },
{ name: 'Jessica', age: 23, country_id: 41 },
{ name: 'Eva', age: 25, country_id: 38 }
]
const countries = [
{ country_name: 'Uganda', country_id: 38 },
{ country_name: 'Kenya', country_id: 41 },
{ country_name: 'Rwanda', country_id: 30 }
]
@isaacssemugenyi
isaacssemugenyi / MUI js Table
Created September 14, 2022 09:10
Simple material ui tables
import React from 'react';
import { makeStyles } from '@bit/mui-org.material-ui.styles';
import Table from '@bit/mui-org.material-ui.table';
import TableBody from '@bit/mui-org.material-ui.table-body';
import TableCell from '@bit/mui-org.material-ui.table-cell';
import TableHead from '@bit/mui-org.material-ui.table-head';
import TableRow from '@bit/mui-org.material-ui.table-row';
import Paper from '@bit/mui-org.material-ui.paper';
const useStyles = makeStyles(theme => ({
@isaacssemugenyi
isaacssemugenyi / odds.js
Created October 11, 2022 07:50
Extract data from a json response
exports.manupilateOdds = (response) => {
const odds = [];
for (const index in response) {
response[index].fixture.index = parseInt(index)
response[index].bookmaker = response[index].bookmakers[0]
delete response[index].league
delete response[index].update
delete response[index].bookmakers
odds.push({
{
"get": "odds",
"parameters": {
"date": "2023-01-11",
"bookmaker": "6"
},
"errors": [],
"results": 10,
"paging": {
"current": 1,
@isaacssemugenyi
isaacssemugenyi / batch.js
Last active January 11, 2023 06:34
Process of transforming data from a complex json to simple data to use
function batchData(data, diviser){ // data is the 1Dimension array with all the formatted data
const chunk = Math.floor(data.length / diviser); // determine the number elements for each nested array or chunk
const limit = Math.floor(data.length / chunk); // determine the number of time to look through the 2D array (final) to pick the new datasets
const reminder = data.length % diviser // check if there is any data that was missed out because of the division above, then determin the number of elements left
let final = [] // array to store the new chunk of arrays of daya
for(let batch = 0; batch < limit; batch++){ // loop through the data while pushing new nested array of data into the final array
if(batch === 0){
final.push(data.slice(0, chunk))
console.log(batch, final)
/*A program to compute for total taxes and total cost of a car
*@ authors [Asiimwe Prisca, Isaac Ssemugenyi]
*/
#include<stdio.h>
int main(){
// Declare all required variables
float dutiable_value, import_duty, value_added_tax, import_commission;
float withholding_tax, environment_tax, total_cost, total_tax;
/** Currency converter source -> https://www.oanda.com/currency-converter
* 13th/April/2023
* KES -> UGX 1 -> 27.5834
* UGX -> KES 1 -> 0.03533
*
* @author 1. Asiimwe Priscah elvin - 22/2/314/DJ/038
* 2. Isaac Ssemugenyi - 22/2/306/WJ/164
*
* @title KUUK Currency Converter
* @description KUUK - Kenya->Uganda, Uganda->Kenya Currency Converter
#include<stdio.h>
int main() {
int Bal, Interest;
Bal = 300;
Interest = (30 / 100) * Bal;
if(Bal == 100)
{
Bal++;
#include<stdio.h>
// WWrite a C program to display the following output: 20 40 60 80 100 120
int main ()
{
int integer = 20;
while(integer <= 120){
printf("\t%d", integer);
@isaacssemugenyi
isaacssemugenyi / even_numbers.cpp
Created September 1, 2023 16:16
Sum even number from an array
#include<stdio.h>
int main()
{
int numbers[10];
int i;
printf("You will be promted to enter any 10 numbers of choice, and only even numbers will be added \n\n");
for(i = 0; i < 10; i++) {