Skip to content

Instantly share code, notes, and snippets.

@KirinHuang
KirinHuang / app-vconsole.html
Last active April 22, 2019 02:00
A lightweight, extendable front-end developer tool for mobile web page.
<script src="https://unpkg.com/[email protected]/dist/vconsole.min.js"></script>
<script>
// init vConsole
var vConsole = new VConsole();
</script>
@KirinHuang
KirinHuang / nginx.conf
Created February 27, 2018 07:47 — forked from wmzy/nginx.conf
spa nginx config | 单页应用 nginx 配置
upstream backend {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name your.hostname.com;
proxy_set_header Host $http_host;
access_log /tmp/test-access.log debug;
rewrite_log on;
@KirinHuang
KirinHuang / index.html
Created April 18, 2017 10:13
动态404
<div class="a3-404">
<div class="a3-container a3-min-height">
<h1>4</h1>
<h1>0</h1>
<h1>4</h1>
<h1>页面不存在</h1>
<p><mu-raised-button label="回到首页" href="/" class="demo-raised-button" secondary/></p>
<h2>或者联系客服</h2>
</div>
</div>
@KirinHuang
KirinHuang / select.css
Created March 30, 2017 03:13
修改Select默认样式
/* 参考 */
select {
/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
border: solid 1px #000;
/*很关键:将默认的select选择框样式清除*/
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
@KirinHuang
KirinHuang / none-select.css
Created March 21, 2017 05:50
页面禁止用户选中
* {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}
@KirinHuang
KirinHuang / fmtDate
Last active January 23, 2018 04:44
时间格式化
const fmtDate = function (_date, fmt) {
var date = new Date(_date)
var o = {
'M+': date.getMonth() + 1, // 月份
'd+': date.getDate(), // 日
'h+': date.getHours(), // 小时
'm+': date.getMinutes(), // 分
's+': date.getSeconds(), // 秒
'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
'S': date.getMilliseconds() // 毫秒