Skip to content

Instantly share code, notes, and snippets.

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

Clinton Yeboah clintonyeb

🏠
Working from home
View GitHub Profile
@clintonyeb
clintonyeb / generate-arduino-make.md
Last active May 15, 2018 01:24
Generates A Makefile for an Arduino when created with pure c

Generates A Makefile for an Arduino when created with pure c

How to Use: Call script the name of the file where is to be compiled and uploaded. make: simply compile file make upload: will compile and upload to target machine

This script is adopted for the Arduino UNO Atmega328p

@clintonyeb
clintonyeb / ellis.md
Last active May 28, 2018 15:58
Answering Ellis Questions
  1. "-the names of the ranks and the suits should be stored in class variables. See Module 5.6 "A Variable that belongs to the whole class"" >After reading that section (5.6),

What does this mean? I’m not understanding. Use class Card()?

Response:

This is an exampple of declaring a class variable:

class Name:
 firstName = "foo"
@clintonyeb
clintonyeb / web3_indexof_starts_with.js
Created November 1, 2018 23:33
Benchmark Testing of JavaScript indexOf and StartsWith when both can work
function performanceTest(testFunction, iterations) {
const start = process.hrtime.bigint();
for (let i = 0; i < iterations; i++) {
testFunction();
}
const end = process.hrtime.bigint();
const time = end - start;
console.log(`Benchmark took ${time} nanoseconds`);
return time;
@clintonyeb
clintonyeb / mujava-setup.md
Created December 22, 2019 02:31
How to Setup MuJava on Windows 10

CSI 3373 Assignment 13 (A13)

Due: December 9, Monday, 11:55pm

Objective: Using muJava for Java Mutation Testing

Tasks

  1. Tool Review: Read the tool overview on muJava Version 4 home page - a hardcopy of the page will also be provided. Note: Do not start downloading or running the tool yet.
  2. Create a sub-folder mujava on C: drive.
h1 {
font-size: 30px;
color: #fff;
text-transform: uppercase;
font-weight: 300;
text-align: center;
margin-bottom: 15px;
}
table {
@clintonyeb
clintonyeb / index.js
Created May 17, 2020 19:26
Currency Screener index.js file
//import core react libraries
import React from 'react';
//import core react-dom
import ReactDOM from 'react-dom';
//import css file
import './index.css';
//Currency Card Display is the core display module of our app
import { createStore, applyMiddleware } from 'redux';
//createStore creates a Redux store that holds the complete state tree of your app
// applyMiddleware is a store enhancer that ships with redux
import thunk from 'redux-thunk';
//Redux Thunk is for communicating asynchronously with an external API to retrieve or save data.
//Redux Thunk makes it easy to dispatch actions that follow the lifecycle of a request to an external API.
//reducers are statemachines that take a state and action as input and return an output
import rootReducer from './Reducers/rootReducer';
//called from CurrencyCardDisplay component calls GET_CURRENCY_PAIR currencyReducer
export const fetchCurrency = () => dispatch => {
dispatch({type: 'INIT_GET_CURRENCY_NAME_REQUEST'})
fetch('https://restsimulator.coderiq.io/currency_pairs')
.then(function(response) {
return response.json();
})
.then(function(currencyJSON) {
console.log(JSON.stringify(currencyJSON));
import { combineReducers } from 'redux';
import currency from './currencyReducer';
export default combineReducers({
currency
});
// Reducers are used to create state machines.
//They take a state and action as input and return final state as output
const INIT_STATE = {
loading: false, //whether app is currently loading
activeSubscription: [], //list of current subscriptions
availableCountries:[] //list of available countries
}