Skip to content

Instantly share code, notes, and snippets.

View q-ode's full-sized avatar
💭
I may be slow to respond.

Adebayo Adesanya q-ode

💭
I may be slow to respond.
View GitHub Profile
@q-ode
q-ode / stringToLine.js
Created July 17, 2017 14:58
Weifund.js
function stringToLine(sentence, charactersPerLine) {
const length = sentence.length;
let line = '';
for (let i = 0; i < length; i++) {
line = line + sentence[i];
if ((i + 1) % charactersPerLine === 0 || (length - i + 1 <= charactersPerLine)) {
@q-ode
q-ode / middleware.spec.js
Created June 2, 2017 12:43
Sample NodeJS - Express Middleware Tests
const middleware = {
some: function (a, b, next) {
if (a === 1){
next();
} else {
return false;
}
}
};
{
  "root": true,
  "extends": "airbnb-base",
  "env": {
    "node": true,
    "es6": true,
    "mocha": true
  },
 "rules": {
@q-ode
q-ode / Pagination Metadata.md
Last active July 17, 2017 12:07
Essential Metadata for Pagination
  • page: current page of the query result based on limit and offset
  • pageCount: total number of pages
  • pageSize: number of records per page (based on limit)
  • totalCount: total number of records based on query
@q-ode
q-ode / Branch Convention.md
Created February 10, 2017 11:14
Branch Naming Convention

#Branch Naming

Branches being created should have the following format:

<story type>/<story id>/<3-4 word story description>

#Example

chore/111504508/save-the-world

@q-ode
q-ode / Commit Message Convention.md
Created February 10, 2017 11:08
Commit message naming convention

#Format of the commit message

<type>(<scope>): <subject>``<BLANK LINE> <body> <BLANK LINE> <footer>

Any line cannot be longer than a 100 characters, meaning be concise.

Subject line

@q-ode
q-ode / PR Convention.md
Created February 10, 2017 11:05
Naming Convention for Pull Requests

#PR Naming

#<story-id> story description

Example

#869522144 Build HQ for meetings

#PR Description Template (Markdown)

@q-ode
q-ode / ReadMe.md
Last active May 4, 2017 08:24
Sections in ReadMe document for repositories

What the project does

  • Introduction/Background Information
  • Features

Why the project is useful

How users can get started with the project

  • Requirements
  • How to setup the project/Installation/Configuration
  • How to run tests
@q-ode
q-ode / books.json
Created February 3, 2017 10:54
JSON File Structure for Inverted Index CP1
[
{
"title": "Alice in Wonderland",
"text": "Alice falls into a rabbit hole and enters a world full of imagination."
},
{
"title": "The Lord of the Rings: The Fellowship of the Ring.",
"text": "An unusual alliance of man, elf, dwarf, wizard and hobbit seek to destroy a powerful ring."
},