Comment your info to this gist as JSON, and the page would load the newest data automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.snapshot = function (property) { | |
const snapshot = this.attr(property); | |
return () => { | |
this.attr(property, snapshot); | |
}; | |
}; | |
export function preventBodyScrolling($wrap) { | |
const $body = $("body"); | |
const cbArr = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function traverse(node, hierarchy) { | |
const className = node.props && node.props.style;//array | |
if (className) { | |
className.forEach((name, i) => { | |
if (typeof name === 'string') { | |
const styleObject = {}; | |
if (style[name]) { | |
style[name].forEach((obj) => { | |
Object.assign(styleObject, obj.style); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const hashbow = require('hashbow'); | |
exports.getTabProps = function (uid, parentProps, props) { | |
const ret = {}; | |
Object.assign(ret, props, { | |
dabColor: hashbow(props.text) | |
}); | |
ret.text = ret.text.replace(/blackmiaool@blackmiaool-OptiPlex-9020:/, "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VueTag { | |
constructor(data) { | |
Object.assign(this, data); | |
this.originalData = data; | |
} | |
setContent(content) { | |
this.originalData.content = content; | |
this.content = content; | |
} | |
text(content) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toggleClass(allClass,className){ | |
let got=false; | |
allClass=allClass.replace(new RegExp(`(\\s|^)(${className})(\\s|$)`),function(full,pre,target,after){ | |
got=true; | |
//center | |
if(pre&&after){ | |
return " "; | |
}else{ | |
return "" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usage: | |
static propTypes = { | |
SyncHeight: PropTypes.any, | |
} | |
static defaultProps = { | |
SyncHeight: View | |
} | |
render(){ | |
return (<SyncHeight name="product" style={styles.productImage}> | |
<Touchable type="opacity" onPress={this.handlePress} activeOpacity={0.8}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getParam(url, name, defaultValue) { | |
const reg = new RegExp(`[?&]${name}=([\\s\\S]+?)(&|$)`); | |
const match = url.match(reg); | |
if (match) { | |
return match[1].trim(); | |
} else { | |
return defaultValue; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------------------------------------------------------------------------------------------- | |
* Copyright (c) Microsoft Corporation. All rights reserved. | |
* Licensed under the MIT License. See License.txt in the project root for license information. | |
* ------------------------------------------------------------------------------------------ */ | |
'use strict'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
const path = require("path"); | |
const fs = require("fs"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Socket { | |
init(ws) { | |
this.ws = ws; | |
if (this.isClient) { | |
ws.addEventListener('open', () => { | |
}); | |
} | |
ws.addEventListener("message", (message) => { | |
if (!message.data || message.data.match(/^\d+$/)) { |