Skip to content

Instantly share code, notes, and snippets.

View ncuillery's full-sized avatar

Nicolas Cuillery ncuillery

View GitHub Profile
@ncuillery
ncuillery / README.md
Last active February 16, 2016 11:27
Jest 0.9.x measurements

I did some measurements of the "warm-up" time of both version 0.8.2 and 0.9.0.

I've add Date.now() here and here, and I did the same on the equivalent lines on master.

0.8.2

All tests:

$ jest
@ncuillery
ncuillery / README.md
Last active September 26, 2016 18:52
[LT Reactive 2016] Efficient testing with Jest
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$..........................................$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$........................... ... .........I$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$........................................$$$$$$$$$$$$$$$$$$$$$
       $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$....,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$....I$$$$$$$$$$$$$$$$$$$$$

Exercice JavaScript

Sujet

Créer une application web mono-page de suivi de match de ⚽ en direct.

Voir l'image fournie dans ce Gist pour l'exemple (capture d'écran d'un direct sur http://www.lequipe.fr)

Contraintes

@ncuillery
ncuillery / upgrade_rn.sh
Last active September 12, 2016 11:45
Upgrade React Native on your project, using a git-like interface and without touching the project's local repo
# In the root directory of a project using RN 0.32:
export GIT_DIR=.gitrn # From this line, all git commands will deal with the .gitrn directory, leaving the .git directory untouched
export GIT_WORK_TREE=. # I should tell Git the working tree hasn't changed
git init # Create the .gitrn directory
git add . # Stage the user's files
git reset -- .gitrn # Remove the internal Git files from the index (Git seems to not handle custom GIT_DIR very well...)
git commit -m "Project snapshot" # Commit them, the user's files are now known in the new repo index
@ncuillery
ncuillery / upgrade_rn.sh
Last active March 21, 2017 09:37
Upgrade React Native on your project, using a git-like interface
# In the root directory of a project, the Git working copy must be clean:
echo "a" | react-native upgrade # Generate the current version template and overwrite all files
git add .
git commit -m "Old version" # The current version template is added to the index
npm i react-native@latest --save # Install the new version of React Native
echo "a" | react-native upgrade # Generate the new version template and overwrite all files
03-08 12:37:31.330 9886-23047/com.zero40app I/ReactNativeJS: JS->N : Timing.createTimer([3702,1,1488973051337,false])
03-08 12:37:31.490 9886-23047/com.zero40app I/ReactNativeJS: N->JS : RCTDeviceEventEmitter.emit(["websocketFailed",{"message":"Failed to connect to localhost/127.0.0.1:8097","id":124}])
03-08 12:37:31.490 9886-23047/com.zero40app I/ReactNativeJS: JS->N : Timing.createTimer([3705,2000,1488973051506,false])
03-08 12:37:31.500 9886-23047/com.zero40app I/ReactNativeJS: N->JS : JSTimersExecution.callTimers([[3704]])
03-08 12:37:31.500 9886-23047/com.zero40app I/ReactNativeJS: JS->N : UIManager.updateView([230,"RCTView",{"transform":[{"translateX":-20.096506866822693}]}])
03-08 12:37:31.500 9886-23047/com.zero40app I/ReactNativeJS: JS->N : UIManager.updateView([232,"RCTView",{"transform":[{"translateX":-20.096506866822693}]}])
03-08 12:37:31.510 9886-23047/com.zero40app I/ReactNativeJS: JS->N : UIManager.updateView([233,"RCTView",{"transform":[{"translateX":-20.096506866822693}]}])
03-08 12:37:31.51
@ncuillery
ncuillery / index.android.js
Created March 8, 2017 21:03
Issue RN 11809 Test app
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Animated,
Text,
Image,
View,
ListView,
TouchableWithoutFeedback,
@ncuillery
ncuillery / ReactEurope2017_1.js
Created May 21, 2017 15:22
ReactEurope2017_1
const filteredPersons = _.filter(persons, person => person.age < 30);
const sortedPersons = _.sortBy(filteredPersons, person => person.age);
const names = _.map(sortedPersons, person => person.name);
@ncuillery
ncuillery / ReactEurope2017_2.js
Created May 21, 2017 15:29
ReactEurope2017_2
const names = _.chain(persons)
.filter(person => person.age < 30)
.sortBy(person => person.age)
.map(person => person.name)
.value();
@ncuillery
ncuillery / ReactEurope2017_Leland_1.js
Created May 21, 2017 16:25
ReactEurope2017_Leland_1
import { View } from 'react-native';