This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: bendozy | |
* Date: 8/28/15 | |
* Time: 2:22 AM | |
*/ | |
namespace Andela\Dictionary\Tests; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Chidozie Ijeomah | |
* Date: 8/28/15 | |
* Time: 12:45 AM | |
*/ | |
namespace Andela\Dictionary; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {render} from 'react-dom'; | |
const AuthenticationHOC = (Component) => class extends React.Component { | |
constructor(props){ | |
super(props); | |
this.state = { | |
currentUser: {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Prismic from 'prismic.io'; | |
export default class Pages extends React.Component { | |
state = { | |
doc: null, | |
notFound: false, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
OlderNewer