Skip to content

Instantly share code, notes, and snippets.

View xavierartot's full-sized avatar

Xavier Artot xavierartot

  • Paris
View GitHub Profile
@xavierartot
xavierartot / mac-php-composer-setup.md
Created February 1, 2019 06:20 — forked from tomysmile/mac-php-composer-setup.md
Setup PHP Composer using Brew
View mac-php-composer-setup.md
@xavierartot
xavierartot / react-native-notes.md
Created September 17, 2018 15:03
Things I learned the hard way using React Native
View react-native-notes.md

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(id)
// console.log(question.optionTwo.votes) // id : 6ni6ok3ym7mf1p33lnez
View Simple To Do List React.js
//Improvment from this tutorial: https://medium.com/@aghh1504/1-simple-react-todo-list-52186b62976b
import React from 'react';
import List from './List';
export default class TodoList extends React.Component {
constructor(props) {
super(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() {
super();
this.state = {
View eslint-react-nanondegree
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
@xavierartot
xavierartot / gist:8342627
Created January 9, 2014 21:45
ReduxFramework Sample Config File
View gist:8342627
<?php
/**
ReduxFramework Sample Config File
For full documentation, please visit: https://github.com/ReduxFramework/ReduxFramework/wiki
**/
if ( !class_exists( "ReduxFramework" ) ) {
return;
}
View todolist react
import React from 'react';
const ListItem = (props) => {
return (
<li>
<span className='text-normal'>{props.item}</span>
<button
onClick={props.onClickRemove}
className="btn btn-remove">remove</button>
<button
View Snippet one file
#https://gist.github.com/xavierartot/6fd9442fff6d586e250f40bcd30e2052
# Functions
# prototype
snippet .
$('.${1:ele}').${0:VISUAL}
snippet proto
${1:class_name}.prototype.${2:method_name} = function(${3}) {
${0:${VISUAL}}
};
# 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}';