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
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
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
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
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 fetchAllTheRepos = (userName, repoCount) => { | |
const MAX_PER_PAGE = 100; | |
const baseUrl = 'https://api.github.com/users/' + userName + | |
'/repos?per_page=' + MAX_PER_PAGE; | |
//Start fetching every page of repos. | |
const fetchPromises = [], pageCount = Math.ceil(repoCount / | |
MAX_PER_PAGE); | |
for (let pageI = 1; pageI <= pageCount; ++pageI) { | |
const fetchPagePromise = fetch(baseUrl + '&page=' + pageI); |
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
# The standard now | |
version: '2' | |
# All of the images/containers compose will deal with | |
services: | |
# our strongloop service shall be known as 'api' | |
api: | |
# use your user name | |
image: davepoon/strongloop-dev |
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 node:8.1.4 | |
# Yarn please | |
RUN curl -o- -L https://yarnpkg.com/install.sh | bash | |
ENV PATH="/root/.yarn/bin:${PATH}" | |
# Installs these globally WITHIN the container, not our local machine | |
RUN yarn && yarn global add loopback-cli && yarn global add nodemon |
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, { PropTypes, Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
class $NAME extends Component { | |
constructor(props, context) { | |
super(props, context); | |
} | |
render() { |
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, { PropTypes } from 'react'; | |
const $NAME = (props) => { | |
return ( | |
); | |
} | |
$NAME .propTypes = { |
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, { PropTypes, Component } from 'react'; | |
class $NAME extends Component { | |
constructor(props) { | |
super(props); | |
} | |
render() { | |
return ( | |
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
To clear containers: | |
docker rm -f $(docker ps -a -q) | |
To clear images: | |
docker rmi -f $(docker images -a -q) | |
To clear volumes: | |
docker volume rm $(docker volume ls -q) | |
To clear networks: |
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
yum install -y gcc-c++ make | |
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash - | |
yum install nodejs |
NewerOlder