Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Flask websocket</title>
</head>
<body>
<h3>Flask websocket</h3>
coreURL: <input id="core" type="text" value="http://docker.cs.nctu.edu.tw:32774" />
@waynelkh
waynelkh / index.html
Created January 29, 2016 00:23 — forked from anonymous/index.html
testing on jsbin // source http://jsbin.com/yamiyo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>testing on jsbin</title>
<script src="http://npmcdn.com/redux@3.0.6/dist/redux.js"></script>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/mocha/1.18.2/mocha.css">
</head>
<body>
<pre><div id="app">Result</div></pre>
@waynelkh
waynelkh / LoadingProgress.js
Created January 28, 2016 18:58
Loading component like youtube, only send boolean to display or not
import React, { PropTypes } from 'react'
import LinearProgress from 'material-ui/lib/linear-progress';
const LoadingProgress = ({ isLoading }) => {
return ( isLoading ?
<LinearProgress
color={"rgb(255, 0, 20)"}
mode="indeterminate"
style={{
position: 'fixed',
@waynelkh
waynelkh / FixButton.js
Created January 28, 2016 18:53
like inbox right bottom button, always fix
import React, { PropTypes } from 'react'
import FloatingActionButton from 'material-ui/lib/floating-action-button';
const FixButton = ({ onAddClick }) => {
return (
<FloatingActionButton
style={{ right: 20, bottom: 20, position: 'fixed' }}
onClick={onAddClick}>
<ContentAdd />
</FloatingActionButton>
@waynelkh
waynelkh / LeftNavBar.jsx
Last active January 24, 2016 19:51
Some issue with javascript bind
import React from 'react';
import MenuItem from 'material-ui/lib/menus/menu-item';
class LeftNavBar extends React.Component {
constructor(props) {
super(props);
// this.onMenuListTap = this.onMenuListTap.bind(this);
this.state = {
menuItems: [
@waynelkh
waynelkh / .tern-project
Created January 24, 2016 14:13
vim tern settings
{
"ecmaVersion": 6,
"libs": [],
"loadEagerly": [
"src/js/**/*.js",
"src/js/**/*.jsx"
],
"dontLoad": [
"node_modules/**"
],
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails react-core
*/
@waynelkh
waynelkh / designer.html
Created September 8, 2015 23:54
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
@waynelkh
waynelkh / redux-react.js
Last active August 29, 2015 14:27
react with redux
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["Redux"] = factory(require("react"));
else
root["Redux"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_23__) {