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
- name: "First things first - install latest patches" | |
apt: update_cache=yes upgrade=full | |
- name: "First things first - create random root password" | |
apt: name={{ item }} state=present | |
with_items: |
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
{11:30}[2.2.3]~ ➭ mkdir ~/ansible; cd ~/ansible | |
{11:30}[2.2.3]~/ansible ➭ |
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 { fetchQuotes } from './QuotesActions.js'; | |
import configureMockStore from 'redux-mock-store'; | |
import thunk from 'redux-thunk'; | |
import fetchMock from 'fetch-mock'; | |
const mockStore = configureMockStore([thunk]); | |
describe('QuotesActions', () => { | |
afterEach(() => { | |
fetchMock.restore(); | |
}); |
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
export const fetchQuotes = () => dispatch => { | |
dispatch({ type: 'FETCH_QUOTES_REQUEST'}); | |
return fetch('/api/random-quote') | |
.then(r => r.json()) | |
.then(({ quotes }) => { | |
dispatch({ | |
type: 'FETCH_QUOTES_SUCCESS', | |
data: quotes, | |
}); |
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 quotes from './Quotes'; | |
describe('Quotes reducer', () => { | |
it('returns proper initial state', () => { | |
expect(quotes(undefined, {})).toEqual([]); | |
}); | |
it('adds the quotes', () => { | |
expect(quotes(['sample quote 1'], { | |
type: 'FETCH_QUOTES_SUCCESS', |
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 initialState = []; | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
case 'FETCH_QUOTES_SUCCESS': | |
return [...state, ...action.data]; | |
default: | |
return 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
$ npm install -g create-react-app | |
$ create-react-app netguru-react-redux-1 | |
$ cd netguru-react-redux-1 && npm start |
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
{11:30}[2.2.3]~/ansible ➭ touch inventory; touch playbook.yml | |
{11:31}[2.2.3]~/ansible ➭ ls | |
inventory playbook.yml | |
{11:31}[2.2.3]~/ansible ➭ |
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
{11:30}[2.2.3]~/ansible ➭ touch inventory; touch playbook.yml | |
{11:31}[2.2.3]~/ansible ➭ ls | |
inventory playbook.yml | |
{11:31}[2.2.3]~/ansible ➭ |
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
(...) | |
PLAY RECAP ************************************************************** | |
<IP> : ok=3 changed=0 unreachable=0 failed=0 |