Skip to content

Instantly share code, notes, and snippets.

View Lumexralph's full-sized avatar
🤝
Ready to collaborate and solve problems with people

Ogundele Olumide Lumexralph

🤝
Ready to collaborate and solve problems with people
View GitHub Profile
import expect from 'expect';
import request from 'supertest';
import app from '../app'; // the web server
const mockData = {
"article": {
"title": "",
"description": "Ever wonder how?",
"body": "You have to believe",
"tagList": ["reactjs", "angularjs", "dragons"]
{"level":"debug","body":"[{\"id\":7347751,\"web_url\":\"https://gitlab.com/groups/pomerium-class\",\"name\":\"pomerium-class\",\"path\":\"pomerium-class\",\"description\":\"A group of identity providers\",\"visibility\":\"public\",\"share_with_group_lock\":false,\"require_two_factor_authentication\":false,\"two_factor_grace_period\":48,\"project_creation_level\":\"developer\",\"auto_devops_enabled\":null,\"subgroup_creation_level\":\"maintainer\",\"emails_disabled\":null,\"mentions_disabled\":null,\"lfs_enabled\":true,\"default_branch_protection\":2,\"avatar_url\":null,\"request_access_enabled\":true,\"full_name\":\"pomerium-class\",\"full_path\":\"pomerium-class\",\"created_at\":\"2020-03-06T16:39:45.803Z\",\"parent_id\":null,\"ldap_cn\":null,\"ldap_access\":null},{\"id\":7421252,\"web_url\":\"https://gitlab.com/groups/pomerium-kube\",\"name\":\"pomerium-kube\",\"path\":\"pomerium-kube\",\"description\":\"We talk about kubernetes\",\"visibility\":\"public\",\"share_with_group_lock\":false,\"require_two_facto
@Lumexralph
Lumexralph / diamond.js
Last active September 28, 2020 12:25
Write the implementation of the diamond function. The single parameter passed // in is the width of the diamond. Even numbers don't generate beautiful // diamonds, nor do negative ones, so return an empty string in those cases.
const diamond = (n) => {
// your solution
// weed out negative and even numbers
if (n <= 0 || n % 2 == 0) return "";
let k = 0; // to create the count pattern
let row = parseInt((n + 1) / 2);
let diamondStructure = [];
const space = " ";
const star = "*";
@Lumexralph
Lumexralph / sudokuValidator.js
Last active September 28, 2020 13:34
Write a sudoku validator: // 1. The `solution_valid(board)` function should return True when the // solution is True, False otherwise. The cells of the sudoku board may // also contain 0's, which represent empty cells. Boards with empty cells // are invalid of course. For the standard rules see // https://en.wikipedia.org/wiki/Sudoku // 2. Divid…
// SETUP! DO NOT TOUCH!
const Mocha = require('mocha')
const chai = require('chai')
const { expect } = chai
const mocha = new Mocha()
mocha.suite.emit('pre-require', this, 'solution', mocha)
// END OF SETUP
// ===========================================================================