Skip to content

Instantly share code, notes, and snippets.

.test1 {
text-align:justify;
text-justify:distribute-all-lines;/*ie6-8*/
text-align-last:justify;/* ie9*/
-moz-text-align-last:justify;/*ff*/
-webkit-text-align-last:justify;/*chrome 20+*/
}
@media screen and (-webkit-min-device-pixel-ratio:0){/* chrome*/
.test1:after{
content:".";
function sku() {
var result = [];
var arr = Array.prototype.slice.call(arguments);
(function fn(parameter, array, len) {
if (len == 0) return result.push(parameter);
for (var i = 0; i < array[len - 1].length; i++) {
fn(parameter.concat(array[len - 1][i]), array, len - 1);
}
})([], arr, arr.length);
return result;
@lichenbuliren
lichenbuliren / introrx.md
Created November 24, 2016 07:39 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@lichenbuliren
lichenbuliren / index.css
Created December 26, 2016 02:23
移动端 IOS 滑动问题
iOS 下原生内容滚动比较卡可以给容器添加下面 CSS 属性:
-webkit-overflow-scrolling: touch;
@lichenbuliren
lichenbuliren / hack.js
Created January 4, 2017 09:47
一些 js 小技巧
// 保留两位数字符
const twoDigits = (num) => ('0' + num).slice(-2);
@lichenbuliren
lichenbuliren / _tint-and-shade.scss
Created January 8, 2017 09:57
Tint and Shade functions for Sass
// Add percentage of white to a color
@function tint($color, $percent){
@return mix(white, $color, $percent);
}
// Add percentage of black to a color
@function shade($color, $percent){
@return mix(black, $color, $percent);
}
@lichenbuliren
lichenbuliren / img.css
Created February 8, 2017 06:21
美化图片加载失败样式
img {
/* Same as first example */
min-height: 50px;
}
img:before {
content: " ";
display: block;
position: absolute;
@lichenbuliren
lichenbuliren / hack.html
Created February 9, 2017 06:35
hack 处理微信识别二维码图片问题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<img src="base64:xxxxx" class="hack-qcode"/>
</body>
</html>
@lichenbuliren
lichenbuliren / index.js
Created February 17, 2017 08:09
得到某个区间的字母组成的数组
function getArrForAlphabet(startLetter, endLetter) {
//var regExp = /^[a-zA-Z]$/gi;
var regExp = new RegExp("^[a-zA-Z]$");
if (!regExp.test(startLetter) || !regExp.test(endLetter)) {
//console.log(regExp.test(startLetter));
//console.log(regExp.test(endLetter));
console.log('请传入字母!');
return false;
};
//i是得到开始字母的数字表示,j得到结束字母的数字表示
@lichenbuliren
lichenbuliren / text-3d.scss
Created March 8, 2017 09:28
文字 3D 立体效果
@mixin text-3d($color: white, $depth: 5) {
$shadows: ();
$shadow-color: $color;
@for $i from 1 through $depth {
$shadow-color: darken($shadow-color, 10%);
$shadows: append($shadows, 0 ($i * 1px) $shadow-color, comma);
}
color: $color;