Skip to content

Instantly share code, notes, and snippets.

😆
lol

Keenwon keenwon

😆
lol
Block or report user

Report or block keenwon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View output.txt
v11.7.0
6.5.0
koa-subdomain@2.4.0 /home/keenwon/Code/koa-subdomain
├─┬ chai@4.2.0
│ ├── assertion-error@1.1.0
│ ├── check-error@1.0.2
│ ├─┬ deep-eql@3.0.1
│ │ └── type-detect@4.0.8 deduped
│ ├── get-func-name@2.0.0
│ ├── pathval@1.1.0
@keenwon
keenwon / unistore.js
Created Nov 22, 2017 — forked from developit/unistore.js
dead simple centralized state container ("store"), with preact bindings.
View unistore.js
import { h, Component } from 'preact';
/** Creates a new store, which is a tiny evented state container.
* @example
* let store = createStore();
* store.subscribe( state => console.log(state) );
* store.setState({ a: 'b' }); // logs { a: 'b' }
* store.setState({ c: 'd' }); // logs { c: 'd' }
*/
@keenwon
keenwon / radar.html
Created May 12, 2017
canvas 雷达动画
View radar.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Canvas · 雷达动画</title>
<style>
* {
margin: 0;
padding: 0;
@keenwon
keenwon / loading.js
Created Mar 26, 2017
terminal进度条
View loading.js
const readline = require('readline');
// 百分比
let percentage = 0;
// 时长
let time = 5 * 1000;
// 频率
let frequency = 50;
// 步长
let step = 1 / (time / frequency);
View loadingbar.html
<!doctype html>
<html lang="zh-CN">
<head>
<title>Loading bar</title>
<meta charset="utf-8">
<style type="text/css">
.loadingbar {
position: fixed;
z-index: 2147483647;
top: 0;
View redux-middleware-test.html
<!doctype HTML>
<html>
<head>
<title>Redux Test</title>
</head>
<body>
<script src="https://npmcdn.com/redux@3.5.2/dist/redux.js"></script>
<script>
// actions
const ADD = 'ADD';
@keenwon
keenwon / .gitconfig
Created Mar 10, 2016
Pretty git branch graphs
View .gitconfig
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@keenwon
keenwon / css3.html
Last active Dec 21, 2015
一些CSS3动画效果
View css3.html
<!doctype html>
<!--[if lte IE 9]>
<html lang="zh-CN">
<![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="zh-CN" class="css3">
<!--<![endif]-->
<head>
<title>test</title>
<style>
@keenwon
keenwon / loadCss.js
Created Oct 22, 2015
js动态加载css
View loadCss.js
'use strict';
module.exports = function (cssText) {
if (!cssText) {
return;
}
var head = document.head || document.getElementsByTagName('head')[0],
style = document.createElement('style');
@keenwon
keenwon / spider.js
Last active Aug 29, 2015
Nodejs实现的简易网页抓取程序,支持代理(抓取墙外的资源)
View spider.js
var fs = require('fs'),
path = require('path'),
filePath = path.join(__dirname, 'log.txt'), //抓取结果写入log.txt文件
http = require('http');
var page = 1, //开始页码
maxPage = 100, //结束页码
search,
next,
run;
You can’t perform that action at this time.