Skip to content

Instantly share code, notes, and snippets.

View marcdomain's full-sized avatar
🛠️
Automating Processes

Marcus Chukwuoma marcdomain

🛠️
Automating Processes
View GitHub Profile
@marcdomain
marcdomain / sampleTDD.js
Last active November 22, 2018 20:11
This test is for a post REST API Endpoint. I assumed a mock data that hold objects of correct and incorrect input from a client. The response code is tested in each case. I ensured that the test captures the actual purpose of the endpoint (a push into the Articles model), by testing the new length of the Articles Model.
import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../../app';
Import articles from ../Models/articles’;
Import { correctArticle, invalidArticleTitle, invalidArticleTitleLength,
invalidArticleContent, invalidArticleLength
} from ./articleMockData’;
describe(‘TEST FOR POST Article to the Articles model’, () => {
it(‘should return 201 for success’, (done) => {
@marcdomain
marcdomain / Vagrantfile-Apache.rb
Last active February 26, 2019 13:20
Vagrant File for creating Apache Server
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Install ubuntu/trusty64 in the VM Box
config.vm.box = "ubuntu/trusty64"
# Use virtualbox provider
config.vm.provider "virtualbox" do |vb|
@marcdomain
marcdomain / Vagrantfile-Multi-VM.rb
Last active March 21, 2020 09:20
Creating a network of multiple virtual machine with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "api-vm" do |api|
api.vm.hostname = "api-vm"
api.vm.box = "ubuntu/bionic64"
api.vm.network "private_network", ip: "10.0.0.10"
api.vm.network "forwarded_port", guest: 80, host: 5030
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@marcdomain
marcdomain / README.mkd
Created August 16, 2020 16:12 — forked from inz/README.mkd
List svn authors for easier migration to Git
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output