Vue.components('my-component', {
ready () {
this.doSomething()
}
})
equals
Vue.components('my-component', {
This file contains 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 Raven = require('raven') | |
exports.capture = function (err, options = {}) { | |
return new Promise((resolve, reject) => { | |
const client = new Raven.Client(RAVEN_DSN) | |
const listener = res => { |
This file contains 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
# video playback | |
vo=opengl-hq:icc-profile-auto | |
autofit-larger=95%x90% | |
autofit-smaller=30%x30% | |
# tries to automatically enable hardware decoding | |
hwdec=auto | |
# osd message, you can press o to display the osd message | |
osd-bar-align-y=0.9 | |
osd-bar-h=1.2 |
This file contains 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
/** | |
* Detect if element is in view | |
* | |
* @method isElementInView | |
* @param {HTMLElement} element the target element | |
* @param {HTMLElement} [parentElement] container element, default is widnow | |
* @param {Boolean} [ignoreBottom] useful when element is taller than container | |
* @return {Boolean} element is in view or not | |
*/ | |
function isElementInView (element, parentElement, ignoreBottom) { |
This file contains 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
// http://davidwalsh.name/javascript-clone | |
function clone(src) { | |
function mixin(dest, source, copyFunc) { | |
var name, s, i, empty = {}; | |
for(name in source){ | |
// the (!(name in empty) || empty[name] !== s) condition avoids copying properties in "source" | |
// inherited from Object.prototype. For example, if dest has a custom toString() method, | |
// don't overwrite it with the toString() method that source inherited from Object.prototype | |
s = source[name]; | |
if(!(name in dest) || (dest[name] !== s && (!(name in empty) || empty[name] !== s))){ |
This file contains 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 addtionalExts = [] | |
const fs = require('fs') | |
const path = require('path') | |
function find (root, p, re, recursive) { | |
if (root) { | |
p = path.resolve(root, p) | |
} |
This file contains 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
{ | |
"parserOptions": { | |
"ecmaVersion": 6 | |
}, | |
"env": { | |
"es6": true, | |
"node": true | |
}, |
This file contains 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
#!/usr/bin/env sh | |
if [ -d "$(brew --prefix)/Cellar" ]; then | |
node=`find /usr/local/Cellar -name node | grep iojs/.*/bin/node` | |
if [ ! -z "$node" ]; then | |
$node $@ | |
else | |
echo "io.js not installed" | |
fi | |
else |
This file contains 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
setInterval(updateDockBadge, 500) | |
function updateDockBadge() { | |
var dots = document.querySelectorAll('.nav_view .chat_item .avatar .web_wechat_reddot_middle') | |
var badge = [].reduce.call(dots, function(pv, cv) { | |
var badge = Math.floor(cv.textContent) | |
if (isNaN(badge)) { | |
return 0 |