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
/** | |
* Created by Cyril Hou on 14-1-12. | |
*/ | |
/* | |
Object.keys fix for IE7, IE8 | |
*/ | |
if (!Object.keys) { | |
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation |
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
// ==UserScript== | |
// @name Shotcut for V2ex | |
// @namespace http://cyrilis.com | |
// @author cyr1l(me@cyrilis.com) | |
// @description V2ex 添加快捷键 | |
// @include http://*.v2ex.com/* | |
// @include http://v2ex.com/* | |
// @include http://*.v2ex.com/ | |
// @include http://v2ex.com/ | |
// @version 0.1 |
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
.line-numbers .line-number { | |
width: 22px; | |
} | |
.line-numbers { | |
background: #ececec; | |
} | |
.gist { | |
background: #eee; |
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
// ==UserScript== | |
// @name Img DownLoad Helper | |
// @namespace http://shellex.info | |
// @author cyr1l(houshoushuai@gmail.com) | |
// @description 图片下载助手-By Cyril | |
// @include http://*.*/* | |
// @include http://*.*/ | |
// @include https://*.*/* | |
// @include https://*.*/ | |
// @version 0.1 |
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 biu=0; | |
var xunhuan=function(){ | |
if($('#msgs .new-templete .bot').size()>biu) | |
{$('#chatbox input').val($('#msgs .new-templete .bot span').last().html().split('<br>',1)); | |
sendChat(); | |
biu=$('#msgs .new-templete .bot').size(); | |
console.log(biu+":"+$('#msgs .new-templete .bot span').last().html().split('<br>',1)); | |
} | |
}; | |
var kaishi=function(){ |
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
<?php | |
require("simple_html_dom.php"); | |
function get_files($dir) { | |
$files = array(); | |
for (; $dir->valid(); $dir->next()) { | |
if ($dir->isDir() && !$dir->isDot()) { | |
if ($dir->haschildren()) { | |
//$files = array_merge($files, get_files($dir->getChildren())); | |
$files =get_files($dir->getChildren()); | |
}; |
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
-- | |
-- Created by: Cyril. | |
-- Created at: 15/6/25 上午12:40 | |
-- Email: houshoushuai@gmail.com | |
-- | |
local string = require("string") | |
local find = string.find | |
_G.indexOf = function(t, x) | |
if type(t) == 'string' then |
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
-- | |
-- Created by: Cyril. | |
-- Created at: 15/6/23 下午4:04 | |
-- Email: houshoushuai@gmail.com | |
-- | |
http = require("http") | |
https = require("https") | |
local qs = require('../node_modules/luvit-querystring') |
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
$.rails.allowAction = function(link){ | |
if(link.attr('data-confirm')){ | |
$.rails.showConfirm(link); | |
return false; | |
}else{ | |
return true; | |
} | |
}; | |
$.rails.confirmed = function(link){ |
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
CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type,CGEventRef event, void *refcon){ | |
// Paranoid sanity check. | |
if ((type != kCGEventKeyDown) && (type != kCGEventKeyUp) && (type != | |
NX_SYSDEFINED)) | |
return event; | |
NSEvent *e = [NSEvent eventWithCGEvent:event]; | |
// We're getting a special event |