This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
export default function withPropsChecker(WrappedComponent) { | |
return class PropsChecker extends Component { | |
componentWillReceiveProps(nextProps) { | |
Object.keys(nextProps) | |
.filter(key => { | |
return nextProps[key] !== this.props[key]; | |
}) | |
.map(key => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { Image, Platform, Text, TouchableOpacity, View } from "react-native"; | |
import firebase from "react-native-firebase"; | |
import { NavigationParams } from "react-navigation"; | |
import Bot from "./botMessage.json"; | |
import { Input } from "./Input"; | |
import { Messages } from "./Messages"; | |
import { styles } from "./styles"; | |
const bot = Bot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are going to be given a word. Your job is to return the middle character of the word. | |
If the word's length is odd, return the middle character. | |
If the word's length is even, return the middle 2 characters. | |
String.prototype.toJadenCase = function () { | |
return this.split(' ').map(function (item) { | |
return item.replace(item.charAt(0), item.charAt(0).toUpperCase()); | |
}).join(' '); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Monstre { | |
constructor (options = {}){ | |
this.health = 100; | |
this.name = options.name; | |
} | |
heal() { | |
this.health= this.health + 10; | |
return this.health; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const address = { | |
city: "Lyon", | |
state: "FR", | |
zip: 69001 | |
}; | |
const sportList = ['Football', 'BasketBall'] | |
const otherSportList = ['Boxe', 'Judo'] | |
sportList.push(...otherSportList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
class MyTimer extends React.Component { | |
constructor (props) { | |
super(props) | |
this.state = {count: 1} | |
} | |
componentDidMount () { | |
this.startTimer(this.timer) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Author from './test'; | |
import Password from './password'; | |
class App extends Component { | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Author from './test'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
var multer = require('multer'); | |
var upload = multer({ | |
dest: 'tmp/' | |
}); | |
var fs = require('fs'); | |
/* GET home page. */ | |
router.get('/', function (req, res, next) { | |
res.render('index', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
//PUT | |
router.get('/:nom((\[a-z]+))', function (req, res, next) { | |
res.render('update-user', { | |
id: req.params.nom | |
}); | |
}); |
NewerOlder