Skip to content

Instantly share code, notes, and snippets.

View firedfox's full-sized avatar
🎯
Focusing

Daniel Wang firedfox

🎯
Focusing
  • Weimob
  • Shanghai, China
  • 15:20 (UTC +08:00)
View GitHub Profile
@firedfox
firedfox / shell.js
Created September 24, 2012 11:27
cloudfoundry run shell commands
// to exec a command in shell, use http://APP_NAME.cloudfoundry.com/shell?cmd=COMMAND_TO_RUN
exports.shell = function(req, res){
var exec = require('child_process').exec;
var child = exec(decodeURIComponent(req.query.cmd), function (error, stdout, stderr) {
res.send('<dl><dt>stderr</dt><dd><pre>' + stderr + '</pre></dd></dl>' +
'<dl><dt>stdout</dt><dd><pre>' + stdout + '</pre></dd></dl>');
});
};
@firedfox
firedfox / simple-word-search.js
Created September 24, 2012 15:47
simple word search
var words = {};
for (var i = 0; i < 5000; i++) {
words['word' + i] = 1;
}
var t0 = +new Date;
for (var j = 0; j < 100000; j++) {
if (words[j]) {
// do something here
}
}
@firedfox
firedfox / holmes-im-looyu-1.js
Created October 18, 2012 02:58
holmes-im-looyu-1
(function() {
var REQUEST_PATH = '/virtual/im/';
var REQUEST_NAME = ['buy-now', 'tech-support', 'vip', 'agent'];
var GET_ITEMS = function() {
var list = document.getElementById('doyoo_panel_main');
return list ? list.childNodes : [];
};
window._hmt = window._hmt || [];
@firedfox
firedfox / holmes-im-qiao.js
Created October 18, 2012 03:26
holmes-im-qiao
(function() {
var REQUEST_PATH = '/virtual/im/';
var REQUEST_NAME = ['float', 'popup'];
var GET_ITEMS = function() {
return [
document.getElementById('BDBridgeIconWrap'),
document.getElementById('BDBridgeInviteWrap')
];
};
@firedfox
firedfox / holmes-im-v4-qq.js
Last active October 11, 2015 19:38
holmes-im-v4-qq
(function() {
/**
* 虚拟URL的路径名
* 必须以"/"开头,后面字符允许字母、数字、"-"和"/"
*/
var REQUEST_PATH = '/qq';
/**
* 虚拟URL的页面名。
* 每个属性名都是统计请求的一个虚拟页面名,允许用字母、数字、"-"和"/"
@firedfox
firedfox / holmes-im-53kf-0.js
Created October 18, 2012 03:47
holmes-im-53kf-0
(function() {
var REQUEST_PATH = '/virtual/im/';
var REQUEST_NAME = ['53kf'];
var GET_ITEMS = function() {
return [document.getElementById('iconDivMain1')];
};
window._hmt = window._hmt || [];
@firedfox
firedfox / holmes-im-talk99.js
Created October 18, 2012 03:52
holmes-im-talk99
(function() {
var REQUEST_PATH = '/virtual/im/';
var REQUEST_NAME = ['business1', 'agent', 'tech-support', 'bussiness2', 'tel'];
var GET_ITEMS = function() {
var list = document.getElementById('doyoo_panel');
return list ? list.getElementsByTagName('a') : [];
};
window._hmt = window._hmt || [];
@firedfox
firedfox / holmes-im-v3-qiao.js
Last active October 11, 2015 23:48
holmes-im-v3-qiao
(function() {
/**
* 虚拟URL的路径名
* 必须以"/"开头,后面字符允许字母、数字、"-"和"/"
*/
var REQUEST_PATH = '/virtual/qiao';
/**
* 虚拟URL的页面名。
* 每个属性名都是统计请求的一个虚拟页面名,允许用字母、数字、"-"和"/"
@firedfox
firedfox / mine.js
Last active October 12, 2015 12:08
pan.baidu.com download list
/**
* @file 显示百度网盘文件下载链接
* @author WangYang (@firedfox)
*/
/**
* 在控制台批量输出下载地址,给文件名加链接,恢复系统右键菜单
*/
var hackLink = function(title, url) {
console.log(url);
@firedfox
firedfox / holmes-im-v3-53kf.js
Last active October 12, 2015 18:48
holmes-im-v3-53kf
(function() {
/**
* 虚拟URL的路径名
* 必须以"/"开头,后面字符允许字母、数字、"-"和"/"
*/
var REQUEST_PATH = '/virtual/53kf';
/**
* 虚拟URL的页面名。
* 每个属性名都是统计请求的一个虚拟页面名,允许用字母、数字、"-"和"/"