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
[ | |
'facebookexternalhit', | |
'Facebot', | |
'Twitterbot', | |
'WhatsApp', | |
'Pinterest', | |
'TelegramBot', | |
'Google Web Preview', | |
'FeedFetcher-Google', | |
'linkedinbot', |
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
import { createElement } from '@vue/composition-api' | |
import htm from 'htm' | |
const acceptValue = ['input', 'textarea', 'option', 'select'] | |
function getVNodeData (tag, attrs) { | |
const data = {} | |
const basics = ['slot', 'key', 'ref', 'refInFor', 'class', '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
const components = { | |
'*': 'strong', | |
'_': 'em', | |
'~': 's', | |
'```': 'code' | |
} | |
export default { | |
functional: true, | |
props: { |
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 KonamiCodeMixin (callback) { | |
const KEYS = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'KeyB', 'KeyA'] | |
let i = 0 | |
return { | |
mounted () { | |
window.addEventListener('keyup', this.onKeyUp) | |
}, | |
destroyed () { | |
window.removeEventListener('keyup', this.onKeyUp) |
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
[ | |
[ | |
"gbdmg", | |
[ | |
[ | |
42, | |
69, | |
59 | |
], | |
[ |
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
module.exports = { | |
name: 'StarRating', | |
functional: true, | |
props: { | |
stars: { | |
type: Number, | |
default: 0 | |
}, | |
tag: { | |
type: String, |
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() { | |
let props = $$('*') | |
.filter(x => Object.keys(x.dataset).length) | |
.reduce((o,x) => { | |
Object.keys(x.dataset).forEach(key => { | |
o[key] = key.replace(/[A-Z]/g, y => '-' + y.toLowerCase()); | |
}); | |
return o; | |
}, {}); |
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
var Promise = require('bluebird'); | |
var fs = require('fs'); | |
var noop = function(){}; | |
var DEFAULT_TIMEOUT = 60 * 2 * 1000; | |
module.exports = function watch(fileName, until, timeout) { | |
var watcher; | |
if (typeof until !== 'function') until = noop; | |
timeout = Number(timeout) || DEFAULT_TIMEOUT; |
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
var exec = require('child_process').exec; | |
var rForbidden = /(["'#&;`\|\*\?~<>\^\(\)\[\]\{\}\$\\\x0A\xFF])/g; | |
var isWindows = process.platform === 'win32'; | |
module.exports = function(cmd, options, callback) { | |
cmd = cmd.replace(rForbidden, isWindows ? '^$1': '\\$1'); | |
return exec(cmd, options, callback); | |
}; |
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 create(proto, obj) { | |
var descriptor = {}; | |
Object.keys(Object(obj)).forEach(function(prop) { | |
descriptor[prop] = Object.getOwnPropertyDescriptor(obj, prop); | |
}); | |
return Object.create(proto || null, descriptor); | |
} |
NewerOlder