Skip to content

Instantly share code, notes, and snippets.

View evaldosantos's full-sized avatar
🏠
Working from home

Evaldo Santos evaldosantos

🏠
Working from home
View GitHub Profile
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
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();
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) {
# 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
const spy = jest.spyOn(MODULE, 'myFunction').mockImplementation(() => Promise.resolve({payload: 2}));
spy.mockRestore()
# 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
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
interface Action {
type: string;
payload?: any;
}
interface Reducer<T> {
(state: T, action: Action): T
}
interface ListenerCallback {
ng g store AppState --root --module app.module.ts
###########################
### Configuration
############################
#
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# use 256 term for pretty colors
set -g default-terminal "screen-256color"