Skip to content

Instantly share code, notes, and snippets.

View tsh-code's full-sized avatar

TSH code sharing tsh-code

View GitHub Profile
import * as React from 'react';
import { createRoute } from 'router-8000';
async function getRouteComponent(): JSX.Element {
const Component = await import(/* webpackChunkName: "landing" */'views/landing/container').LandingViewContainer;
return <Component />;
}
createRoute('/', getRouteComponent);
@tsh-code
tsh-code / hello-world.component.jsx
Created October 3, 2018 13:16
how-to-make-react-native-1
import React, {Component} from 'react';
import {Button, Text, View} from 'react-native';
class HelloWorld extends Component {
handlePress() {
// do something
}
render() {
return (
import React, {Component} from 'react';
class HelloWorld extends Component {
handleClick() {
// do something
}
render() {
return (
<div>
.container {
border: dashed 1px black;
height: 200px;
}
.title {
font-size: 19px;
font-weight: bold;
}
const styles = StyleSheet.create({
container: {
borderWidth: 1,
borderColor: 'black',
borderStyle: 'dashed',
height: 200,
},
title: {
fontSize: 19,
fontWeight: 'bold',
describe('Login flow', () => {
it('should login successfully', async () => {
await device.reloadReactNative();
await expect(element(by.id('email'))).toBeVisible();
await element(by.id('email')).typeText('[email protected]');
await element(by.id('password')).typeText('123456');
await element(by.text('Login')).tap();
await expect(element(by.text('Welcome'))).toBeVisible();
gulp.task('link-buld', function () {
return vfs.src(fullPath.concat('/*'), {followSymlinks: false})
.pipe(vfs.symlink(buildPath, {relativeSymlinks: true}));
});
index.html -> ../builds/build1513631722292/index.html
load-balancer:
image: dockercloud/haproxy
links:
- api
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 80:80
#!/bin/bash
get_first_container_num() {
echo `docker inspect --format='{{.Name}}' $(docker ps -q) | grep "$1" | awk -F "_" '{print $NF}' | sort -r | head -1`
}
APP_FOLDER="dockerzerodowntime"
APP_NAME="api" # from docker-compose
APP_CONTAINER_NAME="$APP_FOLDER"_"$APP_NAME"