Skip to content

Instantly share code, notes, and snippets.

View blackcater's full-sized avatar

Elon Tang blackcater

View GitHub Profile
@blackcater
blackcater / emoji.js
Created October 31, 2016 05:44
过滤emoji
function filterEmoji(str) {
return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, "")
}
@blackcater
blackcater / common.scss
Last active December 13, 2016 07:55 — forked from xiaojue/common.css
common.scss
@charset 'UTF-8';
// css reset
html,
body,
div,
span,
applet,
object,
iframe,
@blackcater
blackcater / rem.js
Created November 30, 2016 11:00 — forked from xiaojue/rem.js
rem.js
/*
* rem.js
* v0.1.1
* fixed 2015-3-12
*/
(function (win){
var doc = win.document,
html = doc.documentElement,
option = html.getAttribute('data-use-rem');
html {
scroll-behavior: smooth;
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
scroll-behavior: smooth;
margin: 0;
}
@blackcater
blackcater / h5.md
Last active July 11, 2019 01:36
H5项目常见问题汇总及解决方案

Meta基础知识:

H5页面窗口自动调整到设备宽度,并禁止用户缩放页面 //一、HTML页面结构 // width 设置viewport宽度,为一个正整数,或字符串‘device-width’ // height 设置viewport高度,一般设置了宽度,会自动解析出高度,可以不用设置 // initial-scale 默认缩放比例,为一个数字,可以带小数 // minimum-scale 允许用户最小缩放比例,为一个数字,可以带小数 // maximum-scale 允许用户最大缩放比例,为一个数字,可以带小数

@blackcater
blackcater / diagrams.md
Created July 6, 2018 16:45
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@blackcater
blackcater / sdk.fish
Last active September 6, 2018 02:55
sdkman support fishshell
# sdk command
function sdk
bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk $argv"
end
# add paths
for ITEM in $HOME/.sdkman/candidates/* ;
set -gx PATH $PATH $ITEM/current/bin
end
@blackcater
blackcater / main.css
Created November 13, 2018 07:26
Fit iphonex
// constant(safe-area-inset-top):在Viewport顶部的安全区域内设置量(CSS像素)
// constant(safe-area-inset-bottom):在Viewport底部的安全区域内设置量(CSS像素)
// constant(safe-area-inset-left):在Viewport左边的安全区域内设置量(CSS像素)
// constant(safe-area-inset-right):在Viewport右边的安全区域内设置量(CSS像素)
// constant 为 iOS 11 推荐,于 iOS 11.2 后更改为 env
// top, bottom, left, right 指你当前手机朝向的上下左右
@blackcater
blackcater / Mojave Theme Colors.scss
Created January 13, 2019 12:38
Mojave Theme Colors
// When color definition differs for dark and light variant,
// it gets @if ed depending on $variant
// Base colors
$base_color: if($variant =='light', #ffffff, #242424);
$text_color: if($variant == 'light', #363636, #dadada);
$bg_color: if($variant =='light', #f5f5f5, #333333);
$fg_color: if($variant =='light', #242424, #dedede);
$alt_fg_color: if($variant=='light', #383838, #3d3d3d);
@blackcater
blackcater / minikube-start.txt
Created August 22, 2019 15:42
minikube for chinese people.
minikube start --image-mirror-country="cn" --registry-mirror="http://f1361db2.m.daocloud.io"