Skip to content

Instantly share code, notes, and snippets.

View juwencheng's full-sized avatar
🏠
Working from home

Juwencheng juwencheng

🏠
Working from home
View GitHub Profile
@juwencheng
juwencheng / disc_64_128_256.py
Last active May 16, 2017 08:08
Udacity final project - gan face variant version
# coding: utf-8
# # Face Generation
# In this project, you'll use generative adversarial networks to generate new images of faces.
# ### Get the Data
# You'll be using two datasets in this project:
# - MNIST
# - CelebA
#
@juwencheng
juwencheng / arrayfunc.js
Created May 21, 2017 08:25
simple demo shows usage of array function
let numbers = [2, 3, 4, 5, 6, 7]
let doubled = numbers.map((n) => n * 2);
console.log(doubled);
let person = {
name: 'Ryan',
hobbies: ['Robots', 'Computers', 'Internet'],
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// section 1
// let sum = function(...args) {
// return args.reduce((prev,curr)=>prev + curr)
// };
// console.log(sum(2,3,4,5))
// section 2
// let multiply = (mul, ...numbers) => {
// console.log(mul,numbers)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.js"></script>
@juwencheng
juwencheng / index.html
Created May 22, 2017 02:57
Redux simple demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/expect/1.20.2/expect.js"></script>
@juwencheng
juwencheng / MySectionList.js
Created May 22, 2017 09:26
React Native How to use SectionList, but have warning: "A section you supplied is missing the key property"
/**
* Created by Owen Ju on 22/05/2017.
*/
import React, {Component} from 'react'
import {AppRegistry, View, Text, StyleSheet, SectionList} from 'react-native'
// build mock data
const sections = [
{
@juwencheng
juwencheng / ConfDetail.js
Created May 22, 2017 09:55
React Native Conference detail
/**
* Created by Owen Ju on 22/05/2017.
*/
import React, {Component} from 'react'
import {AppRegistry, View, Text, StyleSheet, Image} from 'react-native'
export default class ConfDetail extends Component {
render() {
return (
@juwencheng
juwencheng / floydusage.sh
Created May 22, 2017 13:12
FloydHub usage
# 安装 cli
pip install -U floyd-cli
# 登录账户
floyd login
# 拷贝授权码到终端
# 输入登录命令后会提示你授权码页面将打开您的浏览器,是否打开,输入y 即可
@juwencheng
juwencheng / App.js
Created May 23, 2017 00:18
React Native Redux Usage
import React, { Component } from 'react'
import { AppRegistry, View } from 'react-native'
import { connect } from 'react-redux'
import { actionCreators } from './todoListRedux'
import List from './List'
import Input from './Input'
import Title from './Title'
const mapStateToProps = (state) => ({