Skip to content

Instantly share code, notes, and snippets.

View AllenFang's full-sized avatar
🇹🇼
I may be slow to respond.

allen AllenFang

🇹🇼
I may be slow to respond.
View GitHub Profile
@AllenFang
AllenFang / gist:446be8aa28b3aba8ad26
Last active August 29, 2015 14:27
operation.txt
i => edit
<vim 操作指令>
esc => exit edit
:q => quit vim
:q! => quit vim & not overwrite
:wq => write & quit vim
-------------------------------------------------
<Terminal 操作指令>
ll => list file and directory
@AllenFang
AllenFang / radio-btn.js
Created November 24, 2015 05:56
reactjs
var RadioGroup = React.createClass({
getInitialState: function () {
return {
select: null
};
},
handleRdioBtnChange: function(e){
this.setState({
import React from 'react';
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
var products = [];
function addProducts(quantity) {
var startId = products.length;
for (var i = 0; i < quantity; i++) {
var id = startId + i;
products.push({
@AllenFang
AllenFang / custom-filter.js
Last active February 12, 2017 10:30
react-bootstrap-table custom filter
/* eslint max-len: 0 */
/* eslint no-unused-vars: 0 */
import React from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
const products = [];
function addProducts(quantity) {
const startId = products.length;
for (let i = 0; i < quantity; i++) {
@AllenFang
AllenFang / HBaseNewAPI.scala
Created March 30, 2016 07:03 — forked from wuchong/HBaseNewAPI.scala
Spark 下 操作 HBase 1.0.0 新版API
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration}
import org.apache.hadoop.hbase.client._
import org.apache.spark.SparkContext
import scala.collection.JavaConversions._
/**
* HBase 1.0.0 新版API, CRUD 的基本操作代码示例
**/
object HBaseNewAPI {
@AllenFang
AllenFang / basic-table.jsx
Last active November 14, 2020 18:17
It's a basic react-bootstrap-table
class Table extends React.Component {
render() {
return (
<BootstrapTable data={ products }>
<TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
@AllenFang
AllenFang / no-data-table.jsx
Created October 27, 2016 12:56
Custom Text for Empty Data
class NoDataTable extends React.Component {
render() {
return (
<BootstrapTable data={ products } options={ { noDataText: 'This is custom text for empty data' } }>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
@AllenFang
AllenFang / borderless-table.jsx
Created October 27, 2016 12:57
borderless table
class BorderlessTable extends React.Component {
render() {
return (
<BootstrapTable data={ products } bordered={ false }>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
@AllenFang
AllenFang / hover-striped-condensed-table.jsx
Created October 27, 2016 12:58
Hover, striped, condensed table
class HoverStripedTable extends React.Component {
render() {
return (
<BootstrapTable data={ products } striped hover condensed>
<TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
@AllenFang
AllenFang / large-table.jsx
Created October 27, 2016 12:59
Horizontal scroll table
class LargeColumnTable extends React.Component {
render() {
return (
<BootstrapTable data={ products }>
<TableHeaderColumn width='150' dataField='id' isKey>ProductID</TableHeaderColumn>
<TableHeaderColumn width='150' dataField='name'>ProductName</TableHeaderColumn>
<TableHeaderColumn width='150' dataField='price'>ProductPrice</TableHeaderColumn>
<TableHeaderColumn width='150' dataField='name'>ProductName</TableHeaderColumn>
<TableHeaderColumn width='150' dataField='price'>ProductPrice</TableHeaderColumn>
<TableHeaderColumn width='150' dataField='name'>ProductName</TableHeaderColumn>