Skip to content

Instantly share code, notes, and snippets.

View YobertyAlej's full-sized avatar
⚜️
Transpiling code into hope

Yoberty Garcia YobertyAlej

⚜️
Transpiling code into hope
View GitHub Profile
"use strict";
const expect = require("expect");
/**
* Write a Binary Search Function using pure recursion
*/
const binarySearch = (sorted, value, index = 0) => {
// Found the middle point in the sorted array
const messages = {
year: { singular: 'year', plural: 'years', denominator: 365, inSeconds: 31536000 },
day: { singular: 'day', plural: 'days', denominator: 24, inSeconds: 86400 },
hour: { singular: 'hour', plural: 'hours', denominator: 60, inSeconds: 3600 },
minute: { singular: 'minute', plural: 'minutes', denominator: 60, inSeconds: 60 },
second: { singular: 'second', plural: 'seconds', inSeconds: 1 }
}
function pluralize(value, unit) {
if (value === 1) return messages[unit].singular;
@YobertyAlej
YobertyAlej / styles.css
Created October 3, 2017 18:06
VS Code, styling guidelines.
.type.storage,
.type.storage.declaration,
.storage.class.modifier {
font-family: 'Operator Mono Book';
}
.type.storage.arrow.function {
font-family: 'Fira Code'
}
@YobertyAlej
YobertyAlej / settings.js
Created October 3, 2017 18:05
VS Code Settings
{
"workbench.colorTheme": "Nord",
"editor.fontFamily": "Operator Mono Book",
"vscode_custom_css.imports": ["file:///home/huskyglass-2/.vscodeconfigs/styles.css"],
// Enables font ligatures
"editor.fontLigatures": true,
// Controls whether the editor should render whitespace characters
"editor.renderWhitespace": "none",