Skip to content

Instantly share code, notes, and snippets.

// App component
router() {
let path = location.pathname.split('/')[1] || '/'
switch(path) {
case '/': return <Page />
case 'barcelona': return <Page />
case 'madrid': return <Page />
case 'activities': return <Page />
case 'trips': return <Page />
// App.tsx
render () {
return <Page />
}
// Page.tsx
router () {
let path = location.pathname.split('/')[1] || '/'
import * as React from 'react'
interface Props {
indexes: [ number ],
component: any,
container: any
}
export default function List (props: Props): any {
import * as React from 'react'
import { Grid } from 'material-ui-next'
interface Props {
indexes: [ number ],
component: any
}
export default function List (props: Props): any {
import * as React from 'react'
interface Props {
indexes: [ number ],
component: any
}
export default function List (props: Props): any {
return props.indexes.map((index: number): any => {
import * as React from 'react'
interface Props {
indexes: [ number ],
component: any
}
export default function List (props: Props): any {
return props.indexes.map((index: number): any => {
import * as React from 'react'
class Test extends React.Component<any, any> {
constructor (props: any) {
super(props)
}
render () {
return <Register foo='This is '>my beloved child</Register>
}
}
@ioness
ioness / App.js
Last active May 17, 2018 04:13
redux_little_router_plus_create_react_app_problem
// App.js
import React, { Component } from 'react'
import { Fragment } from 'redux-little-router'
import logo from './logo.svg'
import './App.css'
const pdf1 = require('./pdf/4-FOR-BANK-ACCOUNT.pdf')
const pdfProblema = require('./pdf/studentfy.pdf')
private function _doSocialLogin($profile, $returning = false) {
$user_exist = !empty($profile['SocialProfile']['user_id']) ? $this->User->findById($profile['SocialProfile']['user_id']) : null;
if ($user_exist && $user_exist['User']['is_registered'] == 1) {
if ($user_exist['User']['is_active'] == 1) {
if ($this->Auth->login($user_exist['User'])) {
if ($this->Auth->login()) {
from selenium import webdriver
def driver():
option = webdriver.ChromeOptions()
option.add_argument(' — incognito')
return webdriver.Chrome(executable_path='/path/to/chromedriver', chrome_options=option)