This file contains 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 PropTypes from "prop-types"; | |
import {connect} from "react-redux"; | |
import * as courseActions from "../../actions/courseAction"; | |
class CoursesPage extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { |
This file contains 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 PropTypes from "prop-types"; | |
import {connect} from "react-redux"; | |
import {bindActionCreators} from "redux"; | |
import * as courseActions from "../../actions/courseAction"; | |
class CoursesPage extends React.Component { | |
constructor(props) { | |
super(props); |
This file contains 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
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello, World!' | |
if __name__ == '__main__': | |
app.run() |
This file contains 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
""" | |
Configuration settings for the ToDo List API. | |
The definition of the different configuration settings is contained here: | |
- Development Configuration | |
- Production Configuration | |
""" | |
class Config: | |
""" |
This file contains 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
""" | |
Setup an initialization to delay the creation of the application after runtime. | |
This helps to enable the use of blueprint if we ever want to use it in the future. | |
""" | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
from config import config |
This file contains 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
this.setState(prevState => { | |
if (prevState.usedNumbers.length === 9) { | |
return {doneStatus: 'Done. Nice!'} | |
} | |
}); |
This file contains 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 jsdom = require("jsdom"); | |
const { JSDOM } = jsdom; | |
const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`); | |
global.document = dom.window.document; | |
global.window = document.defaultView; | |
const exposedProperties = ['window', 'navigator', 'document']; | |
Object.keys(document.defaultView).forEach((property) => { | |
if (typeof global[property] === 'undefined') { |
This file contains 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 saveUrlToArray = (url) => { | |
const tempArray = url.split(','); | |
const urlArray = tempArray.map((arr, index) => { | |
return arr.trim(); | |
}); | |
return urlArray; | |
} | |
saveUrlToArray('hnsdjf, https://google.com, http://facebook.com,http://andela.com'); |
This file contains 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
#!/bin/bash | |
# wait for Postgres to start | |
function postgres_ready() { | |
python << END | |
import sys | |
import psycopg2 | |
try: | |
conn = psycopg2.connect(dbname="postgres", user="postgres", password="postgres", host="postgres") | |
except psycopg2.OperationalError: |
This file contains 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
""" | |
Configuration settings for the ToDo List API. | |
The definition of the different configuration settings is contained here: | |
- Development Configuration | |
- Production Configuration | |
""" | |
class Config: | |
""" |