Skip to content

Instantly share code, notes, and snippets.

View xavierartot's full-sized avatar

Xavier Artot xavierartot

  • Paris
View GitHub Profile
xavierartot /
Created February 1, 2019 06:20 — forked from tomysmile/
Setup PHP Composer using Brew
xavierartot /
Created September 17, 2018 15:03
Things I learned the hard way using React Native

Things I learned the hard way using React Native

Set up your environment carefully: It's important to have one canonical source of truth per environment, per platform. (i.e. iOS Development, iOS Testflight, iOS Production, ditto Android.) Every time you build, your config should propagate values from one input source (per platform) to either Java/JavaScript or Objective-C/JavaScript. Here's what we did for Android and here's what we did for iOS. I don't doubt that you can do better. Please do better. But you can't say that we didn't have one canonical source of truth that worked very simply and effectively throughout the development process.

Don't wait until the end to develop Android and iOS concurrently: Even if you're not actively focusing on both platforms, don't assume that "RN is cross platform… we can develop iOS and flip the Android switch when we'r

View react object
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom' // withRouter allow to connect the route as property with connect
class ViewPoll extends Component {
componentDidMount() {
const { id, question } = this.props
console.log('xav', question)
// console.log(question.optionTwo.votes) // id : 6ni6ok3ym7mf1p33lnez
View Simple To Do List React.js
//Improvment from this tutorial:
import React from 'react';
import List from './List';
export default class TodoList extends React.Component {
constructor(props) {
this.onChangeList = this.onChangeList.bind(this);
this.state = {
term : '',
View form contact UI
import React from 'react';
import { Col, Button, Form, FormGroup, Label, Input } from 'reactstrap';
import nodemailer from 'nodemailer';
import firebase from './firebase';
export default class ContactForm extends React.Component {
constructor() {
this.state = {
View eslint-react-nanondegree
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
xavierartot / gist:8342627
Created January 9, 2014 21:45
ReduxFramework Sample Config File
View gist:8342627
ReduxFramework Sample Config File
For full documentation, please visit:
if ( !class_exists( "ReduxFramework" ) ) {
View todolist react
import React from 'react';
const ListItem = (props) => {
return (
<span className='text-normal'>{props.item}</span>
className="btn btn-remove">remove</button>
View Snippet one file
# Functions
# prototype
snippet .
snippet proto
${1:class_name}.prototype.${2:method_name} = function(${3}) {
# Function
View Snippet es6
snippet const
const ${1} = ${0};
snippet let
let ${1} = ${0};
snippet im "import xyz from 'xyz'"
import ${1} from '${2:$1}';
snippet imas "import * as xyz from 'xyz'"
import * as ${1} from '${2:$1}';
snippet imm "import { member } from 'xyz'"
import { ${1} } from '${2}';