Skip to content

Instantly share code, notes, and snippets.

Yann Leflour yleflour

View GitHub Profile
View rules.tsx
import React from 'react';
import { Image, Text, View } from 'react-native';
function renderImage(node: any, output: any, state: any, styles: any) {
const { imageWrapper: wrapperStyle, image: imageStyle } = styles;
/**
* Prevent Native crash (View in Text) from occuring
*/
if (state.inline) {
View gist:bbf1f438b3485726102efa8689606e26
// @flow
import React, { PureComponent } from 'react';
import { View, StyleSheet } from 'react-native';
import { VictoryChart, VictoryArea, VictoryAxis, VictoryScatter } from 'victory-native';
import { BackendTimestampConverter } from 'homefriend/src/services';
import appStyle from 'homefriend/src/appStyle';
type PropsType = {
consumptionHistory: DayConsumptionBackendDataType[],
View React Native + Jest + Enzyme
import React from 'react';
import 'react-native';
import { shallow } from 'enzyme';
import { shallowToJson } from 'enzyme-to-json';
import LargeButton from '../LargeButton';
jest.mock('Materniteam/src/components/FadeIn.js');
describe('<LargeButton />', () => {
@yleflour
yleflour / App.js
Created Jan 2, 2017
React Native Debugger - Network Traffic
View App.js
if (window.__REDUX_DEVTOOLS_EXTENSION__) {
const xhr = global.originalXMLHttpRequest ?
global.originalXMLHttpRequest :
global.XMLHttpRequest;
global.XMLHttpRequest = xhr;
}
@yleflour
yleflour / .szhrc
Created Jul 12, 2016
Docker aliases
View .szhrc
alias docker-switch='function _switch(){eval $(docker-machine env $1);echo "Switched to $1 machine"};_switch'
alias docker-bash='function _bash(){docker-compose run $1 bash };_bash'
@yleflour
yleflour / wallaby.js
Last active Feb 21, 2019
Wallaby + React Native
View wallaby.js
/*
WallabyJS React Native Config
Works well with Jest + Enzyme
*/
/* eslint-disable */
module.exports = function (wallaby) {
return {
files: [
'src/**/*.js',
@yleflour
yleflour / registerApp.js
Created Jun 23, 2016
[React native] Sentry config
View registerApp.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React from 'react';
import { AppRegistry } from 'react-native';
import Raven from 'raven-js';
import ravenPluginReactNative from 'raven-js/plugins/react-native';
import App from 'myapp/src/App';
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.