Skip to content

Instantly share code, notes, and snippets.

View bendozy's full-sized avatar

Chidozie Ijeomah bendozy

View GitHub Profile
<?php
/**
* Created by PhpStorm.
* User: bendozy
* Date: 8/28/15
* Time: 2:22 AM
*/
namespace Andela\Dictionary\Tests;
<?php
/**
* Created by PhpStorm.
* User: Chidozie Ijeomah
* Date: 8/28/15
* Time: 12:45 AM
*/
namespace Andela\Dictionary;
@bendozy
bendozy / test
Created December 26, 2015 14:03
test
class BankAccount:
def __init__(self, initial_balance):
self.balance = initial_balance
def deposit(self, amount):
print ("Current Balance : " + str(self.balance) + "\n")
print ("Adding " + str(amount) + " to current balance \n")
self.balance += amount
print ("New Current Balance : " + str(self.balance) + "\n")
class BankAccount:
def __init__(self, initial_balance):
self.balance = initial_balance
def deposit(self, amount):
print ("Current Balance : " + str(self.balance) + "\n")
print ("Adding " + str(amount) + " to current balance \n")
self.balance += amount
print ("New Current Balance : " + str(self.balance) + "\n")
describe('cohorts index method test', function() {
var req = httpMocks.createRequest();
var res = httpMocks.createResponse();
cohortController.index(req, res);
it('should display all cohorts in the database', function(done) {
var data = JSON.parse(res._getData());
data.length.should.equal(3);
res.statusCode.should.equal(200);
done();
});
'use-strict';
global.t = require('moment');
var httpMocks = require('node-mocks-http'),
models = require('../../../server/models/'),
should = require('should'),
cohortController = require('../../../server/controllers/cohorts');
describe('Server Cohort Controller Test', function() {
var mockCohort = {
"c1": {
import React from 'react';
import {render} from 'react-dom';
const AuthenticationHOC = (Component) => class extends React.Component {
constructor(props){
super(props);
this.state = {
currentUser: {},
import React from 'react';
import Prismic from 'prismic.io';
export default class Pages extends React.Component {
state = {
doc: null,
notFound: false,
}
const getNthPrime = (position) => {
const primeNumbers = [2];
for(let i = 3; primeNumbers.length < position; i += 2) {
let numberIsPrime = true;
for(let j = 0; j < primeNumbers.length && Math.pow(primeNumbers[j], 2) <= i; j++) {
if(i % primeNumbers[j] === 0){
numberIsPrime = false;
break;
}
}