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
function randomRange(t, i) { | |
return Math.random() * (i - t) + t | |
} | |
Particle3D = function(t) { | |
THREE.Particle.call(this, t), this.velocity = new THREE.Vector3(0, -2, 0), this.velocity.rotateX(randomRange(-45, 45)), this.velocity.rotateY(randomRange(0, 360)), this.gravity = new THREE.Vector3(0, 0, 0), this.drag = 1 | |
}, Particle3D.prototype = new THREE.Particle, Particle3D.prototype.constructor = Particle3D, Particle3D.prototype.updatePhysics = function() { | |
this.velocity.multiplyScalar(this.drag), this.velocity.addSelf(this.gravity), this.position.addSelf(this.velocity) | |
}; | |
var TO_RADIANS = Math.PI / 180; |
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
var Vue = require('vue'); | |
Vue.directive('delay-execute', { | |
acceptStatement: true, | |
bind: function () { | |
this._delayRunTimeout = parseInt(this.arg, 10) || 1000; | |
}, | |
update: function (handle) { | |
this.reset(); | |
this._delayRunTimer = setTimeout(handle, this._delayRunTimeout); |
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
/** | |
* @file customizing jasmine global json diff matchers | |
* @author Kyle He (4hekai@gmail.com) | |
*/ | |
var path = require('path'); | |
var jsonDiffPatch = require('jsondiffpatch'); | |
var Jasmine = require('jasmine'); | |
var jasmine = new Jasmine({ |
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
var Vue = require('vue'); | |
var UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; | |
var STEP = 1024; | |
function format(value, power) { | |
return (value / Math.pow(STEP, power)).toFixed(2) + UNITS[power]; | |
} | |
Vue.filter('smart-file-size', { |
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
(function (a) { | |
if (!a) return ; | |
var r = a.getAttribute('onmousedown').match(/^return (\w+)\(/i); | |
if (r && r[1]) { | |
window[r[1]] = function () {}; | |
} | |
})(document.querySelector('#rso h3.r a')); |
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
; Press Middle Mouse Button to active Mission Control | |
MButton::Send, #{Tab} | |
; OSX-Like Reversed Scroll | |
WheelUp::Send, {WheelDown 1} | |
WheelDown::Send, {WheelUp 1} | |
; Vim-Like Cursor Move | |
; Physical CapsLock Key has been remapped as Esc by KeyTweak |
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
#!/bin/sh | |
ACCOUNT="xijinpin@gov.cn" | |
PASSWORD="fuckccp!" | |
######################################### | |
function urlEncode() { | |
python -c " | |
import urllib, commands, os; |
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
(function(topWindow, document){ | |
var iframeWindow; | |
var whiteList = [/*'jQuery', '$', ...*/]; | |
var ret = []; | |
function checkGlobalVar() { | |
var iframe = document.createElement('iframe'), i, originValue; | |
document.body.appendChild(iframe); | |
iframeWindow = iframe.contentWindow; | |
for(i in topWindow) { | |
if(!(i in iframeWindow) && !~whiteList.indexOf(i)) { |
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
tell application "Google Chrome" | |
set pageUrl to get URL of active tab of first window | |
end tell | |
tell application "Safari" to add reading list item pageUrl | |
display notification pageUrl with title "Added to Reading List" |
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
陶陶说,女人真看不懂,经常讲反话,比如喜欢一个男人,就到处讲这个男人不好,其实心里, | |
早就有想法了,已经喜欢了,对不对。沪生转身说,以后再讲吧。陶陶拉紧沪生说,最近有了重 | |
大新闻,群众新闻,要听吧。沪生说,我现在忙,再会。陶陶说,相当轰动。沪生说,陶陶讲的轰 | |
动,就是某某人搞腐化,女老师欢喜男家长,4号里的十三点,偷邻居胸罩。陶陶说,绝对有意 | |
思,我讲了。沪生说,我现在忙,有空再讲。陶陶拉紧沪生说,我简单讲,也就是马路小菜场, | |
一男一女两个摊位。沪生说,放手好吧。陶陶松手说,当中是小马路,男的摆蛋摊,马路对面的 | |
女人,年长几岁,摆鱼摊。沪生说,简单点。陶陶说,马路上人多,两个人互相看不见,接近收 | |
摊阶段,人少了,两个人就互相看。沪生说,啥意思。陶陶说,鸡蛋卖剩了半箱,鱼摊完全出 | |
货,自来水一冲,离下班还有三刻钟,男女两人,日长事久,眉来眼去,隔了马路,四只眼睛碰 | |
火星,结果呢。沪生说,互相送鸡蛋,送小黄鱼。陶陶说,错,鸡蛋黄鱼,有啥意思,到这种阶 |