Skip to content

Instantly share code, notes, and snippets.

View teabyii's full-sized avatar
💭
I may be slow to respond.

Kent Li teabyii

💭
I may be slow to respond.
View GitHub Profile
@teabyii
teabyii / random
Last active August 29, 2015 14:03
Produce random code in shell
cat /dev/urandom | head -1 | md5sum | cut -c 1-16
function _isSupportInputDate() {
var input = document.createElement('input')
input.type = 'date'
input.value = 'test' // input[type=date] can't set value as a string.
return input.value !== 'date'
}
@teabyii
teabyii / todomvc-flux.md
Last active August 29, 2015 14:24
flux入门

我的 flux 入门

看 flux 官网的文档还是有些云里雾里的,需要一个 demo 来帮助在实践中进行理解,果断要选择 todomvc。

todomvc 已经有了各种各样框架的实现版本,在 flux 官方仓库中也提供了 tomomvc 的 flux� 版本,拿它作为入门学习 flux 的 demo 是相当不错的。

本文仅仅使用 todomvc 作为一个例子来说明,不会对其进行具体的代码解析。

从目录结构看 flux 的组成

ES6 带来了什么

未来已来,突然好喜欢这句话,哈哈。

ES6 已经离我们越来越近了,不久前发布了 ES6 标准文档,而 babel 社区如火如荼,对于 ES6 究竟给 js 开发者们带来了什么东西,我们来简单地了解一下。

这个文章并不会深入讲解某一部分的内容,只是帮助你快速地浏览一下 ES6 相关的东西究竟有哪一些,毕竟,其中每一部分的内容深入探讨都足够是一篇新的文章。

新增语法

@font-face {
font-family: 'iconfont';
src: url('iconfont.eot'); /* IE9*/
src: url('iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff') format('woff'), /* chrome、firefox */
url('iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('iconfont.svg#uxiconfont') format('svg'); /* iOS 4.1- */
}
@teabyii
teabyii / react-src-module-map.json
Last active October 14, 2015 09:43
react source code module-path mapping
{
"React": "src/React.js",
"ReactVersion": "src/ReactVersion.js",
"ReactComponentWithPureRenderMixin": "src/addons/ReactComponentWithPureRenderMixin.js",
"ReactFragment": "src/addons/ReactFragment.js",
"ReactWithAddons": "src/addons/ReactWithAddons.js",
"LinkedStateMixin": "src/addons/link/LinkedStateMixin.js",
"ReactLink": "src/addons/link/ReactLink.js",
"renderSubtreeIntoContainer": "src/addons/renderSubtreeIntoContainer.js",
"shallowCompare": "src/addons/shallowCompare.js",
@teabyii
teabyii / about-susy.md
Last active October 30, 2015 09:49
About Susy

关于 Susy

Susy 官方网站

开始使用

Susy 是一个用于创建自定义布局结构的 css 工具集合,它并不提供现成的 className 来给你使用,而是提供 sass 的 function/mixins 来帮助你创建页面的布局结构。

Susy 作为一个 sass 工具库,使用的时候 @import 进来便是,可以使用 npm/bower 来下载。

@teabyii
teabyii / scroll.html
Created January 19, 2016 12:38
chrome scroll issue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Scroll test</title>
</head>
<body>
<div style="height:1800px">
hello world
</div>
@teabyii
teabyii / swift-basic.md
Last active January 20, 2016 04:18
Swift 入门笔记

swift 入门笔记

变量

let 声明常量,var 声明变量

var myVariable = 2
myVariable = 3
let myConstant = 4
#!/bin/bash
# 只检查提交的 src 下的 js 文件
eslint=./node_modules/.bin/eslint
result=0
for file in `git diff --cached --name-only`
do
if [[ $(echo $file | grep -E "^src\/.*\.js$" | wc -l) -gt 0 ]];
then