Skip to content

Instantly share code, notes, and snippets.

Focusing on development

Jeroen Claassens Favna

Focusing on development
Block or report user

Report or block Favna

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Favna / jestscreenshot.ts
Created Aug 10, 2019
Jestscreenshot reporter
View jestscreenshot.ts
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/promise-function-async */
import { Page } from 'puppeteer';
import moment from 'moment';
import mkdirp from 'mkdirp';
export type JestScreenshotOptions = {
/** The Puppeteer page to take a screenshot from */
page: Page;
/** The directory to create a "screenshots" folder in */
Favna / App.tsx
Last active May 29, 2019
Create-React-App + Redux-Saga + Connected-React-Router => Yield put push
View App.tsx
import { createMuiTheme, MuiThemeProvider, Theme } from '@material-ui/core/styles';
import { StylesProvider } from '@material-ui/styles';
import history from 'config/history';
import configureStore from 'config/store';
import { ConnectedRouter } from 'connected-react-router';
import ConnectedHeader from 'containers/Header';
import { SnackbarProvider } from 'notistack';
import React, { FC } from 'react';
import { Provider } from 'react-redux';
import { blue, red, yellow } from 'utils/constants';
View Snackbar.tsx
import { withSnackbar, WithSnackbarProps } from 'notistack';
import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';
import { ApplicationState } from 'store';
import { removeSnackbar } from 'store/snackbars/snackbarActions';
import { Snackbar, SnackbarOptions } from 'store/snackbars/snackbarTypes';
type Props = {
snackbars: Snackbar[];
Favna / actions.ts
Last active Apr 26, 2019
createReducer issue
View actions.ts
import { User, UserRole } from 'store/user/userTypes';
import { action } from 'typesafe-actions';
import { UserManagementActionTypes, userModalMode } from './userManagementTypes';
export const openUserModal = (mode: userModalMode, processingUserId?: string) => action(UserManagementActionTypes.OPEN_USER_MODAL, {mode, processingUserId});
export const closeUserModal = () => action(UserManagementActionTypes.CLOSE_USER_MODAL);
export const handleRequestSort = (property: string) => action(UserManagementActionTypes.HANDLE_REQUEST_SORT, property);
export const handleChangePage = (event: any, page: number) => action(UserManagementActionTypes.HANDLE_CHANGE_PAGE, page);
export const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => action(UserManagementActionTypes.HANDLE_CHANGE_ROWS_PER_PAGE, event);
export const handleSearchInput = (searchTerm: string) => action(UserManagementActionTypes.HANDLE_SEARCH_INPUT, searchTerm);
Favna /
Last active Jan 10, 2019
Save Yarn in the PATH
if [[ ! ":$PATH:" == *":$(yarn global bin):"* ]]; then
PATH="$(yarn global bin):$PATH"
Favna /
Last active Nov 3, 2018
Streamable CURL Upload

A simple Bash command for using in WSL / Ubuntu / Debian to upload to Streamable

note: Copy part only configured for WSL (Windows Subsystem Linux), if you want to use this on Ubuntu / Debian change the second line to use xclip instead

Function will always output to the STDOUT

Add in your ~/.profile:

export STREAMABLEUSER="your_username"
You can’t perform that action at this time.