Skip to content

Instantly share code, notes, and snippets.

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;
.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:".";
@lichenbuliren
lichenbuliren / my.sh
Created October 17, 2016 07:27 — forked from kaiye/my.sh
常用 Linux 命令行
# 网络
# 查看本地公网 IP
curl ifconfig.me
dig 1024.io
dig -x 104.155.233.156
# 并发测试
ab -n 1000 -c 1000 http://www.meizu.com/
# 全站抓取
wget -r -p -np -k http://www.meizu.com/es/
@lichenbuliren
lichenbuliren / demo.css
Created October 8, 2016 10:14
首字符大写
.price {
display: inline-block;
color: #FF5802;
}
.price:first-letter {
margin-right: 5px;
font-size: xx-large;
vertical-align: -2px;
}
/**
* 函数节流实现
* @param {Function} fn 需要节流执行的函数
* @param {[type]} interval 事件执行间隔时间,单位 ms
* @return {[type]} [description]
*/
var throttle = function(fn, interval) {
var _self = fn,
timer,
firstTime = true;
/**
* 分时函数例子
* 以创建 WebQQ 列表为例
* @param {[type]} data 函数执行需要用到的数据
* @param {Function} fn 真正需要分时执行的函数
* @param {[type]} count 每次创建一批节点的数量
* @param {[type]} interval 函数执行间隔
* @return {[type]} [description]
*/
var timeChunk = function(data, fn, count, interval) {
/**
* 倒计时
* @param {[type]} countTime 倒计时时间
* @param {[type]} perFn 每秒执行的函数
* @param {[type]} complate 倒计时完成函数
* @return {[type]} [description]
*/
function countDown(countTime, perFn, complate) {
var count = countTime;
countFn(count);
@lichenbuliren
lichenbuliren / input_cursor_color
Created July 26, 2016 05:50 — forked from JoeKeikun/input_cursor_color
How to change <input> input cursor color by css (webkit)
When I developed an app for ios by phonegap, I had a trouble in changing the <input> input cursor color.
but now, there is a solution for it:
---------------
<style>
input {
color: rgb(60, 0, 248); /* change [input cursor color] by this*/
text-shadow: 0px 0px 0px #D60B0B; /* change [input font] by this*/
-webkit-text-fill-color: transparent;
/**
* 遍历文件夹目录
* @param {[type]} dir [description]
* @param {Function} callback [description]
* @return {[type]} [description]
*/
function travel(dir, callback) {
var fileList = [],
folderList = [];
@lichenbuliren
lichenbuliren / parseurl.js
Created June 14, 2016 08:14 — forked from aNd1coder/parseurl.js
A useful javascript url parse function
function parseURL(url) {
var parser = document.createElement('a'),
searchObject = {},
queries, split, i;
// Let the browser do the work
parser.href = url;
// Convert query string to object
queries = parser.search.replace(/^\?/, '').split('&');
for( i = 0; i < queries.length; i++ ) {
split = queries[i].split('=');