Skip to content

Instantly share code, notes, and snippets.

View wesscoby's full-sized avatar
😎
It does get easier...

Emmanuel Sekyere wesscoby

😎
It does get easier...
View GitHub Profile
/*
36 | mary | accra | trader
24 | judith | kumasi | banker
22 | kofi | accra | trader
* The string above is formatted as 'AGE | NAME | LOCATION | WORK and separated with the ENTER key
* Given the string above, write a snipet that can delete any of the options above and return the same format of the string
* So, should the snipet delete the location column =, then your output should be:
36 | mary | trader
@wesscoby
wesscoby / stats.php
Last active April 13, 2019 19:47
Codewars Kata
<?php
/*
* You are the "computer expert" of a local Athletic Association (C.A.A.). Many teams of runners come to compete.
* Each time, you get a string of all race results of every team who has run.
* For example, here is string showing the individual results of a team of 5 runners: "01|15|59, 1|47|6, 01|17|20, 1|32|34, 2|3|17"
* Each part of the string is of the form: h|m|s where h,m,s (h for hour, m for minutes, s for seconds) are positive or null integers,
* (represented as strings) with one or two digits. There are no traps in this format.
* To compare the results of the teams you are asked for giving three statistics; range, average and median
*
* Range: difference between the lowest and highest values. In {4, 6, 9, 3, 7}, the lowest value is 3 and highest is 9 so the range is 9 - 3 = 6
@wesscoby
wesscoby / stats.js
Last active April 13, 2019 19:48
Codewares Kata
/*
* You are the "computer expert" of a local Athletic Association (C.A.A.). Many teams of runners come to compete.
* Each time, you get a string of all race results of every team who has run.
* For example, here is string showing the individual results of a team of 5 runners: "01|15|59, 1|47|6, 01|17|20, 1|32|34, 2|3|17"
* Each part of the string is of the form: h|m|s where h,m,s (h for hour, m for minutes, s for seconds) are positive or null integers,
* (represented as strings) with one or two digits. There are no traps in this format.
* To compare the results of the teams you are asked for giving three statistics; range, average and median
*
* Range: difference between the lowest and highest values. In {4, 6, 9, 3, 7}, the lowest value is 3 and highest is 9 so the range is 9 - 3 = 6
*
<?php
$people = '{
"data":[{
"first_name":"jake",
"last_name":"bennett",
"age":31,
"email":"[email protected]",
"secret":"VXNlIHRoaXMgc2VjcmV0IHBocmFzZSBzb21ld2hlcmUgaW4geW91ciBjb2RlJ3MgY29tbWVudHM="
},{
"first_name":"jordon",
@wesscoby
wesscoby / favorite_quotes.json
Created November 14, 2018 08:37
A JSON file of my Favorite Quotes, esepcially, Programming-related
{
"name" : "All time favorite quotes",
"collected_by" : "WessCoby",
"version" : 1.0,
"quotes_database" : [
{
"description": "Popular Quotes",
"type": "single",
"data": [
{

// Question 1 const bills = [ {date: '2018-01-20', amount: '220', category: 'Electricity'}, {date: '2018-01-20', amount: '20', category: 'Gas'}, {date: '2018-02-20', amount: '120', category: 'Electricity'} ];

// Answer const getCategoryList = (inputObject) => { let categoryList = [];