Skip to content

Instantly share code, notes, and snippets.

View jumplee's full-sized avatar
🤩

lee jumplee

🤩
View GitHub Profile
@jumplee
jumplee / .eslintrc.js
Created October 13, 2017 01:48
vue项目的js样式标准
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
env: {
browser: true,
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
extends: 'vue',
Array.prototype.last = function () {
return this[this.length - 1]
}
var getRandomColor = function () {
var str = '#'
for (var i = 0; i < 6; i++) {
str += '0123456789abcdef' [Math.floor(Math.random() * 16)]
}
return str
}
@jumplee
jumplee / for.js
Last active April 24, 2016 01:34
循环改变一个数组的内容的方法
var arr=[
{
name:'myName0'
},
{
name:'myName1'
},
{
name:'myName2'
},
// 自定义配置
var client = {
id: "",
secret: ""
};
var redirect_uri = "http://lizheming.com:8360/login/callback";
var querystring = require("querystring");
var request = require("request");
@jumplee
jumplee / config.json
Created February 26, 2016 03:15 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
//Mobile Safari in standalone mode
if (("standalone" in window.navigator) && window.navigator.standalone) {
// If you want to prevent remote links in standalone web apps opening Mobile Safari, change 'remotes' to true
var noddy,
remotes = false;
document.addEventListener('click', function(event) {
noddy = event.target;
//Bubble up until we hit link or top HTML element. Warning: BODY element is not compulsory so better to stop on HTML
while (noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
noddy = noddy.parentNode;
//http://momentjs.cn/docs/#/durations/
//a more easy scrollspy
$(function(){
'use strict';
function ScrollSpy(element, options) {
var process = $.proxy(this.process, this);
this.$body = $('body');
this.$scrollElement = $(window);
function getParam(param){
var url=location.href;
var reg =new RegExp(param+'=(.*)');
var index=url.indexOf('?');
var param_str=url.substr(index);
var paramArray=reg.exec(param_str);
if(paramArray.length==2){
return paramArray[1];
}else{
return '';
@jumplee
jumplee / SVG Loading icons.markdown
Created August 5, 2015 10:45
SVG Loading icons