Skip to content

Instantly share code, notes, and snippets.

View Parables's full-sized avatar
💭
Contributing to Open Source projects... #GivingBack2éCommunity

Parables Boltnoel Parables

💭
Contributing to Open Source projects... #GivingBack2éCommunity
  • Ghana
View GitHub Profile
@Parables
Parables / index.html
Created April 21, 2020 16:25
Get random quotes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@Parables
Parables / main.cpp
Last active April 23, 2020 07:34
C++ GPA Result Generator
// Example program
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
// Data Structures
typedef struct{
string title;
@Parables
Parables / geyser.txt
Last active June 6, 2020 10:08
C++ Geyser Program
1 3.6 79
2 1.8 54
3 3.333 74
4 2.283 62
5 4.533 85
6 2.883 55
7 4.7 88
8 3.6 85
9 1.95 51
10 4.35 85
@Parables
Parables / main.cpp
Last active June 13, 2020 00:40
BMI calc
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <iomanip>
using namespace std;
//
typedef struct{
double bmiValue;
@Parables
Parables / clipboard.history.json
Last active July 31, 2020 23:59
idelmis-kryztalina-sync
{
"version": 2,
"clips": [
{
"value": "app",
"createdAt": 1591673877303,
"copyCount": 1,
"useCount": 0,
"language": "typescript",
"createdLocation": {
@Parables
Parables / dateFormat.js
Last active August 16, 2020 06:28
Format date using tokens without any 3rd party libraries
let days = [
{ s: 'Sun', l: 'Sunday' },
{ s: 'Mon', l: "Monday" },
{ s: 'Tue', l: 'Tuesday' },
{ s: 'Wed', l: 'Wednesday' },
{ s: 'Thu', l: 'Thursday' },
{ s: 'Fri', l: 'Friday' },
{ s: 'Sat', l: 'Saturday' }
];
@Parables
Parables / fullstack-setup.md
Created February 12, 2021 05:56
Ulitmate Ubuntu FullStack Development Setup right after installation

How to set up for development on Ubuntu based machine using Elementary OS

@Parables
Parables / nested_value_henlpers.ts
Last active June 4, 2021 06:13
Set a deeply nested value or get the value of a deeply nested key using dot-separated-string path. E.g: 'some.deeply.nested.key'
let data: Record<string, any> = { initial: "something" }
let key = "root.field.subField"
const setNestedValue = (obj: Record<string, any>, path: string, value) => {
return path.split(".")
.reduce((acc, cur, index, arr) => index === arr.length - 1 ? acc[cur] = value : acc[cur] = {}, obj)
}
const getNestedValue = (obj: Record<string, any>, path: string, defaultValue?: any) =>
@Parables
Parables / New Dyna Form.ts
Last active June 4, 2021 06:25
This builds a Form using Flexbox where fields are arranged in a row, many rows make a section, many sections makes up the form
interface IForm {
id: string
sections: any[]
classNames?: string
store?: any
validator?: any
}
export type FieldType = "text" | "email" | "password" | "tel" | "date" | "time" | "number" |
@Parables
Parables / monads.ts
Created June 5, 2021 09:14
Monads using null. Clever tricky by Nathan Franck http://disq.us/p/266tez0
function getSupervisorName(enteredId: string | null) {
let employee, supervisor;
if (null != enteredId &&
null != (employee = repository.findById(parseInt(enteredId))) &&
null != employee.supervisorId &&
null != (supervisor = repository.findById(employee.supervisorId)))
return supervisor.name;
}