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
ng g store AppState --root --module app.module.ts |
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
interface Action { | |
type: string; | |
payload?: any; | |
} | |
interface Reducer<T> { | |
(state: T, action: Action): T | |
} | |
interface ListenerCallback { |
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
RxJS | |
RxJS is a library for composing asychronous and event-based programs by using observable sequences. | |
It combines the Observer pattern with the Iterator pattern and functional programming with collections. | |
Essential conecpts: | |
- Observable: (event stream) | |
represents the idea of an invokable collection of furure values or events. | |
- Observer (callback) | |
is a collection of callbacks that knows how to listen to values delivered by the Observable | |
- Subscription (execution) | |
represents the execution of an Observable, is primarily useful for cancelling the execution |
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
# run composer from command line using docker | |
docker run --rm -it -v $PWD:/app -v $SSH_AUTH_SOCK:/ssh-auth.sock -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -u $(id -u):$(id -g) -e SSH_AUTH_SOCK=/ssh-auth.sock composer install | |
# run php from command line using docker | |
docker run -it --rm -p 8000:8000 -v $(pwd):/app -w /app php:cli php artisan serve --host=0.0.0.0 | |
# docker-composer.yml |
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 spy = jest.spyOn(MODULE, 'myFunction').mockImplementation(() => Promise.resolve({payload: 2})); | |
spy.mockRestore() |
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
# enable vivaldi codecs | |
# 1. install chromium codecs extra | |
sudo dnf install chromium-libs-media-freeworld.x86_64 - | |
# 2. move old vivaldi libffmpeg | |
sudo mv /opt/vivaldi/lib/libffmpeg.so /opt/vivaldi/lib/libffmpeg.so.backup | |
# 3. link vivaldi ffmpeg to chromium ffmpeg | |
sudo ln -s /usr/lib64/chromium-browser/libffmpeg.so /opt/vivaldi/lib/libffmpeg.so |
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
export default function createAsyncAction (type, fn) { | |
return (...args) => async (dispatch) => { | |
dispatch({ | |
type: `${type}_STARTED`, | |
payload: args | |
}); | |
let result; | |
try { | |
result = await fn(...args); | |
} catch (error) { |
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 { increaseCount, reducer, store } from './counter'; | |
describe('Counter', () => { | |
it('should have a default state', () => { | |
const result = reducer(); | |
expect(result.count).toEqual(0); | |
}); | |
it('should increase the count', () => { | |
const action = increaseCount(); |
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
sudo dnf clean all | |
sudo dnf -y install gstreamer-plugins-base gstreamer1-plugins-base gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer1-plugins-ugly gstreamer-plugins-good-extras gstreamer1-plugins-good-extras gstreamer1-plugins-bad-freeworld ffmpeg gstreamer-ffmpeg | |
sudo dnf install rhythmbox -y | |
sudo dnf config-manager --add-repo=http://negativo17.org/repos/fedora-spotify.repo | |
sudo dnf install spotify -y |
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
sudo dnf clean all | |
# Install the dnf-plugins-core package which provides the commands to manage your DNF repositories from the command line. | |
sudo dnf -y install dnf-plugins-core | |
# Use the following command to set up the stable repository. | |
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo | |
# Enable the edge and test repositories. | |
sudo dnf config-manager --set-enabled docker-ce-edge |