Skip to content

Instantly share code, notes, and snippets.

View Michaelvilleneuve's full-sized avatar

Michaël Villeneuve Michaelvilleneuve

View GitHub Profile
@Michaelvilleneuve
Michaelvilleneuve / i18n.test.js
Created August 8, 2018 10:14
Jest tests to check for missing translations, unused keys and incomplete translation files
/* eslint-disable */
import fr from 'config/locales/fr';
import en from 'config/locales/en';
import { exec } from 'child_process';
describe('i18n', () => {
test('Translations keys are the same for every language', () => {
const translationKeysEn = iterate(en, '', []);
const translationKeysFr = iterate(fr, '', []);
@Michaelvilleneuve
Michaelvilleneuve / .java
Last active March 6, 2018 09:20
Updating fidme infos
@ReactMethod
public void updateInfo(ReadableMap map, Promise promise) {
AccountFC accountFC = FidmeCoupons.with(getActivity()).getAccountFC();
accountFC.setFirstName(map.getString("firstName"));
accountFC.setLastName(map.getString("lastName"));
FidmeCoupons.with(getActivity()).updateAccountFCInfo(accountFC, new UpdateAccountFCListener() {
@Override
public void onUpdateAccountFCSucceed() {
promise.resolve();
}
@Michaelvilleneuve
Michaelvilleneuve / documentScannerWithCropper.js
Created October 12, 2017 14:36
Document Scanner and Cropper used together
import {
Dimensions, Image, Text, TouchableOpacity, View, LayoutAnimation } from 'react-native';
import DocumentScanner from 'react-native-document-scanner';
import Icon from 'react-native-vector-icons/Ionicons';
import React, { Component } from 'react';
import CustomCrop from 'react-native-custom-crop';
import { I18n } from '../utils';
import FloatingButton from '../shared/FloatingButton';